[CI] Add Remote Caching (#6210)

This commit is contained in:
Simon Mo
2019-11-21 11:36:36 -08:00
committed by Philipp Moritz
parent 7f52d019ca
commit c4132b501b
3 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ matrix:
# For the linux wheel build, we use a shared cache between all
# wheels, but not between different travis runs, because that
# caused timeouts in the past. See the "cache: false" line below.
- export MOUNT_BAZEL_CACHE="-v $HOME/ray-bazel-cache:/root/ray-bazel-cache -e TRAVIS=true"
- export MOUNT_BAZEL_CACHE="-v $HOME/ray-bazel-cache:/root/ray-bazel-cache -e TRAVIS=true -e TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST"
# This command should be kept in sync with ray/python/README-building-wheels.md,
# except the `$MOUNT_BAZEL_CACHE` part.
Binary file not shown.
+15
View File
@@ -3,6 +3,8 @@
# Cause the script to exit if a single command fails
set -e
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
platform="unknown"
unamestr="$(uname)"
if [[ "$unamestr" == "Linux" ]]; then
@@ -26,4 +28,17 @@ if [[ "$TRAVIS" == "true" ]]; then
# Use bazel disk cache if this script is running in Travis.
mkdir -p $HOME/ray-bazel-cache
echo "build --disk_cache=$HOME/ray-bazel-cache" >> $HOME/.bazelrc
# Use ray google cloud cache
echo "build --remote_cache=https://storage.googleapis.com/ray-bazel-cache" >> $HOME/.bazelrc
if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then
# If we are in master build, we can write to the cache as well.
openssl aes-256-cbc -K $encrypted_1c30b31fe1ee_key \
-iv $encrypted_1c30b31fe1ee_iv \
-in $ROOT_DIR/bazel_cache_credential.json.enc \
-out $HOME/bazel_cache_credential.json -d
echo "build --google_credentials=$HOME/bazel_cache_credential.json" >> $HOME/.bazelrc
else
echo "build --remote_upload_local_results=false" >> $HOME/.bazelrc
fi
fi