Skip to content

CircleCI: multiarch docker build + selective engines build #211

New issue

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

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

Already on GitHub? # to your account

Merged
merged 35 commits into from
Sep 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
435dcb9
Readies sync
rafie Sep 5, 2019
fc5e0fe
CircleCI: multiarch docker build
rafie Sep 5, 2019
acf7bcf
Readies sync
rafie Sep 5, 2019
d350be0
CircleCI: multiarch docker build #2
rafie Sep 5, 2019
139e8df
CircleCI: multiarch docker build #3
rafie Sep 5, 2019
fd65d33
Readies sync
rafie Sep 5, 2019
12b4eee
CircleCI: multiarch docker build
rafie Sep 5, 2019
d88cacb
Readies sync
rafie Sep 5, 2019
58bd6c5
CircleCI: multiarch docker build #2
rafie Sep 5, 2019
312c8dc
CircleCI: multiarch docker build #3
rafie Sep 5, 2019
aaf65ce
Support selective build (i.e. excluding engines)
rafie Sep 7, 2019
40d28cf
Merge branch 'rafi-ci-docker-1' of ssh://github.com/RedisAI/RedisAI i…
rafie Sep 7, 2019
0790027
CircleCI: multiarch docker build #4
rafie Sep 7, 2019
6c03f30
CircleCI: multiarch docker build #5
rafie Sep 7, 2019
d6b602a
CircleCI: multiarch docker build #6
rafie Sep 7, 2019
cf6da50
CircleCI: multiarch docker build #7
rafie Sep 7, 2019
e079ac7
CircleCI: multiarch docker build #8
rafie Sep 7, 2019
60a3004
CircleCI: multiarch docker build #9
rafie Sep 8, 2019
c51282c
Disabled CircleCI restore from cache
rafie Sep 8, 2019
22c0e59
Reverted python3 dependency installation
rafie Sep 8, 2019
3ea1e6f
CircleCI: multiarch docker build #10
rafie Sep 8, 2019
2cda2c0
CircleCI: multiarch docker build #11
rafie Sep 8, 2019
6753c3c
system-setup: fixed Python libs installations
rafie Sep 9, 2019
fb15b50
Fixed tensorflow collect script
rafie Sep 9, 2019
d0726ce
Merge remote-tracking branch 'origin/master' into rafi-ci-docker-1
rafie Sep 15, 2019
000a199
Enabled macOS in CircleCI + Fixed basic_tests.py for decoding
rafie Sep 15, 2019
9037f4e
CircleCI: moved to rmbuilder:x64-build
rafie Sep 15, 2019
c843a4c
CircleCI fixes #2
rafie Sep 15, 2019
c8d1ce8
CircleCI fixes #3
rafie Sep 15, 2019
f36c4fd
CircleCI fixes #4
rafie Sep 15, 2019
e9b3e1d
Reverted RLTest decoding-related change
rafie Sep 16, 2019
3bd4990
CircleCI fixes #5
rafie Sep 18, 2019
e0b2b99
Tests: double-panda.py to diagnose macOS issue
rafie Sep 18, 2019
26e10a4
get_deps: download libtorch from original url
rafie Sep 19, 2019
41f58b1
paella: fixed urllib3 issue
rafie Sep 19, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 50 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ commands:
type: string
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "get_deps.sh" }}
# fallback to using the latest cache if no exact match is found
# - v1-dependencies-
# - restore_cache:
# keys:
# - v1-dependencies-{{ checksum "get_deps.sh" }}
# # fallback to using the latest cache if no exact match is found
# # - v1-dependencies-
- run:
name: Install dependencies
command: |
sudo ./opt/readies/bin/getpy
sudo ./opt/system-setup.py
git clone git://github.com/antirez/redis.git --branch 5.0.5
(cd redis && make malloc=libc -j $(nproc) && sudo make install)
./opt/readies/bin/getpy
./opt/system-setup.py
# git clone git://github.com/antirez/redis.git --branch 5.0.5
# (cd redis && make malloc=libc -j $(nproc) && make install)
./get_deps.sh cpu
- save_cache:
paths:
Expand All @@ -27,29 +27,29 @@ commands:
- run:
name: Set up workspace
command: |
sudo mkdir -p /workspace
sudo chown `whoami` /workspace
mkdir -p ~/workspace
chown `whoami` ~/workspace
- run:
name: Build
command: make -C opt all SHOW=1
- run:
name: Test
command: |
mkdir -p /workspace/tests
mkdir -p ~/workspace/tests
make -C opt test SHOW=1
cp test/logs/* /workspace/tests
cp test/logs/* ~/workspace/tests
- run:
name: Package
command: make -C opt pack BRANCH="${CIRCLE_BRANCH//[^A-Za-z0-9._-]/_}" INTO=/workspace/packages SHOW=1
command: make -C opt pack BRANCH="${CIRCLE_BRANCH//[^A-Za-z0-9._-]/_}" INTO=~/workspace/packages SHOW=1
- persist_to_workspace:
root: /workspace
root: ~/workspace
paths:
- 'packages/release/*.zip'
- 'packages/release/*.tgz'
- 'packages/branch/*.zip'
- 'packages/branch/*.tgz'
- store_test_results:
path: /workspace/tests
path: ~/workspace/tests
deploy:
parameters:
from:
Expand All @@ -63,9 +63,7 @@ commands:
jobs:
build:
docker:
- image: circleci/python:3.7.4-buster
environment:
DEPS: ""
- image: redisfab/rmbuilder:x64-buster
steps:
- ci_steps:
platform: debian
Expand All @@ -75,24 +73,41 @@ jobs:
steps:
- ci_steps:
platform: macosx
build-multiarch-docker:
machine:
enabled: true
image: ubuntu-1604:201903-01
steps:
- checkout
- run:
name: Setup Docker client experimental features
command: |
sudo ./opt/readies/bin/getdocker --just-enable-exp
docker version
- run:
name: Build
command: |
sudo docker login -u redisfab -p $DOCKER_REDISFAB_PWD
make -C opt/build/docker build
sudo make -C opt/build/docker publish

deploy_package:
parameters:
package:
type: string
docker:
- image: 'redislabsmodules/rmbuilder:latest'
- image: redisfab/rmbuilder:x64-buster
steps:
- attach_workspace:
at: /workspace
at: ~/workspace
- deploy:
from: /workspace/packages/<<parameters.package>>
from: ~/workspace/packages/<<parameters.package>>
- store_artifacts:
path: /workspace/packages/<<parameters.package>>
path: ~/workspace/packages/<<parameters.package>>

deploy_docs:
docker:
- image: 'redislabsmodules/rmbuilder:latest'
- image: redisfab/rmbuilder:x64-buster
steps:
- checkout
- run:
Expand All @@ -111,16 +126,23 @@ workflows:
filters:
tags:
only: /.*/
# - build-macos:
# filters:
# tags:
# only: /.*/
- build-macos:
filters:
tags:
only: /.*/
- build-multiarch-docker:
filters:
tags:
only: /.*/
branches:
only: master
- deploy_package:
name: deploy_branch
package: branch
requires:
- build
filters:
# # uncomment to debug
# tags:
# only: /.*/
branches:
Expand Down
16 changes: 11 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")

