Skip to content

Commit fa7bde5

Browse files
kanglantcopybara-github
authored andcommitted
Enable Bazel remote cache for TSL's linux and windows CI jobs
PiperOrigin-RevId: 501833290
1 parent 9705797 commit fa7bde5

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.kokoro/linux/build.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ set -euo pipefail -o history
2222
# Generate a templated results file to make output accessible to everyone
2323
"$KOKORO_ARTIFACTS_DIR"/github/tsl/.kokoro/generate_index_html.sh "$KOKORO_ARTIFACTS_DIR"/index.html
2424

25+
function is_continuous_job() {
26+
[[ "$KOKORO_JOB_NAME" =~ tensorflow/xla/.*continuous.* ]]
27+
}
28+
29+
ADDITIONAL_FLAGS=""
30+
31+
if is_continuous_job ; then
32+
ADDITIONAL_FLAGS="$ADDITIONAL_FLAGS --google_default_credentials"
33+
else
34+
ADDITIONAL_FLAGS="$ADDITIONAL_FLAGS --remote_upload_local_results=false"
35+
fi
36+
2537
# Pull the container (in case it was updated since the instance started) and
2638
# store its SHA in the Sponge log.
2739
docker pull "$DOCKER_IMAGE"
@@ -39,6 +51,8 @@ docker exec tsl bazel build \
3951
--output_filter="" \
4052
--nocheck_visibility \
4153
--keep_going \
54+
--remote_cache="https://storage.googleapis.com/tensorflow-devinfra-bazel-cache/tsl/linux" \
55+
$ADDITIONAL_FLAGS \
4256
-- //tsl/...
4357

4458
# Test TSL

.kokoro/windows/windows_build.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,27 @@ cd "${KOKORO_ARTIFACTS_DIR}/github/tsl"
2424
# Generate a templated results file to make output accessible to everyone
2525
"$KOKORO_ARTIFACTS_DIR"/github/tsl/.kokoro/generate_index_html.sh "$KOKORO_ARTIFACTS_DIR"/index.html
2626

27+
function is_continuous_job() {
28+
[[ "$KOKORO_JOB_NAME" =~ tensorflow/xla/.*continuous.* ]]
29+
}
30+
31+
ADDITIONAL_FLAGS=""
32+
33+
if is_continuous_job ; then
34+
ADDITIONAL_FLAGS="$ADDITIONAL_FLAGS --google_default_credentials"
35+
else
36+
ADDITIONAL_FLAGS="$ADDITIONAL_FLAGS --remote_upload_local_results=false"
37+
fi
38+
2739
export PATH="$PATH:/c/Python38"
2840

2941
# Build TSL
3042
/c/tools/bazel.exe build \
3143
--output_filter="" \
3244
--nocheck_visibility \
3345
--keep_going \
46+
--remote_cache="https://storage.googleapis.com/tensorflow-devinfra-bazel-cache/tsl/windows" \
47+
$ADDITIONAL_FLAGS \
3448
-- //tsl/... \
3549
|| { echo "Bazel Build Failed" && exit 1; }
3650

0 commit comments

Comments
 (0)