Skip to content

Commit

Permalink
Use rbe_preconfig for RBE toolchain configs
Browse files Browse the repository at this point in the history
[`rbe_preconfig`](https://github.com/bazelbuild/continuous-integration/tree/master/rules) is a repo rule that downloads pre-generated, Bazel CI hosted RBE toolchain configs. The list of available toolchains can be checked with [`manifest.json`](https://storage.googleapis.com/bazel-ci/rbe-configs/manifest.json).

This PR replaces `rbe_autoconfig` with `rbe_preconfig` and removes the `bazel_toolchains` dependency.

Closes bazelbuild#13981.

PiperOrigin-RevId: 399615442
  • Loading branch information
coeuvre authored and copybara-github committed Sep 29, 2021
1 parent 4f287b0 commit 26b94ff
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 44 deletions.
25 changes: 7 additions & 18 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,11 @@ REMOTE_PLATFORMS = ("rbe_ubuntu1604_java8", "rbe_ubuntu1804_java11")
[
platform(
name = platform_name + "_platform",
exec_properties = {
"dockerNetwork": "standard",
"dockerPrivileged": "true",
},
parents = ["@" + platform_name + "//config:platform"],
remote_execution_properties = """
{PARENT_REMOTE_EXECUTION_PROPERTIES}
properties: {
name: "dockerNetwork"
value: "standard"
}
properties: {
name: "dockerPrivileged"
value: "true"
}
""",
)
for platform_name in REMOTE_PLATFORMS
]
Expand All @@ -231,14 +224,10 @@ REMOTE_PLATFORMS = ("rbe_ubuntu1604_java8", "rbe_ubuntu1804_java11")
constraint_values = [
"//:highcpu_machine",
],
exec_properties = {
"gceMachineType": "e2-highcpu-32",
},
parents = ["//:" + platform_name + "_platform"],
remote_execution_properties = """
{PARENT_REMOTE_EXECUTION_PROPERTIES}
properties: {
name: "gceMachineType"
value: "e2-highcpu-32"
}
""",
)
for platform_name in REMOTE_PLATFORMS
]
28 changes: 8 additions & 20 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -273,34 +273,22 @@ http_file(
)

dist_http_archive(
name = "bazel_toolchains",
name = "bazelci_rules",
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
)

load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig")
load("@bazelci_rules//:rbe_repo.bzl", "rbe_preconfig")

rbe_autoconfig(
name = "rbe_ubuntu1804_java11",
detect_java_home = True,
registry = "gcr.io",
repository = "bazel-public/ubuntu1804-bazel-java11",
tag = "latest",
)

rbe_autoconfig(
rbe_preconfig(
name = "rbe_ubuntu1604_java8",
detect_java_home = True,
registry = "gcr.io",
repository = "bazel-public/ubuntu1604-bazel-java8",
tag = "latest",
toolchain = "ubuntu1604-bazel-java8",
)

# Creates toolchain configuration for remote execution with BuildKite CI
# for rbe_ubuntu1604.
# To run the tests with RBE on BuildKite CI uncomment the two lines below
# load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig")
# rbe_autoconfig(name = "buildkite_config")
rbe_preconfig(
name = "rbe_ubuntu1804_java11",
toolchain = "ubuntu1804-bazel-java11",
)

http_archive(
name = "com_google_googletest",
Expand Down
11 changes: 5 additions & 6 deletions distdir_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ DIST_DEPS = {
"test_WORKSPACE_files",
],
},
"bazel_toolchains": {
"archive": "bazel-toolchains-4.1.0.tar.gz",
"sha256": "179ec02f809e86abf56356d8898c8bd74069f1bd7c56044050c2cd3d79d0e024",
"strip_prefix": "bazel-toolchains-4.1.0",
"bazelci_rules": {
"archive": "bazelci_rules-1.0.0.tar.gz",
"sha256": "eca21884e6f66a88c358e580fd67a6b148d30ab57b1680f62a96c00f9bc6a07e",
"strip_prefix": "bazelci_rules-1.0.0",
"urls": [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/releases/download/4.1.0/bazel-toolchains-4.1.0.tar.gz",
"https://github.com/bazelbuild/bazel-toolchains/releases/download/4.1.0/bazel-toolchains-4.1.0.tar.gz",
"https://github.com/bazelbuild/continuous-integration/releases/download/rules-1.0.0/bazelci_rules-1.0.0.tar.gz",
],
"used_in": [
"additional_distfiles",
Expand Down

0 comments on commit 26b94ff

Please sign in to comment.