Fix Bazel in Docker (#9530)

Co-authored-by: Mehrdad <noreply@github.com>
This commit is contained in:
mehrdadn
2020-07-17 11:39:38 -07:00
committed by GitHub
co-authored by Mehrdad
parent 887cf5eca7
commit ffb88cda6f
3 changed files with 7 additions and 5 deletions
+5 -3
View File
@@ -4,6 +4,8 @@ set -euo pipefail
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
arg1="${1-}"
version="3.2.0"
achitecture="${HOSTTYPE}"
platform="unknown"
@@ -50,9 +52,9 @@ else
target="./install.sh"
curl -f -s -L -R -o "${target}" "https://github.com/bazelbuild/bazel/releases/download/${version}/bazel-${version}-installer-${platform}-${achitecture}.sh"
chmod +x "${target}"
if [ "${CI-}" = true ]; then
sudo "${target}" > /dev/null # system-wide install for CI
command -V bazel 1>&2
if [ "${CI-}" = true ] || [ "${arg1-}" = "--system" ]; then
"$(command -v sudo || echo command)" "${target}" > /dev/null # system-wide install for CI
which bazel > /dev/null
else
"${target}" --user > /dev/null
fi
+1 -1
View File
@@ -4,7 +4,7 @@
FROM ray-project/base-deps
ADD ray.tar /ray
ADD git-rev /ray/git-rev
RUN cd /ray && git init && ./ci/travis/install-bazel.sh
RUN cd /ray && git init && ./ci/travis/install-bazel.sh --system
ENV PATH=$PATH:/root/bin
RUN echo 'build --remote_cache="https://storage.googleapis.com/ray-bazel-cache"' >> $HOME/.bazelrc
RUN echo 'build --remote_upload_local_results=false' >> $HOME/.bazelrc
@@ -16,7 +16,7 @@ RUN pip install -r requirements.txt
ADD ray.tar /ray
ADD git-rev /ray/git-rev
RUN bash /ray/ci/travis/install-bazel.sh
RUN bash /ray/ci/travis/install-bazel.sh --system
RUN echo 'build --remote_cache="https://storage.googleapis.com/ray-bazel-cache"' >> $HOME/.bazelrc
RUN echo 'build --remote_upload_local_results=false' >> $HOME/.bazelrc
RUN cd /ray/python; pip install -e . --verbose