Skip to content

Commit 2d37fd8

Browse files
authored
layer caching in CI (#844)
1 parent 7204dcd commit 2d37fd8

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

.circleci/config.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ commands:
101101
- checkout-all
102102
- restore_cache:
103103
keys:
104-
- v1-dependencies-{{ checksum "get_deps.sh" }}
104+
- v1-dependencies-{{ checksum "get_deps.sh" }}-cpu
105105
# If no exact match is found will get dependencies from source
106106
- setup-build-system
107107
- run:
@@ -112,7 +112,7 @@ commands:
112112
- save_cache:
113113
paths:
114114
- deps
115-
key: v1-dependencies-{{ checksum "get_deps.sh" }}
115+
key: v1-dependencies-{{ checksum "get_deps.sh" }}-cpu
116116
- run:
117117
name: Build
118118
command: make -C opt all SHOW=1
@@ -151,7 +151,7 @@ commands:
151151
- checkout-all
152152
- restore_cache:
153153
keys:
154-
- v1-dependencies-{{ checksum "get_deps.sh" }}
154+
- v1-dependencies-{{ checksum "get_deps.sh" }}-cpu
155155
# If no exact match is found will get dependencies from source
156156
- setup-build-system
157157
- run:
@@ -176,13 +176,20 @@ commands:
176176
- abort_for_docs
177177
- abort_for_noci
178178
- checkout-all
179+
- restore_cache:
180+
keys:
181+
- v1-dependencies-{{ checksum "get_deps.sh" }}-gpu
179182
- relocate-docker-storage
180183
- run:
181184
name: Build
182185
command: |
183186
pip3 install --user jinja2
184187
pushd opt/build/docker
185188
make DOCKER_SUFFIX=".gpu-test" DOCKER_ARGS="-s dockerfile-gpu-test.tmpl" DOCKER_OPTS=--no-cache DEFAULT_TAG="redisai-gpu:latest-test"
189+
- save_cache:
190+
paths:
191+
- deps
192+
key: v1-dependencies-{{ checksum "get_deps.sh" }}-gpu
186193
- run:
187194
name: Test
188195
command: |
@@ -227,8 +234,12 @@ jobs:
227234
- abort_for_docs
228235
- abort_for_noci
229236
- early_return_for_forked_pull_requests
230-
- setup_remote_docker
237+
- setup_remote_docker:
238+
docker_layer_caching: true
231239
- checkout-all
240+
- restore_cache:
241+
keys:
242+
- v1-dependencies-{{ checksum "get_deps.sh" }}-<<parameters.osnick>>-<<parameters.target>>
232243
- setup-automation
233244

234245
# since we run in parallel, we need to generate docker files with different suffixes hence the DOCKER_SUFFIX
@@ -246,6 +257,10 @@ jobs:
246257
if [[ -e $logstar ]]; then tar -C $logsdir -xzf $logstar; fi
247258
# (cd bin/artifacts; tar -cf snapshots.tar snapshots/)
248259
no_output_timeout: 40m
260+
- save_cache:
261+
paths:
262+
- deps
263+
key: v1-dependencies-{{ checksum "get_deps.sh" }}-<<parameters.osnick>>-<<parameters.target>>
249264
- persist_to_workspace:
250265
root: bin/
251266
paths:
@@ -260,7 +275,7 @@ jobs:
260275
- checkout-all
261276
- restore_cache:
262277
keys:
263-
- v1-dependencies-{{ checksum "get_deps.sh" }}
278+
- v1-dependencies-{{ checksum "get_deps.sh" }}-cpu
264279
# If no exact match is found will get dependencies from source
265280
- setup-build-system
266281
- run:
@@ -294,7 +309,7 @@ jobs:
294309
- checkout-all
295310
- restore_cache:
296311
keys:
297-
- v1-dependencies-{{ checksum "get_deps.sh" }}
312+
- v1-dependencies-{{ checksum "get_deps.sh" }}-cpu
298313
# If no exact match is found will get dependencies from source
299314
- setup-build-system
300315
- run:

0 commit comments

Comments
 (0)