Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM support and build system refactoring #161

Merged
merged 65 commits into from
Aug 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
c70381c
ARM (aarch64) support #1
rafie May 21, 2019
8347c53
ARM (aarch64) support #2
rafie May 21, 2019
b2d6c2d
ARM (aarch64) support #3
rafie May 21, 2019
a53f3e7
ARM (aarch64) support #1
rafie May 21, 2019
b9ca2d2
ARM (aarch64) support #2
rafie May 21, 2019
48ce927
ARM (aarch64) support #3
rafie May 21, 2019
a3d23ef
Merge branch 'rafi-arm1' of ssh://github.com/RedisTimeSeries/RedisTim…
rafie Jun 5, 2019
6b681ea
ARM (aarch64) support #4
rafie Jun 5, 2019
e23d9f5
ARM (aarch64) support #5
rafie Jun 10, 2019
44c2c22
ARM (aarch64) support #6
rafie Jun 11, 2019
0044c57
ARM support #7
rafie Jun 26, 2019
ce68ba6
ARM (aarch64) support #1
rafie May 21, 2019
19399bc
ARM (aarch64) support #2
rafie May 21, 2019
c7cc97f
ARM (aarch64) support #3
rafie May 21, 2019
e2d58c4
ARM (aarch64) support #1
rafie May 21, 2019
445f8c2
ARM (aarch64) support #4
rafie Jun 5, 2019
621ca9c
ARM (aarch64) support #5
rafie Jun 10, 2019
c05af03
ARM (aarch64) support #6
rafie Jun 11, 2019
4eb4da8
ARM support #7
rafie Jun 26, 2019
c6c4b2f
Merge branch 'rafi-arm1' of ssh://github.com/RedisTimeSeries/RedisTim…
rafie Jun 26, 2019
48e24df
Rebase
rafie Jun 26, 2019
1ce15b7
Build environment refactoring
rafie Jun 26, 2019
ee60482
Build environment refactoring #2
rafie Jun 26, 2019
4312f41
Added multi-arch docker Makefile
rafie Jun 30, 2019
128c3df
ARM support #8
rafie Jul 1, 2019
d13e43e
Build environment refactoring #3
rafie Jul 1, 2019
e2dba5b
Build environment refactoring #4
rafie Jul 2, 2019
5a16722
Build environment refactoring #5
rafie Jul 2, 2019
7415f23
Build environment refactoring #6
rafie Jul 2, 2019
12ab9d3
Build environment refactoring #7
rafie Jul 2, 2019
1f06a66
Build environment refactoring #8
rafie Jul 2, 2019
f92a818
Build environment refactoring #9
rafie Jul 2, 2019
0d995dc
Fixed .circleci/config.yml
rafie Jul 2, 2019
efd7376
Fixed .circleci/config.yml #2
rafie Jul 2, 2019
bceac21
Fixed .circleci/config.yml #3
rafie Jul 2, 2019
203b31a
Fixed .circleci/config.yml #4
rafie Jul 2, 2019
6718080
Fixed .circleci/config.yml #5
rafie Jul 2, 2019
5447a7a
Fixed .circleci/config.yml #6
rafie Jul 2, 2019
7b89ebb
Build environment refactoring #10
rafie Jul 2, 2019
cb9e7f7
Build environment refactoring #11
rafie Jul 2, 2019
e6e9853
Build environment refactoring #12
rafie Jul 2, 2019
3c6f5c1
Build environment refactoring #13
rafie Jul 2, 2019
c604655
Build environment refactoring #14
rafie Jul 2, 2019
b7e0dee
Build environment refactoring #15
rafie Jul 2, 2019
a73958a
Build environment refactoring #16
rafie Jul 3, 2019
47a28b9
Build environment refactoring #17
rafie Jul 3, 2019
54cf9b0
Build environment refactoring #18
rafie Jul 3, 2019
aae7100
Build environment refactoring #19
rafie Jul 7, 2019
d1a8402
Merge remote-tracking branch 'origin/master' into rafi-arm1
rafie Jul 10, 2019
be155b3
Readies updates
rafie Jul 12, 2019
5d6fe01
Updated QA automation run script
rafie Jul 24, 2019
40c59cc
Merge remote-tracking branch 'origin/master' into rafi-arm1
rafie Jul 24, 2019
2cce523
Build environment refactoring #20
rafie Jul 25, 2019
57c3914
Build environment refactoring #21
rafie Jul 25, 2019
13bc929
Merge remote-tracking branch 'origin/master' into rafi-arm1
rafie Aug 12, 2019
c49ca5f
Makefile: remove -fno-common
rafie Aug 12, 2019
bfd4aeb
Readies: paella updates
rafie Aug 12, 2019
206e909
Readies: updated scripts
rafie Aug 19, 2019
9f9a961
Merge remote-tracking branch 'origin/master' into rafi-arm1
rafie Aug 19, 2019
1c19b04
OSX build fixes + CircleCI OSX job
rafie Aug 19, 2019
c1efbf8
Enabled CircleCI OSX job
rafie Aug 19, 2019
b8ab953
Makefile: removed strip on macOS
rafie Aug 19, 2019
ad65903
Disabled macOS on CircleCI + removed symbol stripping
rafie Aug 19, 2019
966b3c0
Build: fix few bindirs glitches
rafie Aug 19, 2019
8d942ad
Build: fixed gdb and valgrind targets
rafie Aug 19, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
158 changes: 57 additions & 101 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,114 +1,72 @@
version: 2
jobs:
build:
docker:
- image: 'redislabsmodules/rmbuilder:latest'
version: 2.1

