Skip to content

Commit 7f20412

Browse files
fuhailinrhdong
authored andcommitted
Add .bazelversion file
1 parent 025eba0 commit 7f20412

File tree

7 files changed

+15
-31
lines changed

7 files changed

+15
-31
lines changed

.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5.1.1

.github/workflows/ci_test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ on:
99
branches:
1010
- master
1111
- r*
12-
env:
13-
USE_BAZEL_VERSION: "5.1.1"
1412

1513
jobs:
1614
yapf-test:

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ on:
1717
env:
1818
MIN_PY_VERSION: '3.7'
1919
MAX_PY_VERSION: '3.9'
20-
USE_BAZEL_VERSION: "5.1.1"
2120
HOROVOD_VERSION: '0.23.0'
2221

2322
jobs:

tools/docker/cpu_tests.Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
FROM python:3.7 as build_wheel
33

44
ARG TF_VERSION=2.8.3
5-
ARG USE_BAZEL_VERSION=5.1.1
65
ARG MPI_VERSION="4.1.1"
76
ARG HOROVOD_VERSION="0.23.0"
87

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

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

15-
COPY tools/docker/install/install_bazel.sh /install/
16-
RUN /install/install_bazel.sh $USE_BAZEL_VERSION
14+
COPY tools/install_deps/install_bazelisk.sh /install/
15+
RUN bash /install/install_bazelisk.sh
1716

1817
COPY tools/docker/install/install_horovod.sh /install/
1918
RUN /install/install_horovod.sh $HOROVOD_VERSION --only-cpu

tools/docker/sanity_check.Dockerfile

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ RUN touch /ok.txt
1414
# -------------------------------
1515
FROM python:3.7 as source_code_test
1616

17-
ARG USE_BAZEL_VERSION
18-
1917
COPY tools/install_deps /install_deps
2018
RUN --mount=type=cache,id=cache_pip,target=/root/.cache/pip \
2119
cd /install_deps && pip install \
@@ -25,8 +23,8 @@ RUN --mount=type=cache,id=cache_pip,target=/root/.cache/pip \
2523
-r pytest.txt
2624

2725
RUN apt-get update && apt-get install -y sudo rsync cmake
28-
COPY tools/docker/install/install_bazel.sh ./
29-
RUN ./install_bazel.sh $USE_BAZEL_VERSION
26+
COPY tools/install_deps/install_bazelisk.sh .bazelversion ./
27+
RUN bash install_bazelisk.sh
3028

3129
COPY ./ /recommenders-addons
3230
RUN pip install -e /recommenders-addons
@@ -47,14 +45,12 @@ RUN touch /ok.txt
4745
# -------------------------------
4846
FROM python:3.7 as valid_build_files
4947

50-
ARG USE_BAZEL_VERSION
51-
5248
COPY tools/install_deps/tensorflow-cpu.txt ./
5349
RUN pip install --default-timeout=1000 -r tensorflow-cpu.txt
5450

5551
RUN apt-get update && apt-get install sudo
56-
COPY tools/docker/install/install_bazel.sh ./
57-
RUN ./install_bazel.sh $USE_BAZEL_VERSION
52+
COPY tools/install_deps/install_bazelisk.sh .bazelversion ./
53+
RUN bash install_bazelisk.sh
5854

5955
COPY ./ /recommenders-addons
6056
WORKDIR /recommenders-addons
@@ -98,8 +94,6 @@ RUN touch /ok.txt
9894
# docs tests
9995
FROM python:3.7 as docs_tests
10096

101-
ARG USE_BAZEL_VERSION
102-
10397
COPY tools/install_deps/tensorflow-cpu.txt ./
10498
RUN pip install --default-timeout=1000 -r tensorflow-cpu.txt
10599
COPY requirements.txt ./
@@ -109,8 +103,8 @@ COPY tools/install_deps/doc_requirements.txt ./
109103
RUN pip install -r doc_requirements.txt
110104

111105
RUN apt-get update && apt-get install -y sudo rsync cmake
112-
COPY tools/docker/install/install_bazel.sh ./
113-
RUN ./install_bazel.sh $USE_BAZEL_VERSION
106+
COPY tools/install_deps/install_bazelisk.sh .bazelversion ./
107+
RUN bash install_bazelisk.sh
114108

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

132-
ARG USE_BAZEL_VERSION
133-
134126
COPY tools/install_deps/tensorflow-cpu.txt ./
135127
RUN pip install --default-timeout=1000 -r tensorflow-cpu.txt
136128
COPY requirements.txt ./
@@ -139,8 +131,8 @@ COPY tools/install_deps/pytest.txt ./
139131
RUN pip install -r pytest.txt
140132

141133
RUN apt-get update && apt-get install -y sudo rsync cmake
142-
COPY tools/docker/install/install_bazel.sh ./
143-
RUN ./install_bazel.sh $USE_BAZEL_VERSION
134+
COPY tools/install_deps/install_bazelisk.sh .bazelversion ./
135+
RUN bash install_bazelisk.sh
144136

145137
COPY ./ /recommenders-addons
146138
WORKDIR /recommenders-addons

tools/install_deps/install_bazelisk.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1+
#!/usr/bin/env bash
2+
set -x -e
3+
14
# Downloads bazelisk to ${output_dir} as `bazel`.
25
date
36

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

6-
case "$(uname -s)" in
7-
Darwin) name=bazelisk-darwin-amd64 ;;
8-
Linux) name=bazelisk-linux-amd64 ;;
9-
*) name=bazelisk-windows-amd64 ;;
10-
esac
11-
129
mkdir -p "${output_dir}"
13-
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.3.0/${name}"
10+
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")
1411

15-
mv "${name}" "${output_dir}/bazel"
1612
chmod u+x "${output_dir}/bazel"
1713

1814
if [[ ! ":$PATH:" =~ :${output_dir}/?: ]]; then

tools/run_build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ set -e
66

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

0 commit comments

Comments
 (0)