# For adding specific Release flags
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")

# Add -fno-omit-frame-pointer to avoid seeing incomplete stack traces
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -ggdb -fno-omit-frame-pointer")
Expand Down Expand Up @@ -93,9 +93,15 @@ ADD_DEFINITIONS(-DREDISMODULE_EXPERIMENTAL_API)
IF(BUILD_TF)
FIND_LIBRARY(TF_LIBRARIES NAMES tensorflow
PATHS ${depsAbs}/libtensorflow/lib)
MESSAGE(STATUS "Found TensorFlow Libraries: \"${TF_LIBRARIES}\")")
IF (NOT TF_LIBRARIES)
MESSAGE(FATAL_ERROR "Could not find tensorflow in ${depsAbs}/libtensorflow/lib")
MESSAGE(WARNING "Could not find TensorFlow in ${depsAbs}/libtensorflow/lib. Trying find_package method")
FIND_PACKAGE(TensorFlow REQUIRED)
SET(TF_LIBRARIES ${TensorFlow_LIBRARY})
IF (NOT TF_LIBRARIES)
MESSAGE(FATAL_ERROR "Could not find TensorFlow")
ELSE()
MESSAGE(STATUS "Found TensorFlow Libraries: \"${TF_LIBRARIES}\")")
ENDIF()
ENDIF()
ENDIF()

Expand Down Expand Up @@ -192,7 +198,7 @@ IF(BUILD_TORCH)
SET_TARGET_PROPERTIES(redisai_torch PROPERTIES SUFFIX ".so")
IF (APPLE)
SET_TARGET_PROPERTIES(redisai_torch PROPERTIES INSTALL_RPATH "@loader_path/lib")
ELSE ()
ELSE()
ADD_LDFLAGS(redisai_torch "-Wl,--enable-new-dtags")
SET_TARGET_PROPERTIES(redisai_torch PROPERTIES INSTALL_RPATH "\$ORIGIN/lib")
ENDIF()
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ COPY ./test/test_requirements.txt test/
RUN ./opt/readies/bin/getpy
RUN ./opt/system-setup.py

ARG DEPS_ARGS=""
COPY ./get_deps.sh .
RUN ./get_deps.sh cpu
RUN if [ "$DEPS_ARGS" = "" ]; then ./get_deps.sh cpu; else env $DEPS_ARGS ./get_deps.sh cpu; fi

ARG BUILD_ARGS=""
ADD ./ /build
RUN make -C opt build SHOW=1
RUN make -C opt build $BUILD_ARGS SHOW=1

ARG PACK=0
ARG TEST=0
Expand Down
11 changes: 6 additions & 5 deletions Dockerfile.arm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ARG OSNICK=buster

# OS=debian:buster-slim|debian:stretch-slim|ubuntu:bionic
OS=debian:buster-slim
ARG OS=debian:buster-slim

# ARCH=arm64v8|arm32v7
ARG ARCH=arm64v8
Expand All @@ -14,7 +14,6 @@ FROM redisfab/redis-${ARCH}-${OSNICK}-xbuild:5.0.5 AS builder

RUN [ "cross-build-start" ]

ADD ./ /build
WORKDIR /build

COPY ./opt/ opt/
Expand All @@ -23,11 +22,13 @@ COPY ./test/test_requirements.txt test/
RUN ./opt/readies/bin/getpy
RUN ./opt/system-setup.py

ARG DEPS_ARGS=""
COPY ./get_deps.sh .
RUN ./get_deps.sh cpu
RUN if [ "$DEPS_ARGS" = "" ]; then ./get_deps.sh cpu; else env $DEPS_ARGS ./get_deps.sh cpu; fi

ADD ./ /redisai
RUN make -C opt all SHOW=1
ARG BUILD_ARGS=""
ADD ./ /build
RUN make -C opt build $BUILD_ARGS SHOW=1

ARG PACK=0
ARG TEST=0
Expand Down
Loading