commands:
ci_steps:
parameters:
platform:
type: string
steps:
- checkout
- run:
name: "Pull Submodules"
command: |
git submodule init
git submodule update --remote
name: Pull Submodules
command: make fetch
- run:
name: Install prerequisite
command: >-
apt-get update; apt-get install -y cmake; pip install -r src/tests/requirements.txt
name: Install prerequisites
command: make setup
- run:
name: Build
command: cd src && make -j 8
command: make build SHOW=1
- run:
name: Test
command: cd src && mkdir -p /workspace/tests && make tests EXTRA_ARGS="--junitxml=/workspace/tests/tests_report.xml"
command: make test SHOW=1
- run:
name: Persist Artifacts
command: >-
mkdir -p /workspace/build && cp src/$MODULE_ARTIFACT /workspace/ &&
cp ramp.yml /workspace/ &&
cp src/clean_ramp.py /workspace; ls -la /workspace
name: Package
command: make pack BRANCH="$(CIRCLE_BRANCH)" INTO=/workspace/packages SHOW=1
- persist_to_workspace:
root: /workspace
root: /workspace/packages
paths:
- '*.so'
- '*.yml'
- '*.py'
- build
- 'release/*.zip'
- 'branch/*.zip'
- store_test_results:
path: /workspace/tests
package_branch:
docker:
- image: 'redislabsmodules/rmbuilder:latest'
deploy:
parameters:
from:
type: string
steps:
- attach_workspace:
at: /workspace
- run:
name: Package
name: Deploy to S3
command: >-
ramp pack -m /workspace/ramp.yml -o
/workspace/build/$PACKAGE_NAME.{os}-{architecture}.$CIRCLE_BRANCH.zip
/workspace/$MODULE_ARTIFACT
- run:
name: Clean RAMP file
shell: /bin/bash
command: |
/workspace/clean_ramp.py /workspace/build/*.zip
- persist_to_workspace:
root: /workspace
paths:
- build
- store_artifacts:
path: /workspace/build
package_release:
aws s3 cp <<parameters.from>>/ s3://redismodules/$PACKAGE_NAME/ --acl public-read --recursive --exclude "*" --include "*.zip"

jobs:
build:
docker:
- image: 'redislabsmodules/rmbuilder:latest'
steps:
- attach_workspace:
at: /workspace
- run:
name: Package
command: >-
ramp pack -m /workspace/ramp.yml -o
/workspace/build/$PACKAGE_NAME.{os}-{architecture}.{semantic_version}.zip
/workspace/$MODULE_ARTIFACT
- run:
name: Package
command: >-
ramp pack -m /workspace/ramp.yml -o
/workspace/build/$PACKAGE_NAME.{os}-{architecture}.latest.zip
/workspace/$MODULE_ARTIFACT
- run:
name: Clean RAMP file
shell: /bin/bash
command: |
/workspace/clean_ramp.py /workspace/build/*.zip
- persist_to_workspace:
root: /workspace
paths:
- build
- store_artifacts:
path: /workspace/build
deploy_branch:
docker:
- image: 'redislabsmodules/rmbuilder:latest'
- ci_steps:
platform: debian
build-macos:
macos:
xcode: 10.2.1
steps:
- attach_workspace:
at: /workspace
- run:
name: Deploy to S3
command: >-
aws s3 cp /workspace/build/ s3://redismodules/$PACKAGE_NAME/ --acl
public-read --recursive --exclude "*" --include "*.zip"
deploy_release:
- ci_steps:
platform: macosx

deploy_package:
parameters:
package:
type: string
docker:
- image: 'redislabsmodules/rmbuilder:latest'
steps:
- attach_workspace:
at: /workspace
- run:
name: Deploy to S3
command: >-
aws s3 cp /workspace/build/ s3://redismodules/$PACKAGE_NAME/ --acl
public-read --recursive --exclude "*" --include "*.zip"
- deploy:
from: /workspace/packages/<<parameters.package>>
- store_artifacts:
path: /workspace/packages/<<parameters.package>>

deploy_docs:
docker:
- image: 'redislabsmodules/rmbuilder:latest'
Expand All @@ -120,9 +78,8 @@ jobs:
- run:
name: Deploy Docs to S3
command: >-
aws s3 cp site s3://oss.redislabs.com/$WEBSITE_FOLDER/ --acl
public-read --recursive

aws s3 cp site s3://oss.redislabs.com/$WEBSITE_FOLDER/ --acl public-read --recursive

run_automation:
docker:
- image: 'redislabsmodules/rmbuilder:latest'
Expand All @@ -135,7 +92,7 @@ jobs:
-H "Content-Type: application/json"
-d '{"service_id":"single_module_test_cycle_sanity_and_extended", "name":"redistimeseries automation-testing", "properties":{"sut_version":"master", "email_recipients":"t9b6i7v6e2q3d0s4@redislabs.slack.com", "sut_environments":[], "tools_environment":{}, "module_name": "redistimeseries", "module_version":"master", "cycle_environments_setup":[{"teardown":true, "name":"xenial-amd64-aws", "concurrency":1}, {"teardown":true, "name":"bionic-amd64-aws", "concurrency":1}]}}'
https://qa-automation-center.redislabs.com/processes

workflows:
version: 2
build_and_package:
Expand All @@ -144,32 +101,31 @@ workflows:
filters:
tags:
only: /.*/
- package_branch:
# - build-macos:
# filters:
# tags:
# only: /.*/
- deploy_package:
name: deploy_branch
package: branch
requires:
- build
filters:
branches:
only: master
- package_release:
- deploy_package:
name: deploy_release
package: release
requires:
- build
filters:
branches:
ignore: /.*/
tags:
only: '/^v[0-9].*/'
- deploy_branch:
requires:
- package_branch
- run_automation:
requires:
- deploy_branch
- deploy_release:
filters:
tags:
only: '/^v[0-9].*/'
requires:
- package_release
- deploy_docs:
filters:
branches:
Expand Down
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bin/
/VARIANT
/BINDIR

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ __pycache__
venv/
.idea/
.DS_Store
tests/.cache/
/tests/.cache/
/bin/
/VARIANT
/BINDIR
/tests/tests_report.xml
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "RedisModulesSDK"]
path = RedisModulesSDK
url = https://github.com/RedisLabs/RedisModulesSDK.git
[submodule "deps/RedisModulesSDK"]
path = deps/RedisModulesSDK
url = https://github.com/RedisLabs/RedisModulesSDK.git
59 changes: 29 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
FROM redis:latest as builder

