Skip to content

Commit

Permalink
Fix access to libtpu
Browse files Browse the repository at this point in the history
The jenkins SA did not have access to pull the libtpu docker image needed for the TPU VM build.
I started a TPU VM with that SA to grant it access, and added docker login setup to use authenticated docker commands.
  • Loading branch information
djherbis committed May 17, 2022
1 parent 2aa1486 commit e4b1240
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pipeline {
}
stage('tensorflow TPU') {
options {
timeout(time: 360, unit: 'MINUTES')
timeout(time: 240, unit: 'MINUTES')
}
steps {
sh '''#!/bin/bash
Expand Down Expand Up @@ -177,6 +177,14 @@ pipeline {
sh '''#!/bin/bash
set -exo pipefail
# Login to docker to get access to gcr.io/cloud-tpu-v2-images/libtpu
# SA: [email protected]
# To grant access to a SA, start a TPU VM with that SA once.
METADATA=http:https://metadata.google.internal/computeMetadata/v1
SVC_ACCT=$METADATA/instance/service-accounts/default
ACCESS_TOKEN=$(/usr/bin/curl -s -H 'Metadata-Flavor: Google' $SVC_ACCT/token | cut -d'"' -f 4)
docker login --username oauth2accesstoken --password $ACCESS_TOKEN https://gcr.io
./tpu/build | ts
./push --tpu ${PRETEST_TAG}
'''
Expand Down

0 comments on commit e4b1240

Please sign in to comment.