Skip to content

Commit

Permalink
install bazel script remove download resources
Browse files Browse the repository at this point in the history
  • Loading branch information
ashione committed Apr 6, 2024
1 parent 87582b0 commit f130e1e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docker/Dockerfile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM ubuntu:22.04
RUN apt-get update
RUN apt-get install -yq software-properties-common
RUN add-apt-repository -y ppa:deadsnakes/ppa
RUN apt-get install -yq wget gcc g++ openjdk-8-jdk maven python3.8 zlib1g-dev zip git pip
RUN git clone https://github.com/ray-project/mobius.git
RUN DEBIAN_FRONTEND=noninteractive apt-get install -yq wget gcc g++ openjdk-8-jdk maven python3.8 zlib1g-dev zip git pip
RUN git clone -b dev-docker-builder https://github.com/ray-project/mobius.git
RUN sh -c "bash mobius/scripts/install-bazel.sh"
RUN python3 -m pip install virtualenv
RUN python3 -m virtualenv -p python3 py3
Expand Down
26 changes: 18 additions & 8 deletions scripts/install-bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,30 @@ if [ "${arm}" = "aarch64" ]; then
arm="arm64"
fi

bazel_exe_file=""

if [ "${platform}" = "darwin" ] && [ "${arm}" != "arm64" ]; then
wget "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-installer-darwin-x86_64.sh" -O bazel-5.4.1-installer-darwin-x86_64.sh
sh bazel-5.4.1-installer-darwin-x86_64.sh
bazel_exe_file="bazel-5.4.1-installer-darwin-x86_64.sh"
wget "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-installer-darwin-x86_64.sh" -O $bazel_exe_file
sh $bazel_exe_file
elif [ "${platform}" = "darwin" ] && [ "${arm}" = "arm64" ]; then
wget "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-darwin-arm64" -O bazel-5.4.1-darwin-arm64
chmod a+x bazel-5.4.1-darwin-arm64
sh bazel-5.4.1-darwin-arm64
cp bazel-5.4.1-darwin-arm64 /usr/bin/bazel
elif [ "${platform}" = "linux" ] && [ "${arm}" = "arm64" ]; then
wget "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-linux-arm64" -O bazel_5.4.1-linux-arm64
chmod a+x bazel_5.4.1-linux-arm64
sh bazel_5.4.1-linux-arm64
bazel_exe_file="bazel_5.4.1-linux-arm64"
wget "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-linux-arm64" -O $bazel_exe_file
chmod a+x $bazel_exe_file
cp $bazel_exe_file /usr/bin/bazel
else
wget "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel_5.4.1-linux-x86_64.deb" -O bazel_5.4.1-linux-x86_64.deb
dpkg -i bazel_5.4.1-linux-x86_64.deb
bazel_exe_file="bazel_5.4.1-linux-x86_64.deb"
wget "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel_5.4.1-linux-x86_64.deb" -O $bazel_exe_file
dpkg -i $bazel_exe_file
fi

if [ -e $bazel_exe_file ]; then
echo "Remove download file $bazel_exe_file"
rm $bazel_exe_file
fi

bazel --version

0 comments on commit f130e1e

Please sign in to comment.