Merge pull request #19127 from jtattermusch/unify_bazel_versions

Unify bazel versions
pull/19175/head
Jan Tattermusch 6 years ago committed by GitHub
commit 6100cde6fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      bazel/grpc_deps.bzl
  2. 9
      templates/tools/dockerfile/bazel.include
  3. 9
      tools/dockerfile/test/bazel/Dockerfile
  4. 9
      tools/dockerfile/test/sanity/Dockerfile
  5. 13
      tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh
  6. 3
      tools/internal_ci/windows/bazel_rbe.bat
  7. 11
      tools/remote_build/README.md
  8. 2
      tools/remote_build/rbe_common.bazelrc

@ -186,11 +186,11 @@ def grpc_deps():
if "bazel_toolchains" not in native.existing_rules(): if "bazel_toolchains" not in native.existing_rules():
http_archive( http_archive(
name = "bazel_toolchains", name = "bazel_toolchains",
sha256 = "67335b3563d9b67dc2550b8f27cc689b64fadac491e69ce78763d9ba894cc5cc", sha256 = "88e818f9f03628eef609c8429c210ecf265ffe46c2af095f36c7ef8b1855fef5",
strip_prefix = "bazel-toolchains-cddc376d428ada2927ad359211c3e356bd9c9fbb", strip_prefix = "bazel-toolchains-92dd8a7a518a2fb7ba992d47c8b38299fe0be825",
urls = [ urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/cddc376d428ada2927ad359211c3e356bd9c9fbb.tar.gz", "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/92dd8a7a518a2fb7ba992d47c8b38299fe0be825.tar.gz",
"https://github.com/bazelbuild/bazel-toolchains/archive/cddc376d428ada2927ad359211c3e356bd9c9fbb.tar.gz", "https://github.com/bazelbuild/bazel-toolchains/archive/92dd8a7a518a2fb7ba992d47c8b38299fe0be825.tar.gz",
], ],
) )

@ -1,7 +1,10 @@
#======================== #========================
# Bazel installation # Bazel installation
# Must be in sync with tools/bazel.sh
ENV BAZEL_VERSION 0.24.1
RUN apt-get update && apt-get install -y wget && apt-get clean RUN apt-get update && apt-get install -y wget && apt-get clean
RUN wget https://github.com/bazelbuild/bazel/releases/download/0.23.2/bazel-0.23.2-installer-linux-x86_64.sh && ${'\\'} RUN wget "https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh" && ${'\\'}
bash ./bazel-0.23.2-installer-linux-x86_64.sh && ${'\\'} bash ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && ${'\\'}
rm bazel-0.23.2-installer-linux-x86_64.sh rm bazel-$BAZEL_VERSION-installer-linux-x86_64.sh

@ -51,10 +51,13 @@ RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 t
#======================== #========================
# Bazel installation # Bazel installation
# Must be in sync with tools/bazel.sh
ENV BAZEL_VERSION 0.24.1
RUN apt-get update && apt-get install -y wget && apt-get clean RUN apt-get update && apt-get install -y wget && apt-get clean
RUN wget https://github.com/bazelbuild/bazel/releases/download/0.23.2/bazel-0.23.2-installer-linux-x86_64.sh && \ RUN wget "https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh" && \
bash ./bazel-0.23.2-installer-linux-x86_64.sh && \ bash ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
rm bazel-0.23.2-installer-linux-x86_64.sh rm bazel-$BAZEL_VERSION-installer-linux-x86_64.sh
RUN mkdir -p /var/local/jenkins RUN mkdir -p /var/local/jenkins

@ -97,10 +97,13 @@ ENV CLANG_TIDY=clang-tidy
#======================== #========================
# Bazel installation # Bazel installation
# Must be in sync with tools/bazel.sh
ENV BAZEL_VERSION 0.24.1
RUN apt-get update && apt-get install -y wget && apt-get clean RUN apt-get update && apt-get install -y wget && apt-get clean
RUN wget https://github.com/bazelbuild/bazel/releases/download/0.23.2/bazel-0.23.2-installer-linux-x86_64.sh && \ RUN wget "https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh" && \
bash ./bazel-0.23.2-installer-linux-x86_64.sh && \ bash ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
rm bazel-0.23.2-installer-linux-x86_64.sh rm bazel-$BAZEL_VERSION-installer-linux-x86_64.sh
# Define the default command. # Define the default command.

