Skip to content

Commit b6ba531

Browse files
authored
Merge pull request #1160 from Kaggle/fix-libtpu-access
Fix access to libtpu
2 parents 2aa1486 + e4b1240 commit b6ba531

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Jenkinsfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pipeline {
5858
}
5959
stage('tensorflow TPU') {
6060
options {
61-
timeout(time: 360, unit: 'MINUTES')
61+
timeout(time: 240, unit: 'MINUTES')
6262
}
6363
steps {
6464
sh '''#!/bin/bash
@@ -177,6 +177,14 @@ pipeline {
177177
sh '''#!/bin/bash
178178
set -exo pipefail
179179
180+
# Login to docker to get access to gcr.io/cloud-tpu-v2-images/libtpu
181+
# SA: jenkins-test@kaggle-playground-170215.iam.gserviceaccount.com
182+
# To grant access to a SA, start a TPU VM with that SA once.
183+
METADATA=http://metadata.google.internal/computeMetadata/v1
184+
SVC_ACCT=$METADATA/instance/service-accounts/default
185+
ACCESS_TOKEN=$(/usr/bin/curl -s -H 'Metadata-Flavor: Google' $SVC_ACCT/token | cut -d'"' -f 4)
186+
docker login --username oauth2accesstoken --password $ACCESS_TOKEN https://gcr.io
187+
180188
./tpu/build | ts
181189
./push --tpu ${PRETEST_TAG}
182190
'''

0 commit comments

Comments
 (0)