Skip to content

Commit bdad5a3

Browse files
chayimalonre24
andauthored
storage hack for overlay (#855)
Co-authored-by: alonre24 <alonreshef24@gmail.com>
1 parent 8fc77bc commit bdad5a3

File tree

1 file changed

+84
-34
lines changed

1 file changed

+84
-34
lines changed

.circleci/config.yml

Lines changed: 84 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ commands:
5757
fi
5858
5959
relocate-docker-storage:
60+
description: >-
61+
If this runs in parallel it can slaughter docker builds due to behaviour in the overlay2
62+
tree having missing bits. This mitigates that by ensuring we run it only once. This could
63+
have parallelization consequences if everything lines up.
6064
steps:
6165
- run:
6266
name: Relocate docker overlay2 dir
@@ -91,6 +95,25 @@ commands:
9195
name: Checkout submodules
9296
command: git submodule update --init --recursive
9397

98+
docker-build-steps:
99+
parameters:
100+
lite: # LITE value during make
101+
type: string
102+
osnick: # OSNICK value for the base platform of the docker
103+
type: string
104+
target: # CPU|GPU
105+
type: string
106+
steps:
107+
# since we run in parallel, we need to generate docker files with different suffixes hence the DOCKER_SUFFIX
108+
- run:
109+
name: Build for platform
110+
command: |
111+
bash <(curl -fsSL https://raw.githubusercontent.com/docker/docker-install/master/install.sh)
112+
pushd opt/build/docker
113+
docker login -u redisfab -p $DOCKER_REDISFAB_PWD
114+
make build DOCKER_SUFFIX="$$" <<parameters.target>> OSNICK=<<parameters.osnick>> PACK=1 VERBOSE=1 <<parameters.lite>>
115+
no_output_timeout: 40m
116+
94117
build-steps:
95118
parameters:
96119
platform:
@@ -220,53 +243,68 @@ jobs:
220243
- build-steps:
221244
platform: debian
222245

223-
platforms-build:
246+
platforms-build-cpu:
247+
docker:
248+
- image: redisfab/rmbuilder:6.2.5-x64-buster
249+
parameters:
250+
lite: # LITE value during make
251+
type: string
252+
osnick: # OSNICK value for the base platform of the docker
253+
type: string
254+
target: # OSNICK value for the base platform of the docker
255+
type: string
256+
default: "CPU=1"
257+
steps:
258+
- abort_for_docs
259+
- abort_for_noci
260+
- early_return_for_forked_pull_requests
261+
- setup_remote_docker
262+
- checkout-all
263+
- restore_cache:
264+
keys:
265+
- v1.2.5-deps-{{ checksum "get_deps.sh" }}-<<parameters.osnick>>-<<parameters.target>>
266+
- setup-automation
267+
- docker-build-steps:
268+
lite: "<<parameters.lite>>"
269+
osnick: "<<parameters.osnick>>"
270+
target: "<<parameters.target>>"
271+
- save_cache:
272+
paths:
273+
- deps
274+
key: v1.2.5-deps-{{ checksum "get_deps.sh" }}-<<parameters.osnick>>-<<parameters.target>>
275+
- persist_to_workspace:
276+
root: bin/
277+
paths:
278+
- artifacts/*
279+
280+
281+
platforms-build-gpu:
224282
machine:
225283
enabled: true
226-
docker_layer_caching: true
227-
resource_class: small
284+
resource_class: medium
228285
image: ubuntu-2004:202107-02
229286
parameters:
230287
lite: # LITE value during make
231288
type: string
232289
osnick: # OSNICK value for the base platform of the docker
233290
type: string
234-
target: # CPU|GPU
291+
target: # OSNICK value for the base platform of the docker
235292
type: string
293+
default: "GPU=1"
236294
steps:
237295
- abort_for_docs
238296
- abort_for_noci
239297
- early_return_for_forked_pull_requests
240298
- checkout-all
241-
- run:
242-
name: Relocate docker overlay2 dir
243-
command: |
244-
sudo systemctl stop docker
245-
sudo mkdir -p /var2/lib/docker
246-
sudo mv /var/lib/docker/overlay2 /var2/lib/docker
247-
sudo mkdir /var/lib/docker/overlay2
248-
sudo mount --bind /var2/lib/docker/overlay2 /var/lib/docker/overlay2
249-
sudo systemctl start docker
299+
- relocate-docker-storage
250300
- restore_cache:
251301
keys:
252302
- v1.2.5-deps-{{ checksum "get_deps.sh" }}-<<parameters.osnick>>-<<parameters.target>>
253303
- setup-automation
254-
255-
# since we run in parallel, we need to generate docker files with different suffixes hence the DOCKER_SUFFIX
256-
- run:
257-
name: Build for platform
258-
command: |
259-
bash <(curl -fsSL https://raw.githubusercontent.com/docker/docker-install/master/install.sh)
260-
pushd opt/build/docker
261-
docker login -u redisfab -p $DOCKER_REDISFAB_PWD
262-
make build DOCKER_SUFFIX="$$" <<parameters.target>> OSNICK=<<parameters.osnick>> PACK=1 VERBOSE=1 <<parameters.lite>>
263-
popd > /dev/null
264-
logstar=bin/artifacts/tests-logs-cpu.tgz
265-
logsdir=tests/logs/cpu
266-
mkdir -p $logsdir
267-
if [[ -e $logstar ]]; then tar -C $logsdir -xzf $logstar; fi
268-
# (cd bin/artifacts; tar -cf snapshots.tar snapshots/)
269-
no_output_timeout: 40m
304+
- docker-build-steps:
305+
lite: "<<parameters.lite>>"
306+
osnick: "<<parameters.osnick>>"
307+
target: "<<parameters.target>>"
270308
- save_cache:
271309
paths:
272310
- deps
@@ -530,7 +568,8 @@ after-build-and-test: &after-build-and-test
530568

531569
after-platform-builds: &after-platform-builds
532570
requires:
533-
- platforms-build
571+
- platforms-build-gpu
572+
- platforms-build-cpu
534573

535574
#### define workflows
536575
workflows:
@@ -549,7 +588,21 @@ workflows:
549588
- build-and-test-gpu-for-forked-prs:
550589
<<: *on-any-branch
551590
<<: *after-linter
552-
- platforms-build:
591+
- platforms-build-cpu:
592+
context: common
593+
<<: *after-build-and-test
594+
<<: *on-master-version-tags-and-dockertests
595+
matrix:
596+
parameters:
597+
osnick:
598+
- xenial
599+
- bionic
600+
- centos8
601+
lite:
602+
- "REDISAI_LITE=0 PUBLISH=1"
603+
- "REDISAI_LITE=1"
604+
605+
- platforms-build-gpu:
553606
context: common
554607
<<: *after-build-and-test
555608
<<: *on-master-version-tags-and-dockertests
@@ -562,9 +615,6 @@ workflows:
562615
lite:
563616
- "REDISAI_LITE=0 PUBLISH=1"
564617
- "REDISAI_LITE=1"
565-
target:
566-
- "CPU=1"
567-
- "GPU=1"
568618
- coverage:
569619
context: common
570620
<<: *on-dev-branches

0 commit comments

Comments
 (0)