Skip to content

Commit 2f3147e

Browse files
RobertLuciandeliahu
authored andcommitted
Fix Circle CI images being rebuilt on each step (#2276)
(cherry picked from commit 3c440db)
1 parent 4e117b7 commit 2f3147e

File tree

4 files changed

+14
-19
lines changed

4 files changed

+14
-19
lines changed

.circleci/config.yml

+5-9
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ jobs:
117117
- image: cimg/python:3.6
118118
environment:
119119
DOCKER_CLI_EXPERIMENTAL: enabled
120-
DOCKER_CONTEXT: default
121120
steps:
122121
- setup_remote_docker
123122
- checkout
@@ -131,16 +130,13 @@ jobs:
131130
- run: make ci-build-cli
132131
- return-if-not-deployed-branch
133132
- run: make ci-build-and-upload-cli
134-
- run:
135-
command: make ci-build-images
136-
no_output_timeout: 40m
137133
- quay-login
138134
- run:
139-
command: make ci-push-images
140-
no_output_timeout: 20m
141-
- run:
142-
command: make ci-backup-images
143-
no_output_timeout: 20m
135+
name: Build and Push CI Images
136+
command: |
137+
make ci-build-images
138+
make ci-push-images
139+
no_output_timeout: 40m
144140

145141
e2e-tests:
146142
docker:

Makefile

+1-4
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,7 @@ ci-build-images:
204204
@./build/build-images.sh
205205

206206
ci-push-images:
207-
@./build/push-images.sh quay.io
208-
209-
ci-backup-images:
210-
@./build/push-images.sh docker.io
207+
@./build/push-images.sh quay.io docker.io
211208

212209
ci-build-cli:
213210
@./build/cli.sh

build/push-image.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null && pwd)"
2121

2222
CORTEX_VERSION=0.37.0
2323

24-
host=$1
25-
image=$2
26-
platforms=$3
24+
host_primary=$1
25+
host_backup=$2
26+
image=$3
27+
platforms=$4
2728

2829
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
29-
docker buildx build $ROOT --progress plain -f $ROOT/images/$image/Dockerfile -t $host/cortexlabs/${image}:${CORTEX_VERSION} --platform $platforms --push
30+
docker buildx build $ROOT --progress plain -f $ROOT/images/$image/Dockerfile -t $host_primary/cortexlabs/${image}:${CORTEX_VERSION} -t $host_backup/cortexlabs/${image}:${CORTEX_VERSION} --platform $platforms --push

build/push-images.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +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
25+
host_primary=$1
26+
host_backup=$2
2627

2728
for image in "${all_images[@]}"; do
2829
platforms="linux/amd64"
2930
if in_array $image "multi_arch_images"; then
3031
platforms+=",linux/arm64"
3132
fi
32-
$ROOT/build/push-image.sh $host $image $platforms
33+
$ROOT/build/push-image.sh $host_primary $host_backup $image $platforms
3334
done

0 commit comments

Comments
 (0)