File tree Expand file tree Collapse file tree 6 files changed +25
-13
lines changed Expand file tree Collapse file tree 6 files changed +25
-13
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,22 @@ pipeline {
56
56
'''
57
57
}
58
58
}
59
+ stage(' tensorflow TPU' ) {
60
+ options {
61
+ timeout(time : 180 , unit : ' MINUTES' )
62
+ }
63
+ steps {
64
+ sh ''' #!/bin/bash
65
+ set -exo pipefail
66
+ source tpu/config.txt
67
+ cd packages/
68
+ ./build_package --base-image gcr.io/kaggle-images/python:${BASE_IMAGE_TAG} \
69
+ --package tpu-tensorflow \
70
+ --version $TENSORFLOW_VERSION \
71
+ --push
72
+ '''
73
+ }
74
+ }
59
75
}
60
76
}
61
77
stage(' Build/Test/Diff' ) {
@@ -155,7 +171,7 @@ pipeline {
155
171
stages {
156
172
stage(' Build Tensorflow TPU Image' ) {
157
173
options {
158
- timeout(time : 120 , unit : ' MINUTES' )
174
+ timeout(time : 20 , unit : ' MINUTES' )
159
175
}
160
176
steps {
161
177
sh ''' #!/bin/bash
Original file line number Diff line number Diff line change 117
117
118
118
# Keep only `tf2-gpu.2-6:m80` in `gcr.io/deeplearning-platform-release/tf2-gpu.2-6:m80`
119
119
TAG=${BASE_IMAGE/ gcr.io\/ deeplearning-platform-release\/ / }
120
+ # Keep only `python:v108` in `gcr.io/kaggle-images/python:v108`
121
+ TAG=${TAG/ gcr.io\/ kaggle-images\/ / }
120
122
# Replace the `:` in `tf2-gpu.2-6:m80` by `-`
121
123
TAG=${TAG/:/ -}
122
124
# Append the package version
Original file line number Diff line number Diff line change 1
- ARG BASE_IMAGE_TAG
1
+ ARG BASE_IMAGE
2
2
3
- FROM gcr.io/kaggle-images/python:${BASE_IMAGE_TAG } AS builder
3
+ FROM ${BASE_IMAGE } AS builder
4
4
5
5
ARG PACKAGE_VERSION
6
6
@@ -14,7 +14,7 @@ RUN cd /usr/local/src && \
14
14
RUN cd /usr/local/src && \
15
15
git clone https://github.com/tensorflow/tensorflow && \
16
16
cd tensorflow && \
17
- git checkout tags/v${TENSORFLOW_VERSION } && \
17
+ git checkout tags/v${PACKAGE_VERSION } && \
18
18
# TODO(rosbo): Is it really needed?
19
19
pip install keras_applications --no-deps && \
20
20
pip install keras_preprocessing --no-deps
Original file line number Diff line number Diff line change 1
1
ARG BASE_IMAGE_TAG
2
2
ARG LIBTPU_IMAGE_TAG
3
- ARG TENSORFLOW_WHL_IMAGE_TAG
3
+ ARG TENSORFLOW_VERSION
4
4
5
5
FROM gcr.io/cloud-tpu-v2-images/libtpu:${LIBTPU_IMAGE_TAG} as libtpu
6
- FROM gcr.io/kaggle-images/python-tpu-tensorflow-whl:${TENSORFLOW_WHL_IMAGE_TAG } AS tensorflow_whl
6
+ FROM gcr.io/kaggle-images/python-tpu-tensorflow-whl:python-${BASE_IMAGE_TAG}-${TENSORFLOW_VERSION } AS tensorflow_whl
7
7
FROM gcr.io/kaggle-images/python:${BASE_IMAGE_TAG}
8
8
9
9
ENV ISTPUVM=1
Original file line number Diff line number Diff line change 12
12
}
13
13
14
14
CACHE_FLAG=' --no-cache'
15
- TENSORFLOW_DOCKERFILE=' tensorflow.Dockerfile'
16
- TENSORFLOW_IMAGE_TAG=' kaggle/python-tpuvm-tensorflow-build'
17
15
DOCKERFILE=' Dockerfile'
18
16
IMAGE_TAG=' kaggle/python-tpuvm-build'
19
17
BUILD_ARGS=' '
@@ -49,15 +47,11 @@ for l in `cat ${SRCDIR}/config.txt`; do
49
47
done
50
48
51
49
readonly CACHE_FLAG
52
- readonly TENSORFLOW_DOCKERFILE
53
- readonly TENSORFLOW_IMAGE_TAG
54
50
readonly DOCKERFILE
55
51
readonly IMAGE_TAG
56
52
readonly BUILD_ARGS
57
53
58
- TENSORFLOW_DOCKERFILE_PATH=" $SRCDIR /$TENSORFLOW_DOCKERFILE "
59
54
DOCKERFILE_PATH=" $SRCDIR /$DOCKERFILE "
60
55
61
56
set -x
62
- docker build --rm --pull $CACHE_FLAG -t " $TENSORFLOW_IMAGE_TAG " -f " $TENSORFLOW_DOCKERFILE_PATH " $BUILD_ARGS .
63
57
docker build --rm --pull $CACHE_FLAG -t " $IMAGE_TAG " -f " $DOCKERFILE_PATH " $BUILD_ARGS .
Original file line number Diff line number Diff line change 1
1
BASE_IMAGE_TAG=v108
2
2
LIBTPU_IMAGE_TAG=libtpu_1.1.0_RC00
3
- TENSORFLOW_WHL_IMAGE_TAG=local
3
+ TENSORFLOW_VERSION=2.8.0
You can’t perform that action at this time.
0 commit comments