diff --git a/WORKSPACE b/WORKSPACE index 18bf641a6a8..1b46a6c1348 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -27,6 +27,8 @@ load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig") # Create toolchain configuration for remote execution. rbe_autoconfig( name = "rbe_default", + # use exec_properties instead of deprecated remote_execution_properties + use_legacy_platform_definition = False, ) load("@bazel_toolchains//rules:environments.bzl", "clang_env") diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl index 95c639c9dbc..3450b791bbd 100644 --- a/bazel/grpc_build_system.bzl +++ b/bazel/grpc_build_system.bzl @@ -31,6 +31,10 @@ load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test") # The set of pollers to test against if a test exercises polling POLLERS = ["epollex", "epoll1", "poll"] +# set exec_properties = LARGE_MACHINE, to run the test on a large machine +# see //third_party/toolchains/machine_size for details +LARGE_MACHINE = { "gceMachineType" : "n1-standard-8"} + def if_not_windows(a): return select({ "//:windows": [], @@ -165,7 +169,7 @@ def ios_cc_test( deps = ios_test_deps, ) -def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data = [], uses_polling = True, language = "C++", size = "medium", timeout = None, tags = [], exec_compatible_with = []): +def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data = [], uses_polling = True, language = "C++", size = "medium", timeout = None, tags = [], exec_compatible_with = [], exec_properties = {}): copts = if_mac(["-DGRPC_CFSTREAM"]) if language.upper() == "C": copts = copts + if_not_windows(["-std=c99"]) @@ -179,6 +183,7 @@ def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data "size": size, "timeout": timeout, "exec_compatible_with": exec_compatible_with, + "exec_properties": exec_properties, } if uses_polling: # the vanilla version of the test should run on platforms that only @@ -207,6 +212,7 @@ def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data ] + args["args"], tags = (tags + ["no_windows", "no_mac"]), exec_compatible_with = exec_compatible_with, + exec_properties = exec_properties, ) else: # the test behavior doesn't depend on polling, just generate the test diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl index f16ead3320c..a6b62554f38 100644 --- a/bazel/grpc_deps.bzl +++ b/bazel/grpc_deps.bzl @@ -174,11 +174,11 @@ def grpc_deps(): # list of releases is at https://releases.bazel.build/bazel-toolchains.html http_archive( name = "bazel_toolchains", - sha256 = "22ca5b8115c8673ecb627a02b606529e813961e447933863fccdf325cc5f999f", - strip_prefix = "bazel-toolchains-0.29.5", + sha256 = "e9bab54199722935f239cb1cd56a80be2ac3c3843e1a6d3492e2bc11f9c21daf", + strip_prefix = "bazel-toolchains-1.0.0", urls = [ - "https://github.com/bazelbuild/bazel-toolchains/releases/download/0.29.5/bazel-toolchains-0.29.5.tar.gz", - "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/0.29.5.tar.gz", + "https://github.com/bazelbuild/bazel-toolchains/releases/download/1.0.0/bazel-toolchains-1.0.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/1.0.0.tar.gz", ], ) diff --git a/templates/tools/dockerfile/bazel.include b/templates/tools/dockerfile/bazel.include index f2124a62db8..7af0d605d8d 100644 --- a/templates/tools/dockerfile/bazel.include +++ b/templates/tools/dockerfile/bazel.include @@ -2,7 +2,7 @@ # Bazel installation # Must be in sync with tools/bazel -ENV BAZEL_VERSION 0.29.1 +ENV BAZEL_VERSION 1.0.0 # The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper. ENV DISABLE_BAZEL_WRAPPER 1 diff --git a/test/core/gprpp/BUILD b/test/core/gprpp/BUILD index 017a5b9fdba..3e23d78b124 100644 --- a/test/core/gprpp/BUILD +++ b/test/core/gprpp/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package") +load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package", "LARGE_MACHINE") licenses(["notice"]) # Apache v2 @@ -111,9 +111,9 @@ grpc_cc_test( grpc_cc_test( name = "mpscq_test", srcs = ["mpscq_test.cc"], - exec_compatible_with = ["//third_party/toolchains/machine_size:large"], + exec_properties = LARGE_MACHINE, language = "C++", - tags = ["no_windows"], # machine_size:large is not configured for windows RBE + tags = ["no_windows"], # LARGE_MACHINE is not configured for windows RBE deps = [ "//:gpr", "//test/core/util:grpc_test_util", diff --git a/test/core/iomgr/BUILD b/test/core/iomgr/BUILD index 0025ef334bd..13327db112f 100644 --- a/test/core/iomgr/BUILD +++ b/test/core/iomgr/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package") +load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package", "LARGE_MACHINE") licenses(["notice"]) # Apache v2 @@ -39,9 +39,9 @@ grpc_cc_library( grpc_cc_test( name = "combiner_test", srcs = ["combiner_test.cc"], - exec_compatible_with = ["//third_party/toolchains/machine_size:large"], + exec_properties = LARGE_MACHINE, language = "C++", - tags = ["no_windows"], # machine_size:large is not configured for windows RBE + tags = ["no_windows"], # LARGE_MACHINE is not configured for windows RBE deps = [ "//:gpr", "//:grpc", diff --git a/test/cpp/qps/BUILD b/test/cpp/qps/BUILD index 433b0b32c75..60596c8e31d 100644 --- a/test/cpp/qps/BUILD +++ b/test/cpp/qps/BUILD @@ -14,7 +14,7 @@ licenses(["notice"]) # Apache v2 -load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library", "grpc_cc_binary", "grpc_package") +load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library", "grpc_cc_binary", "grpc_package", "LARGE_MACHINE") load("//test/cpp/qps:qps_benchmark_script.bzl", "qps_json_driver_batch", "json_run_localhost_batch") grpc_package(name = "test/cpp/qps") @@ -169,8 +169,8 @@ grpc_cc_test( grpc_cc_test( name = "qps_openloop_test", srcs = ["qps_openloop_test.cc"], - exec_compatible_with = ["//third_party/toolchains/machine_size:large"], - tags = ["no_windows"], # machine_size:large is not configured for windows RBE + exec_properties = LARGE_MACHINE, + tags = ["no_windows"], # LARGE_MACHINE is not configured for windows RBE deps = [ ":benchmark_config", ":driver_impl", diff --git a/third_party/toolchains/BUILD b/third_party/toolchains/BUILD index ab2282d005d..93b8bead777 100644 --- a/third_party/toolchains/BUILD +++ b/third_party/toolchains/BUILD @@ -29,21 +29,11 @@ platform( "@bazel_tools//platforms:windows", "@bazel_tools//tools/cpp:msvc", ], - remote_execution_properties = """ - properties: { - name: "container-image" - value:"docker://gcr.io/grpc-testing/rbe_windows_toolchain@sha256:75728e7d6d804090f71095e5fec627b18cfa1f47adc52096c209f2a687e06b2e" - } - properties: { - name: "gceMachineType" # Small machines for majority of tests. - value: "n1-highmem-2" - } - properties:{ - name: "OSFamily" - value: "Windows" - } - - """, + exec_properties = { + "container-image" : "docker://gcr.io/grpc-testing/rbe_windows_toolchain@sha256:75728e7d6d804090f71095e5fec627b18cfa1f47adc52096c209f2a687e06b2e", + "gceMachineType" : "n1-highmem-2", + "OSFamily" : "Windows", + }, ) # RBE Ubuntu16_04 r346485 @@ -53,29 +43,13 @@ platform( constraint_values = [ "//third_party/toolchains/machine_size:standard", ], - remote_execution_properties = """ - {PARENT_REMOTE_EXECUTION_PROPERTIES} - properties: { - name: "gceMachineType" # Small machines for majority of tests. - value: "n1-highmem-2" - } - properties: { - name: "dockerSiblingContainers" - value: "false" - } - properties: { - name: "dockerNetwork" - value: "off" - } - properties: { - name: "dockerAddCapabilities" - value: "SYS_PTRACE" - } - properties: { - name: "dockerPrivileged" - value: "true" - } - """, + exec_properties = { + "gceMachineType" : "n1-highmem-2", # Small machines for majority of tests + "dockerSiblingContainers" : "false", + "dockerNetwork" : "off", + "dockerAddCapabilities" : "SYS_PTRACE", + "dockerPrivileged" : "true" + }, ) platform( @@ -84,29 +58,13 @@ platform( constraint_values = [ "//third_party/toolchains/machine_size:large", ], - remote_execution_properties = """ - {PARENT_REMOTE_EXECUTION_PROPERTIES} - properties: { - name: "gceMachineType" # Large machines for some resource demanding tests (TSAN). - value: "n1-standard-8" - } - properties: { - name: "dockerSiblingContainers" - value: "false" - } - properties: { - name: "dockerNetwork" - value: "off" - } - properties: { - name: "dockerAddCapabilities" - value: "SYS_PTRACE" - } - properties: { - name: "dockerPrivileged" - value: "true" - } - """, + exec_properties = { + "gceMachineType" : "n1-standard-8", # Large machines for some resource demanding tests (TSAN). + "dockerSiblingContainers" : "false", + "dockerNetwork" : "off", + "dockerAddCapabilities" : "SYS_PTRACE", + "dockerPrivileged" : "true" + }, ) platform( diff --git a/tools/bazel b/tools/bazel index 0ff7fa09487..d5d517ba99e 100755 --- a/tools/bazel +++ b/tools/bazel @@ -32,7 +32,7 @@ then exec -a "$0" "${BAZEL_REAL}" "$@" fi -VERSION=0.29.1 +VERSION=1.0.0 echo "INFO: Running bazel wrapper (see //tools/bazel for details), bazel version $VERSION will be used instead of system-wide bazel installation." diff --git a/tools/dockerfile/test/bazel/Dockerfile b/tools/dockerfile/test/bazel/Dockerfile index e671ad62227..33d7afa6c09 100644 --- a/tools/dockerfile/test/bazel/Dockerfile +++ b/tools/dockerfile/test/bazel/Dockerfile @@ -74,7 +74,7 @@ RUN python3.6 -m ensurepip && \ # Bazel installation # Must be in sync with tools/bazel -ENV BAZEL_VERSION 0.29.1 +ENV BAZEL_VERSION 1.0.0 # The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper. ENV DISABLE_BAZEL_WRAPPER 1 diff --git a/tools/dockerfile/test/sanity/Dockerfile b/tools/dockerfile/test/sanity/Dockerfile index 1a3804d1a66..c6a346c99c4 100644 --- a/tools/dockerfile/test/sanity/Dockerfile +++ b/tools/dockerfile/test/sanity/Dockerfile @@ -95,7 +95,7 @@ ENV CLANG_TIDY=clang-tidy # Bazel installation # Must be in sync with tools/bazel -ENV BAZEL_VERSION 0.29.1 +ENV BAZEL_VERSION 1.0.0 # The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper. ENV DISABLE_BAZEL_WRAPPER 1 diff --git a/tools/internal_ci/windows/bazel_rbe.bat b/tools/internal_ci/windows/bazel_rbe.bat index fdc6279dd36..6c7fa1b0084 100644 --- a/tools/internal_ci/windows/bazel_rbe.bat +++ b/tools/internal_ci/windows/bazel_rbe.bat @@ -14,7 +14,7 @@ @rem TODO(jtattermusch): make this generate less output @rem TODO(jtattermusch): use tools/bazel script to keep the versions in sync -choco install bazel -y --version 0.29.1 --limit-output +choco install bazel -y --version 1.0.0 --limit-output cd github/grpc set PATH=C:\tools\msys64\usr\bin;C:\Python27;%PATH% diff --git a/tools/remote_build/rbe_common.bazelrc b/tools/remote_build/rbe_common.bazelrc index 6a95d90a41e..d4242baaae9 100644 --- a/tools/remote_build/rbe_common.bazelrc +++ b/tools/remote_build/rbe_common.bazelrc @@ -92,4 +92,4 @@ build:ubsan --test_timeout=3600 # how to update the bazel toolchain for ubsan: # - check for the latest released version in https://github.com/bazelbuild/bazel-toolchains/tree/master/configs/experimental/ubuntu16_04_clang # - you might need to update the bazel_toolchains dependency in grpc_deps.bzl -build:ubsan --crosstool_top=@bazel_toolchains//configs/experimental/ubuntu16_04_clang/1.2/bazel_0.28.0/ubsan:toolchain +build:ubsan --crosstool_top=@bazel_toolchains//configs/experimental/ubuntu16_04_clang/1.3/bazel_0.29.1/ubsan:toolchain