Skip to content

Commit

Permalink
Update RBE platform
Browse files Browse the repository at this point in the history
 - Use the docker container from gcr.io/bazel-untrusted/ubuntu1604_bazel_rbe
   which was built specifically for Bazel's tests on RBE.
 - Introduce a highcpu_machine constraint in order to map heavy tests to
 beefy RBE workers.
 - Add the highcpu_machine constraints to heavy test targets.

Progress towards #8033

Closes #8062.

PiperOrigin-RevId: 243829775
  • Loading branch information
buchgr authored and copybara-github committed Apr 16, 2019
1 parent a174218 commit 593c530
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 10 deletions.
44 changes: 41 additions & 3 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,32 @@ filegroup(
visibility = ["//visibility:public"],
)

constraint_setting(name = "machine_size")

# A machine with "high cpu count".
constraint_value(
name = "highcpu_machine",
constraint_setting = ":machine_size",
visibility = ["//visibility:public"],
)

platform(
name = "default_host_platform",
constraint_values = [
":highcpu_machine",
],
parents = ["@bazel_tools//platforms:host_platform"],
)

# The default RBE platform where most actions run on
platform(
name = "rbe_ubuntu1604_with_network_and_privileged",
parents = ["@bazel_toolchains//configs/ubuntu16_04_clang/latest:platform"],
name = "rbe_ubuntu1604_default",
parents = ["@bazel_toolchains//configs/ubuntu16_04_clang/1.2:rbe_ubuntu1604"],
remote_execution_properties = """
{PARENT_REMOTE_EXECUTION_PROPERTIES}
properties: {
name: "container-image"
value:"docker://gcr.io/bazel-untrusted/ubuntu1604_bazel_rbe@sha256:b60b641427ca8aa99134cc1f9889e3349e391eed85854b5cfbb462884ec3420b"
}
properties: {
name: "dockerNetwork"
value: "standard"
Expand All @@ -139,3 +160,20 @@ platform(
}
""",
)

# The highcpu RBE platform where heavy actions run on. In order to
# use this platform add the highcpu_machine constraint to your target.
platform(
name = "rbe_ubuntu1604_highcpu",
constraint_values = [
":highcpu_machine",
],
parents = [":rbe_ubuntu1604_default"],
remote_execution_properties = """
{PARENT_REMOTE_EXECUTION_PROPERTIES}
properties: {
name: "gceMachineType"
value: "n1-highcpu-32"
}
""",
)
16 changes: 9 additions & 7 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,13 @@ http_file(
)

http_archive(
name = "bazel_toolchains",
sha256 = "4b1468b254a572dbe134cc1fd7c6eab1618a72acd339749ea343bd8f55c3b7eb",
strip_prefix = "bazel-toolchains-d665ccfa3e9c90fa789671bf4ef5f7c19c5715c4",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/d665ccfa3e9c90fa789671bf4ef5f7c19c5715c4.tar.gz",
"https://github.com/bazelbuild/bazel-toolchains/archive/d665ccfa3e9c90fa789671bf4ef5f7c19c5715c4.tar.gz",
],
name = "bazel_toolchains",
sha256 = "67335b3563d9b67dc2550b8f27cc689b64fadac491e69ce78763d9ba894cc5cc",
strip_prefix = "bazel-toolchains-cddc376d428ada2927ad359211c3e356bd9c9fbb",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/cddc376d428ada2927ad359211c3e356bd9c9fbb.tar.gz",
"https://github.com/bazelbuild/bazel-toolchains/archive/cddc376d428ada2927ad359211c3e356bd9c9fbb.tar.gz",
],
)

# Creates toolchain configuration for remote execution with BuildKite CI
Expand Down Expand Up @@ -461,3 +461,5 @@ node_repositories()
load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories")

sass_repositories()

register_execution_platforms("//:default_host_platform"); # buildozer: disable=positional-args
4 changes: 4 additions & 0 deletions src/test/shell/bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ sh_test(
size = "large", # Downloads and compiles protobuf for *every* *test* *case*
srcs = ["bazel_proto_library_test.sh"],
data = [":test-deps"],
exec_compatible_with = ["//:highcpu_machine"],
tags = ["no_windows"], # Doesn't work on Windows for unknown reason
)

Expand Down Expand Up @@ -406,6 +407,7 @@ sh_test(
"//src/test/shell/bazel/testdata:git-repos",
"@bazel_tools//tools/bash/runfiles",
],
exec_compatible_with = ["//:highcpu_machine"],
)

sh_test(
Expand Down Expand Up @@ -697,6 +699,7 @@ sh_test(
"//src:embedded_jdk_allmodules_cached",
"@bazel_tools//tools/bash/runfiles",
],
exec_compatible_with = ["//:highcpu_machine"],
tags = ["block-network"],
)

Expand All @@ -709,6 +712,7 @@ sh_test(
":test-deps",
"//:bazel-distfile",
],
exec_compatible_with = ["//:highcpu_machine"],
tags = [
"no_windows",
"slow",
Expand Down
2 changes: 2 additions & 0 deletions src/tools/singlejar/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ cc_test(
":zip_headers",
":zlib_interface",
],
# Requires at least 5 GiB of memory
exec_compatible_with = ["//:highcpu_machine"],
deps = [
":combiners",
":input_jar",
Expand Down

0 comments on commit 593c530

Please sign in to comment.