diff --git a/.travis.yml b/.travis.yml index 1b4cd65d6..59e4f9bda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -112,8 +112,11 @@ matrix: - if [ $RAY_CI_LINUX_WHEELS_AFFECTED != "1" ]; then exit; fi - ./ci/suppress_output ./ci/travis/install-dependencies.sh - # This command should be kept in sync with ray/python/README-building-wheels.md. - - ./ci/suppress_output docker run --rm -w /ray -v `pwd`:/ray -ti rayproject/arrow_linux_x86_64_base:latest /ray/python/build-wheel-manylinux1.sh + # Mount bazel cache dir to the docker container. + - export MOUNT_BAZEL_CACHE="-v $HOME/ray-bazel-cache:/root/ray-bazel-cache -e TRAVIS=true" + # This command should be kept in sync with ray/python/README-building-wheels.md, + # except the `$MOUNT_BAZEL_CACHE` part. + - ./ci/suppress_output docker run --rm -w /ray -v `pwd`:/ray $MOUNT_BAZEL_CACHE -ti rayproject/arrow_linux_x86_64_base:latest /ray/python/build-wheel-manylinux1.sh script: - if [ $RAY_CI_LINUX_WHEELS_AFFECTED != "1" ]; then exit; fi @@ -140,7 +143,6 @@ install: - if [ $RAY_CI_TUNE_AFFECTED != "1" ] && [ $RAY_CI_RLLIB_AFFECTED != "1" ] && [ $RAY_CI_PYTHON_AFFECTED != "1" ]; then exit; fi - ./ci/suppress_output ./ci/travis/install-bazel.sh - - ./ci/suppress_output ./ci/travis/setup-bazel-cache.sh - ./ci/suppress_output ./ci/travis/install-dependencies.sh - export PATH="$HOME/miniconda/bin:$PATH" - ./ci/suppress_output ./ci/travis/install-ray.sh diff --git a/ci/travis/install-bazel.sh b/ci/travis/install-bazel.sh index 5b6d95729..e9e7e9f90 100755 --- a/ci/travis/install-bazel.sh +++ b/ci/travis/install-bazel.sh @@ -21,3 +21,9 @@ wget -O install.sh $URL chmod +x install.sh ./install.sh --user rm -f install.sh + +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 +fi diff --git a/ci/travis/setup-bazel-cache.sh b/ci/travis/setup-bazel-cache.sh deleted file mode 100755 index c9e0bf42c..000000000 --- a/ci/travis/setup-bazel-cache.sh +++ /dev/null @@ -1,5 +0,0 @@ -set -x -set -e - -mkdir -p $HOME/ray-bazel-cache -echo "build --disk_cache=$HOME/ray-bazel-cache" >> .bazelrc