Skip to content

Commit 3ac8c93

Browse files
committed
Add staging tag to images at the end of build pipeline
This way, we avoid the risk of releasing a CPU and GPU image from 2 different builds. BUG=157163453
1 parent 57fb90f commit 3ac8c93

File tree

1 file changed

+16
-30
lines changed

1 file changed

+16
-30
lines changed

Jenkinsfile

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,6 @@ pipeline {
4747
'''
4848
}
4949
}
50-
51-
stage('Push CPU Image') {
52-
steps {
53-
sh '''#!/bin/bash
54-
set -exo pipefail
55-
56-
date
57-
docker pull gcr.io/kaggle-images/python:${PRETEST_TAG}
58-
./push --source-image gcr.io/kaggle-images/python:${PRETEST_TAG} ${STAGING_TAG}
59-
'''
60-
}
61-
}
6250

6351
stage('Docker GPU Build') {
6452
// A GPU is not required to build this image. However, in our current setup,
@@ -81,7 +69,7 @@ pipeline {
8169
# will untag the previously built image which is safe to do. Builds for a single branch are performed
8270
# serially.
8371
docker image prune -f
84-
./build --gpu --base-image-tag ${STAGING_TAG} | ts
72+
./build --gpu --base-image-tag ${PRETEST_TAG} | ts
8573
./push --gpu ${PRETEST_TAG}
8674
'''
8775
}
@@ -102,28 +90,15 @@ pipeline {
10290
}
10391
}
10492

105-
stage('Push GPU Image') {
106-
agent { label 'ephemeral-linux-gpu' }
107-
steps {
108-
sh '''#!/bin/bash
109-
set -exo pipefail
110-
111-
date
112-
docker pull gcr.io/kaggle-private-byod/python:${PRETEST_TAG}
113-
./push --source-image gcr.io/kaggle-private-byod/python:${PRETEST_TAG} --gpu ${STAGING_TAG}
114-
'''
115-
}
116-
}
117-
11893
stage('Package Versions') {
11994
parallel {
12095
stage('CPU Diff') {
12196
steps {
12297
sh '''#!/bin/bash
12398
set -exo pipefail
12499
125-
docker pull gcr.io/kaggle-images/python:${STAGING_TAG}
126-
./diff --target gcr.io/kaggle-images/python:${STAGING_TAG}
100+
docker pull gcr.io/kaggle-images/python:${PRETEST_TAG}
101+
./diff --target gcr.io/kaggle-images/python:${PRETEST_TAG}
127102
'''
128103
}
129104
}
@@ -133,13 +108,24 @@ pipeline {
133108
sh '''#!/bin/bash
134109
set -exo pipefail
135110
136-
docker pull gcr.io/kaggle-private-byod/python:${STAGING_TAG}
137-
./diff --gpu --target gcr.io/kaggle-private-byod/python:${STAGING_TAG}
111+
docker pull gcr.io/kaggle-private-byod/python:${PRETEST_TAG}
112+
./diff --gpu --target gcr.io/kaggle-private-byod/python:${PRETEST_TAG}
138113
'''
139114
}
140115
}
141116
}
142117
}
118+
119+
stage('Label CPU/GPU Staging Images') {
120+
steps {
121+
sh '''#!/bin/bash
122+
set -exo pipefail
123+
124+
gcloud container images add-tag gcr.io/kaggle-images/python:${PRETEST_TAG} gcr.io/kaggle-images/python:${STAGING_TAG}
125+
gcloud container images add-tag gcr.io/kaggle-private-byod/python:${PRETEST_TAG} gcr.io/kaggle-private-byod/python:${STAGING_TAG}
126+
'''
127+
}
128+
}
143129
}
144130

145131
post {

0 commit comments

Comments
 (0)