Skip to content

Commit

Permalink
Enable ready-only bazel cache (tensorflow#1294)
Browse files Browse the repository at this point in the history
This PR enables read-only bazel cache

Signed-off-by: Yong Tang <[email protected]>
  • Loading branch information
yongtang authored and i-ony committed Mar 8, 2021
1 parent 63c6227 commit b753f81
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ jobs:
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
printf '%s\n' "${GCP_CREDS}" >service_account_creds.json
export BAZEL_OPTIMIZATION="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=true --google_credentials=service_account_creds.json"
else
export BAZEL_OPTIMIZATION="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
fi
set -x -e
echo "Bring /usr/bin to front as GitHub does not use system python3 by default"
Expand All @@ -75,6 +77,8 @@ jobs:
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
printf '%s\n' "${GCP_CREDS}" >service_account_creds.json
export BAZEL_OPTIMIZATION="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=true --google_credentials=service_account_creds.json"
else
export BAZEL_OPTIMIZATION="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
fi
set -x -e
bash -x -e .github/workflows/build.space.sh
Expand All @@ -93,6 +97,8 @@ jobs:
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
printf '%s\n' "${GCP_CREDS}" >service_account_creds.json
export BAZEL_OPTIMIZATION="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=true --google_credentials=service_account_creds.json"
else
export BAZEL_OPTIMIZATION="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
fi
set -x -e
bash -x -e .github/workflows/build.space.sh
Expand All @@ -112,6 +118,8 @@ jobs:
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
printf '%s\n' "${GCP_CREDS}" >service_account_creds.json
export BAZEL_OPTIMIZATION="${BAZEL_OPTIMIZATION} --remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=true --google_credentials=service_account_creds.json"
else
export BAZEL_OPTIMIZATION="${BAZEL_OPTIMIZATION} --remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
fi
set -x -e
echo "Bring /usr/bin to front as GitHub does not use system python3 by default"
Expand Down Expand Up @@ -223,6 +231,8 @@ jobs:
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
printf '%s\n' "${GCP_CREDS}" >service_account_creds.json
export BAZEL_OPTIMIZATION="${BAZEL_OPTIMIZATION} --remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=true --google_credentials=service_account_creds.json"
else
export BAZEL_OPTIMIZATION="${BAZEL_OPTIMIZATION} --remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
fi
set -x -e
bash -x -e .github/workflows/build.space.sh
Expand Down Expand Up @@ -333,9 +343,11 @@ jobs:
set "BAZEL_OPTIMIZATION=--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=true --google_credentials=service_account_creds.json"
) else (
echo %REPO_NAME%
set "BAZEL_OPTIMIZATION=--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
)
) else (
echo %EVENT_NAME%
set "BAZEL_OPTIMIZATION=--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
)
@echo on
set /P BAZEL_VERSION=< .bazelversion
Expand Down

0 comments on commit b753f81

Please sign in to comment.