mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 16:46:37 +08:00
[CI] Add Remote Caching (#6210)
This commit is contained in:
+1
-1
@@ -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.
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user