Skip to content

Commit

Permalink
Add .bazelversion file
Browse files Browse the repository at this point in the history
  • Loading branch information
fuhailin authored and rhdong committed Aug 15, 2023
1 parent 025eba0 commit 877fd19
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 31 deletions.
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.1.1
2 changes: 0 additions & 2 deletions .github/workflows/ci_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ on:
branches:
- master
- r*
env:
USE_BAZEL_VERSION: "5.1.1"

jobs:
yapf-test:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ on:
env:
MIN_PY_VERSION: '3.7'
MAX_PY_VERSION: '3.9'
USE_BAZEL_VERSION: "5.1.1"
HOROVOD_VERSION: '0.23.0'

jobs:
Expand Down
5 changes: 2 additions & 3 deletions tools/docker/cpu_tests.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
FROM python:3.7 as build_wheel

ARG TF_VERSION=2.8.3
ARG USE_BAZEL_VERSION=5.1.1
ARG MPI_VERSION="4.1.1"
ARG HOROVOD_VERSION="0.23.0"

Expand All @@ -12,8 +11,8 @@ RUN python -m pip install --upgrade protobuf==3.20.0

RUN apt-get update && apt-get install -y sudo rsync cmake openmpi-bin libopenmpi-dev

COPY tools/docker/install/install_bazel.sh /install/
RUN /install/install_bazel.sh $USE_BAZEL_VERSION
COPY tools/install_deps/install_bazelisk.sh /install/
RUN bash /install/install_bazelisk.sh

COPY tools/docker/install/install_horovod.sh /install/
RUN /install/install_horovod.sh $HOROVOD_VERSION --only-cpu
Expand Down
24 changes: 8 additions & 16 deletions tools/docker/sanity_check.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ RUN touch /ok.txt
# -------------------------------
FROM python:3.7 as source_code_test

ARG USE_BAZEL_VERSION

COPY tools/install_deps /install_deps
RUN --mount=type=cache,id=cache_pip,target=/root/.cache/pip \
cd /install_deps && pip install \
Expand All @@ -25,8 +23,8 @@ RUN --mount=type=cache,id=cache_pip,target=/root/.cache/pip \
-r pytest.txt

RUN apt-get update && apt-get install -y sudo rsync cmake
COPY tools/docker/install/install_bazel.sh ./
RUN ./install_bazel.sh $USE_BAZEL_VERSION
COPY tools/install_deps/install_bazelisk.sh .bazelversion ./
RUN bash install_bazelisk.sh

COPY ./ /recommenders-addons
RUN pip install -e /recommenders-addons
Expand All @@ -47,14 +45,12 @@ RUN touch /ok.txt
# -------------------------------
FROM python:3.7 as valid_build_files

ARG USE_BAZEL_VERSION

COPY tools/install_deps/tensorflow-cpu.txt ./
RUN pip install --default-timeout=1000 -r tensorflow-cpu.txt

RUN apt-get update && apt-get install sudo
COPY tools/docker/install/install_bazel.sh ./
RUN ./install_bazel.sh $USE_BAZEL_VERSION
COPY tools/install_deps/install_bazelisk.sh .bazelversion ./
RUN bash install_bazelisk.sh

COPY ./ /recommenders-addons
WORKDIR /recommenders-addons
Expand Down Expand Up @@ -98,8 +94,6 @@ RUN touch /ok.txt
# docs tests
FROM python:3.7 as docs_tests

ARG USE_BAZEL_VERSION

COPY tools/install_deps/tensorflow-cpu.txt ./
RUN pip install --default-timeout=1000 -r tensorflow-cpu.txt
COPY requirements.txt ./
Expand All @@ -109,8 +103,8 @@ COPY tools/install_deps/doc_requirements.txt ./
RUN pip install -r doc_requirements.txt

RUN apt-get update && apt-get install -y sudo rsync cmake
COPY tools/docker/install/install_bazel.sh ./
RUN ./install_bazel.sh $USE_BAZEL_VERSION
COPY tools/install_deps/install_bazelisk.sh .bazelversion ./
RUN bash install_bazelisk.sh

COPY ./ /recommenders-addons
WORKDIR /recommenders-addons
Expand All @@ -129,8 +123,6 @@ RUN touch /ok.txt
# test the editable mode
FROM python:3.7 as test_editable_mode

ARG USE_BAZEL_VERSION

COPY tools/install_deps/tensorflow-cpu.txt ./
RUN pip install --default-timeout=1000 -r tensorflow-cpu.txt
COPY requirements.txt ./
Expand All @@ -139,8 +131,8 @@ COPY tools/install_deps/pytest.txt ./
RUN pip install -r pytest.txt

RUN apt-get update && apt-get install -y sudo rsync cmake
COPY tools/docker/install/install_bazel.sh ./
RUN ./install_bazel.sh $USE_BAZEL_VERSION
COPY tools/install_deps/install_bazelisk.sh .bazelversion ./
RUN bash install_bazelisk.sh

COPY ./ /recommenders-addons
WORKDIR /recommenders-addons
Expand Down
12 changes: 4 additions & 8 deletions tools/install_deps/install_bazelisk.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
#!/usr/bin/env bash
set -x -e

# Downloads bazelisk to ${output_dir} as `bazel`.
date

output_dir=${1:-"/usr/local/bin"}

case "$(uname -s)" in
Darwin) name=bazelisk-darwin-amd64 ;;
Linux) name=bazelisk-linux-amd64 ;;
*) name=bazelisk-windows-amd64 ;;
esac

mkdir -p "${output_dir}"
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.3.0/${name}"
wget --progress=dot:mega -O ${output_dir}/bazel https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-$([ $(uname -m) = "aarch64" ] && echo "arm64" || echo "amd64")

mv "${name}" "${output_dir}/bazel"
chmod u+x "${output_dir}/bazel"

if [[ ! ":$PATH:" =~ :${output_dir}/?: ]]; then
Expand Down
1 change: 0 additions & 1 deletion tools/run_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ set -e

DOCKER_BUILDKIT=1 docker build \
-f tools/docker/sanity_check.Dockerfile \
--build-arg USE_BAZEL_VERSION=${USE_BAZEL_VERSION:-"5.1.1"} \
--target=${1} ./

0 comments on commit 877fd19

Please sign in to comment.