ENV DEPS "build-essential"

# Set up a build environment
RUN set -ex;\
deps="$DEPS";\
apt-get update;\
apt-get install -y --no-install-recommends $deps;
# Build the source
ADD ./ /redis-timeseries

# Build Redis-TimeSeries
WORKDIR /redis-timeseries
RUN set -ex;\
cd RedisModulesSDK/rmutil;\
make clean;\
make;\
cd -;
RUN set -ex;\
cd src;\
make clean; \
make;

# Package the runner
FROM redis:latest
# BUILD redisfab/redistimeseries-${OSNICK}:M.m.b-${ARCH}

# stretch|bionic|buster
ARG OSNICK=buster

# ARCH=x64|arm64v8|arm32v7
ARG ARCH=x64

#----------------------------------------------------------------------------------------------
# FROM redis:latest AS builder
FROM redisfab/redis-${ARCH}-${OSNICK}:5.0.5 AS builder

ADD ./ /build
WORKDIR /build

RUN ./deps/readies/bin/getpy2
RUN ./system-setup.py
RUN make fetch

ENV X_NPROC "cat /proc/cpuinfo|grep processor|wc -l"
RUN echo nproc=$(nproc); echo NPROC=$(eval "$X_NPROC")
RUN make build

#----------------------------------------------------------------------------------------------
# FROM redis:latest
FROM redisfab/redis-${ARCH}-${OSNICK}:5.0.5

