Skip to content

Commit adcd882

Browse files
authored
Refactored docker builder (#602)
1 parent 8c258e7 commit adcd882

File tree

3 files changed

+44
-105
lines changed

3 files changed

+44
-105
lines changed

.circleci/config.yml

Lines changed: 34 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,18 @@ commands:
7070
- store_artifacts:
7171
path: tests/logs
7272

73-
platform-build-steps:
74-
parameters:
75-
platform:
76-
type: string
73+
platforms-build-steps:
7774
steps:
78-
- setup-executor
7975
- checkout
76+
- run:
77+
name: Relocate docker overlay2 dir
78+
command: |
79+
sudo systemctl stop docker
80+
sudo mkdir -p /var2/lib/docker
81+
sudo mv /var/lib/docker/overlay2 /var2/lib/docker
82+
sudo mkdir /var/lib/docker/overlay2
83+
sudo mount --bind /var2/lib/docker/overlay2 /var/lib/docker/overlay2
84+
sudo systemctl start docker
8085
- run:
8186
name: Setup
8287
command: |
@@ -87,15 +92,16 @@ commands:
8792
command: |
8893
docker login -u redisfab -p $DOCKER_REDISFAB_PWD
8994
pushd opt/build/docker
90-
#@@ make build publish $(./version-params) CPU=1 OSNICK=<<parameters.platform>> X64=1 ARTIFACTS=1 TEST=1 VERBOSE=1
91-
make build publish $(./version-params) CPU=1 OSNICK=<<parameters.platform>> X64=1 ARTIFACTS=1 VERBOSE=1
92-
make build publish $(./version-params) GPU=1 OSNICK=<<parameters.platform>> X64=1 ARTIFACTS=1 VERBOSE=1
95+
for osnick in bionic xenial; do
96+
make CPU=1 OSNICK=$osnick ARTIFACTS=1 VERBOSE=1
97+
make GPU=1 OSNICK=$osnick ARTIFACTS=1 VERBOSE=1
98+
done
9399
popd > /dev/null
94100
logstar=bin/artifacts/tests-logs-cpu.tgz
95101
logsdir=tests/logs/cpu
96102
mkdir -p $logsdir
97103
if [[ -e $logstar ]]; then tar -C $logsdir -xzf $logstar; fi
98-
(cd bin/artifacts; tar -cf snapshots-<<parameters.platform>>.tar snapshots/)
104+
(cd bin/artifacts; tar -cf snapshots.tar snapshots/)
99105
no_output_timeout: 40m
100106
- persist_to_workspace:
101107
root: bin/
@@ -106,27 +112,6 @@ commands:
106112
- store_artifacts:
107113
path: test/logs
108114

109-
dockerhub-build-steps:
110-
parameters:
111-
build_args:
112-
type: string
113-
steps:
114-
- setup-executor
115-
- checkout
116-
- run:
117-
name: Setup
118-
command: |
119-
git submodule update --init --recursive
120-
./opt/readies/bin/getpy3
121-
- run:
122-
name: Build for platform
123-
command: |
124-
docker login -u redisfab -p $DOCKER_REDISFAB_PWD
125-
cd opt/build/docker
126-
make build publish $(./version-params) CPU=1 OSNICK=bionic X64=1 REPO=redislabs VERBOSE=1 <<parameters.build_args>>
127-
make build publish $(./version-params) GPU=1 OSNICK=bionic X64=1 REPO=redislabs VERBOSE=1 <<parameters.build_args>>
128-
no_output_timeout: 40m
129-
130115
deploy-steps:
131116
parameters:
132117
from:
@@ -159,15 +144,14 @@ jobs:
159144
- build-steps:
160145
platform: debian
161146

162-
platform-build:
163-
parameters:
164-
platform:
165-
type: string
166-
docker:
167-
- image: debian:buster
147+
platforms-build:
148+
machine:
149+
enabled: true
150+
docker_layer_caching: true
151+
resource_class: gpu.nvidia.small
152+
image: ubuntu-1604-cuda-11.1:202012-01
168153
steps:
169-
- platform-build-steps:
170-
platform: <<parameters.platform>>
154+
- platforms-build-steps
171155

172156
coverage:
173157
docker:
@@ -281,6 +265,15 @@ jobs:
281265
- run:
282266
name: Submodule checkout
283267
command: git submodule update --init --recursive
268+
- run:
269+
name: Relocate docker overlay2 dir
270+
command: |
271+
sudo systemctl stop docker
272+
sudo mkdir -p /var2/lib/docker
273+
sudo mv /var/lib/docker/overlay2 /var2/lib/docker
274+
sudo mkdir /var/lib/docker/overlay2
275+
sudo mount --bind /var2/lib/docker/overlay2 /var/lib/docker/overlay2
276+
sudo systemctl start docker
284277
- run:
285278
name: Build
286279
command: |
@@ -292,17 +285,7 @@ jobs:
292285
docker run --gpus all -v $HOME/tests:/build/tests/logs -it --rm redisai-gpu:latest-x64-bionic-test
293286
no_output_timeout: 40m
294287
- store_artifacts:
295-
path: test/log
296-
297-
dockerhub-build:
298-
parameters:
299-
build_args:
300-
type: string
301-
docker:
302-
- image: debian:buster
303-
steps:
304-
- dockerhub-build-steps:
305-
build_args: <<parameters.build_args>>
288+
path: tests/logs
306289

307290
deploy-artifacts:
308291
parameters:
@@ -411,9 +394,7 @@ after-build-and-test: &after-build-and-test
411394

412395
after-platform-builds: &after-platform-builds
413396
requires:
414-
# - build-centos7
415-
- build-bionic
416-
- build-xenial
397+
- platforms-build
417398

418399
platform-build-defs: &platform-build-defs
419400
<<: *after-build-and-test
@@ -430,17 +411,7 @@ workflows:
430411
- build-and-test:
431412
<<: *on-any-branch
432413
<<: *after-linter
433-
- platform-build:
434-
name: build-centos7
435-
platform: centos7
436-
<<: *never # temporarily disabled
437-
- platform-build:
438-
name: build-bionic
439-
platform: bionic
440-
<<: *platform-build-defs
441-
- platform-build:
442-
name: build-xenial
443-
platform: xenial
414+
- platforms-build:
444415
<<: *platform-build-defs
445416
- coverage:
446417
context: common
@@ -474,22 +445,10 @@ workflows:
474445
context: common
475446
<<: *after-platform-builds
476447
<<: *on-integ-branch
477-
- dockerhub-build:
478-
name: dockerhub-edge
479-
context: common
480-
build_args: EDGE=1
481-
<<: *after-build-and-test
482-
<<: *on-master
483448
- deploy-release:
484449
context: common
485450
<<: *after-platform-builds
486451
<<: *on-version-tags
487-
- dockerhub-build:
488-
name: dockerhub-release
489-
context: common
490-
build_args: LATEST=1
491-
<<: *after-platform-builds
492-
<<: *on-version-tags
493452

494453
nightly:
495454
triggers:

opt/build/docker/Makefile

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,23 @@ include $(ROOT)/opt/readies/mk/main
66
# OSNICK=buster|stretch|bionic|xenial|centos7
77
OSNICK ?= buster
88

9-
ifeq ($(REPO),redislabs)
10-
SIMPLE ?= 1
11-
else
12-
REPO=redisfab
13-
endif
14-
15-
STEM=$(REPO)/redisai
9+
REPO=redisai
1610

17-
LATEST_BRANCH=1.2
11+
# LATEST_BRANCH=1.2
12+
INT_BRANCHES=1.2
1813

1914
REDIS_VER:=6.0.9
2015

2116
ART_DIR=$(ROOT)/bin/artifacts
2217
ART_INT_DIR=/var/opt/redislabs/artifacts
2318

24-
FETCH_ARGS.arm64v8=WITH_ORT=0 WITH_PT=0
25-
BUILD_ARGS.arm64v8=WITH_ORT=0 WITH_PT=0
26-
27-
FETCH_ARGS.arm32v7=WITH_ORT=0 WITH_PT=0
28-
BUILD_ARGS.arm32v7=WITH_ORT=0 WITH_PT=0
19+
#----------------------------------------------------------------------------------------------
2920

3021
ifeq ($(CPU),1)
31-
VAR=cpu
32-
33-
FETCH_ARGS=$(FETCH_ARGS.$(ARCH))
34-
BUILD_ARGS=$(BUILD_ARGS.$(ARCH))
22+
VARIANT=cpu
3523

3624
else ifeq ($(GPU),1)
37-
VAR=gpu
25+
VARIANT=gpu
3826
DOCKERFILE_STEM ?= $(ROOT)/Dockerfile.gpu
3927

4028
OS.custom:=1
@@ -43,20 +31,12 @@ OS.centos7=centos7
4331
OS.bionic=ubuntu18.04
4432
OS.xenial=ubuntu16.04
4533

46-
FETCH_ARGS=$(FETCH_ARGS.$(ARCH))
47-
BUILD_ARGS=$(BUILD_ARGS.$(ARCH))
48-
4934
else ifeq ($(JETSON),1)
50-
VAR=jetson
35+
VARIANT=jetson
5136
DOCKERFILE_STEM ?= $(ROOT)/Dockerfile.jetson
5237

53-
# FETCH_ARGS=WITH_TF=1 WITH_PT=1 WITH_TFLITE=0 WITH_ORT=0
54-
# BUILD_ARGS=WITH_TF=1 WITH_PT=1 WITH_TFLITE=0 WITH_ORT=0
55-
5638
endif
5739

58-
# DOCKER_BUILD_ARGS += \
59-
# DEPS_ARGS="$(FETCH_ARGS)" \
60-
# BUILD_ARGS="$(BUILD_ARGS)"
40+
#----------------------------------------------------------------------------------------------
6141

62-
include $(MK)/docker
42+
include $(MK)/docker.native

0 commit comments

Comments
 (0)