@ -15,26 +15,21 @@
set -ex set -ex
# Download bazel
temp_dir="$(mktemp -d)"
wget -q https://github.com/bazelbuild/bazel/releases/download/0.23.2/bazel-0.23.2-linux-x86_64 -O "${temp_dir}/bazel"
chmod 755 "${temp_dir}/bazel"
export PATH="${temp_dir}:${PATH}"
# This should show ${temp_dir}/bazel
which bazel
# change to grpc repo root # change to grpc repo root
cd $(dirname $0)/../../.. cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_rc source tools/internal_ci/helper_scripts/prepare_build_linux_rc
# make sure bazel is available
tools/bazel.sh version
# to get "bazel" link for kokoro build, we need to generate # to get "bazel" link for kokoro build, we need to generate
# invocation UUID, set a flag for bazel to use it # invocation UUID, set a flag for bazel to use it
# and upload "bazel_invocation_ids" file as artifact. # and upload "bazel_invocation_ids" file as artifact.
BAZEL_INVOCATION_ID="$(uuidgen)" BAZEL_INVOCATION_ID="$(uuidgen)"
echo "${BAZEL_INVOCATION_ID}" >"${KOKORO_ARTIFACTS_DIR}/bazel_invocation_ids" echo "${BAZEL_INVOCATION_ID}" >"${KOKORO_ARTIFACTS_DIR}/bazel_invocation_ids"
bazel \ tools/bazel.sh \
--bazelrc=tools/remote_build/kokoro.bazelrc \ --bazelrc=tools/remote_build/kokoro.bazelrc \
test \ test \
--invocation_id="${BAZEL_INVOCATION_ID}" \ --invocation_id="${BAZEL_INVOCATION_ID}" \

@ -13,7 +13,8 @@
@rem limitations under the License. @rem limitations under the License.
@rem TODO(jtattermusch): make this generate less output @rem TODO(jtattermusch): make this generate less output
choco install bazel -y --version 0.23.2 --limit-output @rem TODO(jtattermusch): use tools/bazel.sh script to keep the versions in sync
choco install bazel -y --version 0.24.1 --limit-output
cd github/grpc cd github/grpc
set PATH=C:\tools\msys64\usr\bin;C:\Python27;%PATH% set PATH=C:\tools\msys64\usr\bin;C:\Python27;%PATH%

@ -17,22 +17,27 @@ and tests run by Kokoro CI.
## Running remote build manually from dev workstation ## Running remote build manually from dev workstation
*At the time being, tools/bazel.sh is used instead of invoking "bazel" directly
to overcome the bazel versioning problem (our BUILD files currently only work with
a specific window of bazel version and bazel.sh wrapper makes sure that version
is used).*
Run from repository root (opt, dbg): Run from repository root (opt, dbg):
``` ```
# manual run of bazel tests remotely on Foundry # manual run of bazel tests remotely on Foundry
bazel --bazelrc=tools/remote_build/manual.bazelrc test --config=opt //test/... tools/bazel.sh --bazelrc=tools/remote_build/manual.bazelrc test --config=opt //test/...
``` ```
Sanitizer runs (asan, msan, tsan, ubsan): Sanitizer runs (asan, msan, tsan, ubsan):
``` ```
# manual run of bazel tests remotely on Foundry with given sanitizer # manual run of bazel tests remotely on Foundry with given sanitizer
bazel --bazelrc=tools/remote_build/manual.bazelrc test --config=asan //test/... tools/bazel.sh --bazelrc=tools/remote_build/manual.bazelrc test --config=asan //test/...
``` ```
Run on Windows MSVC: Run on Windows MSVC:
``` ```
# RBE manual run only for c-core (must be run on a Windows host machine) # RBE manual run only for c-core (must be run on a Windows host machine)
bazel --bazelrc=tools/remote_build/windows.bazelrc build :all [--credentials_json=(path to service account credentials)] tools/bazel.sh --bazelrc=tools/remote_build/windows.bazelrc build :all [--credentials_json=(path to service account credentials)]
``` ```
Available command line options can be found in Available command line options can be found in

@ -84,4 +84,4 @@ build:ubsan --copt=-gmlt
# TODO(jtattermusch): use more reasonable test timeout # TODO(jtattermusch): use more reasonable test timeout
build:ubsan --test_timeout=3600 build:ubsan --test_timeout=3600
# override the config-agnostic crosstool_top # override the config-agnostic crosstool_top
build:ubsan --crosstool_top=@bazel_toolchains//configs/experimental/ubuntu16_04_clang/1.2/bazel_0.21.0/ubsan:toolchain build:ubsan --crosstool_top=@bazel_toolchains//configs/experimental/ubuntu16_04_clang/1.2/bazel_0.23.0/ubsan:toolchain

Loading…
Cancel
Save