Skip to content

Commit 5815899

Browse files
authored
Backup images to dockerhub (#2081)
1 parent cbda362 commit 5815899

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

.circleci/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ jobs:
115115
- run:
116116
command: make ci-push-images
117117
no_output_timeout: 20m
118+
- run:
119+
command: make ci-backup-images
120+
no_output_timeout: 20m
118121

119122
e2e-tests:
120123
docker:

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@ ci-build-images:
203203
@./build/build-images.sh
204204

205205
ci-push-images:
206-
@./build/push-images.sh
206+
@./build/push-images.sh quay.io
207+
208+
ci-backup-images:
209+
@./build/push-images.sh docker.io
207210

208211
ci-build-cli:
209212
@./build/cli.sh

build/push-image.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@ set -euo pipefail
1919

2020
CORTEX_VERSION=master
2121

22-
image=$1
22+
host=$1
23+
image=$2
2324

2425
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
2526

2627
if [ "$image" == "python-predictor-gpu" ]; then
2728
cuda=("10.0" "10.1" "10.1" "10.2" "10.2" "11.0" "11.1")
2829
cudnn=("7" "7" "8" "7" "8" "8" "8")
2930
for i in ${!cudnn[@]}; do
30-
docker push quay.io/cortexlabs/${image}:${CORTEX_VERSION}-cuda${cuda[$i]}-cudnn${cudnn[$i]}
31+
docker push $host/cortexlabs/${image}:${CORTEX_VERSION}-cuda${cuda[$i]}-cudnn${cudnn[$i]}
3132
done
3233
else
33-
docker push quay.io/cortexlabs/${image}:${CORTEX_VERSION}
34+
docker push $host/cortexlabs/${image}:${CORTEX_VERSION}
3435
fi

build/push-images.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null && pwd)"
2222
source $ROOT/build/images.sh
2323
source $ROOT/dev/util.sh
2424

25+
host=$1
26+
2527
# if parallel utility is installed, the docker push commands will be parallelized
2628
if command -v parallel &> /dev/null && [ -n "${NUM_BUILD_PROCS+set}" ] && [ "$NUM_BUILD_PROCS" != "1" ]; then
27-
ROOT=$ROOT DOCKER_USERNAME=$DOCKER_USERNAME DOCKER_PASSWORD=$DOCKER_PASSWORD SHELL=$(type -p /bin/bash) parallel --will-cite --halt now,fail=1 --eta --jobs $NUM_BUILD_PROCS $ROOT/build/push-image.sh {} ::: "${all_images[@]}"
29+
ROOT=$ROOT DOCKER_USERNAME=$DOCKER_USERNAME DOCKER_PASSWORD=$DOCKER_PASSWORD SHELL=$(type -p /bin/bash) parallel --will-cite --halt now,fail=1 --eta --jobs $NUM_BUILD_PROCS $ROOT/build/push-image.sh $host {} ::: "${all_images[@]}"
2830
else
2931
for image in "${all_images[@]}"; do
30-
$ROOT/build/push-image.sh $image
32+
$ROOT/build/push-image.sh $host $image
3133
done
3234
fi

0 commit comments

Comments
 (0)