ENV LIBDIR /usr/lib/redis/modules
WORKDIR /data
RUN set -ex;\
mkdir -p "$LIBDIR";
RUN mkdir -p "$LIBDIR"

COPY --from=builder /redis-timeseries/src/redistimeseries.so "$LIBDIR"
COPY --from=builder /build/bin/redistimeseries.so "$LIBDIR"

EXPOSE 6379
CMD ["redis-server", "--loadmodule", "/usr/lib/redis/modules/redistimeseries.so"]
41 changes: 41 additions & 0 deletions Dockerfile.arm
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# BUILD redisfab/redistimeseries-${OSNICK}:M.m.b-${ARCH}

# stretch|bionic|buster
ARG OSNICK=buster

# ARCH=arm64v8|arm32v7
ARG ARCH=arm64v8

#----------------------------------------------------------------------------------------------
FROM redisfab/redis-${ARCH}-${OSNICK}-xbuild:5.0.5 as builder

RUN [ "cross-build-start" ]

ADD ./ /build
WORKDIR /build

RUN ./deps/readies/bin/getpy2
RUN ./system-setup.py
RUN make fetch

ENV X_NPROC "cat /proc/cpuinfo|grep processor|wc -l"
RUN echo nproc=$(nproc); echo NPROC=$(eval "$X_NPROC")
RUN make build

RUN [ "cross-build-end" ]

#----------------------------------------------------------------------------------------------
FROM redisfab/redis-${ARCH}-${OSNICK}-xbuild:5.0.5

RUN [ "cross-build-start" ]

ENV LIBDIR /usr/lib/redis/modules
WORKDIR /data
RUN mkdir -p "$LIBDIR"

COPY --from=builder /build/bin/redistimeseries.so "$LIBDIR"

EXPOSE 6379
CMD ["redis-server", "--loadmodule", "/usr/lib/redis/modules/redistimeseries.so"]

RUN [ "cross-build-end" ]
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

.PHONY: all setup fetch build test pack

all: fetch build

setup:
@./deps/readies/bin/getpy2
@python ./system-setup.py

fetch:
@git submodule update --init --recursive

build:
@make -C src all -j

test:
@make -C src tests

pack:
@make -C src package

# deploy:
# @make -C src deploy
1 change: 0 additions & 1 deletion RedisModulesSDK
Submodule RedisModulesSDK deleted from 1da361