Skip to content

Commit a6761d3

Browse files
devversionclydin
authored andcommitted
build: use platform from shared dev-infra package for remote execution
Uses the new shared RBE platform from the dev-infra package. We introduced a shared Bazel platform for remote execution builds using Google cloud. Previously we used `bazel_toolchains` for providing the platform w/ additional CPP and Java toolchains `bazel_toolchains` no longer provides default toolchains with the latest version, but provides a tool (linux and windows only) for generating toolchain/platforms, which then need to be checked into the repository. This is quite inconvenient and cumbersome (especially with no macOS support), so we just provided our own platform and CPP toolchain within `@angular/dev-infra-private`. This is more simple than all the effort we'd need to make the toolchain generation tool work (while it would also increase the amount of checked-in sources significantly; with more unused toolchains for CPP or Java) See: angular/angular#41767.
1 parent 4ed1c4f commit a6761d3

7 files changed

Lines changed: 32 additions & 75 deletions

File tree

.bazelrc

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,15 @@ build:remote --remote_executor=remotebuildexecution.googleapis.com
105105
build:remote --remote_timeout=600
106106
build:remote --jobs=150
107107

108-
# Setup the toolchain and platform for the remote build execution. The platform
109-
# is automatically configured by the "rbe_autoconfig" rule in the project workpsace.
110-
build:remote --host_javabase=@rbe_ubuntu1604_angular//java:jdk
111-
build:remote --javabase=@rbe_ubuntu1604_angular//java:jdk
112-
build:remote --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
113-
build:remote --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
114-
build:remote --crosstool_top=@rbe_ubuntu1604_angular//cc:toolchain
115-
build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
116-
build:remote --extra_toolchains=@rbe_ubuntu1604_angular//config:cc-toolchain
117-
build:remote --extra_execution_platforms=//tools:rbe_ubuntu1604-angular
118-
build:remote --host_platform=//tools:rbe_ubuntu1604-angular
119-
build:remote --platforms=//tools:rbe_ubuntu1604-angular
120-
121-
# Set remote caching settings
108+
# Setup the toolchain and platform for the remote build execution. The platform
109+
# is provided by the shared dev-infra package and targets k8 remote containers.
110+
build:remote --crosstool_top=@npm//@angular/dev-infra-private/bazel/remote-execution/cpp:cc_toolchain_suite
111+
build:remote --extra_toolchains=@npm//@angular/dev-infra-private/bazel/remote-execution/cpp:cc_toolchain
112+
build:remote --extra_execution_platforms=//tools:rbe_platform_with_network_access
113+
build:remote --host_platform=//tools:rbe_platform_with_network_access
114+
build:remote --platforms=//tools:rbe_platform_with_network_access
115+
116+
# Set remote caching settings
122117
build:remote --remote_accept_cached=true
123118

124119
# Force remote executions to consider the entire run as linux.

.bazelversion

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
4.0.0
2-
# [NB: this comment has to be after the first line, see https://github.com/bazelbuild/bazelisk/issues/117]
3-
# When updating the Bazel version you also need to update the RBE toolchains version in WORKSPACE

WORKSPACE

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -41,38 +41,3 @@ yarn_install(
4141
strict_visibility = False, # Needed for ts-api-guardian. More info about this can be found https://github.com/bazelbuild/rules_nodejs/wiki#strict_visibility-on-yarn_install-and-npm_install-now-defaults-true-2199
4242
yarn_lock = "//:yarn.lock",
4343
)
44-
45-
##########################
46-
# Remote Execution Setup #
47-
##########################
48-
# Bring in bazel_toolchains for RBE setup configuration.
49-
http_archive(
50-
name = "bazel_toolchains",
51-
sha256 = "1adf5db506a7e3c465a26988514cfc3971af6d5b3c2218925cd6e71ee443fc3f",
52-
strip_prefix = "bazel-toolchains-4.0.0",
53-
url = "https://github.com/bazelbuild/bazel-toolchains/archive/4.0.0.tar.gz",
54-
)
55-
56-
load("@bazel_toolchains//rules:environments.bzl", "clang_env")
57-
load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig")
58-
59-
rbe_autoconfig(
60-
name = "rbe_ubuntu1604_angular",
61-
# Need to specify a base container digest in order to ensure that we can use the checked-in
62-
# platform configurations for the "ubuntu16_04" image. Otherwise the autoconfig rule would
63-
# need to pull the image and run it in order determine the toolchain configuration. See:
64-
# https://github.com/bazelbuild/bazel-toolchains/blob/4.0.0/configs/ubuntu16_04_clang/versions.bzl
65-
base_container_digest = "sha256:f6568d8168b14aafd1b707019927a63c2d37113a03bcee188218f99bd0327ea1",
66-
# Note that if you change the `digest`, you might also need to update the
67-
# `base_container_digest` to make sure marketplace.gcr.io/google/rbe-ubuntu16-04-webtest:<digest>
68-
# and marketplace.gcr.io/google/rbe-ubuntu16-04:<base_container_digest> have
69-
# the same Clang and JDK installed. Clang is needed because of the dependency on
70-
# @com_google_protobuf. Java is needed for the Bazel's test executor Java tool.
71-
digest = "sha256:f743114235a43355bf8324e2ba0fa6a597236fe06f7bc99aaa9ac703631c306b",
72-
env = clang_env(),
73-
registry = "marketplace.gcr.io",
74-
# We can't use the default "ubuntu16_04" RBE image provided by the autoconfig because we need
75-
# a specific Linux kernel that comes with "libx11" in order to run headless browser tests.
76-
repository = "google/rbe-ubuntu16-04-webtest",
77-
use_checked_in_confs = "Force",
78-
)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"@angular/compiler": "12.0.0-rc.1",
7272
"@angular/compiler-cli": "12.0.0-rc.1",
7373
"@angular/core": "12.0.0-rc.1",
74-
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#00bbf3f530406c78cf25d5b37641c5bdac5d047e",
74+
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#106d8c0d9de461c133e15a21ab6fae93890164f7",
7575
"@angular/forms": "12.0.0-rc.1",
7676
"@angular/localize": "12.0.0-rc.1",
7777
"@angular/material": "11.2.11",

renovate.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"pinVersions": false
3131
},
3232
{
33-
"packagePatterns": ["^@bazel/.*", "^build_bazel.*", "bazel_toolchains"],
33+
"packagePatterns": ["^@bazel/.*", "^build_bazel.*"],
3434
"groupName": "bazel",
3535
"pinVersions": false
3636
},

tools/BUILD.bazel

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,11 @@ nodejs_binary(
2626
)
2727

2828
platform(
29-
name = "rbe_ubuntu1604-angular",
30-
parents = ["@rbe_ubuntu1604_angular//config:platform"],
31-
remote_execution_properties = """
32-
{PARENT_REMOTE_EXECUTION_PROPERTIES}
33-
properties: {
34-
name: "dockerAddCapabilities"
35-
value: "SYS_ADMIN"
36-
}
37-
properties: {
38-
name: "dockerNetwork"
39-
value: "standard"
40-
}
41-
properties: {
42-
name: "Pool"
43-
value: "default"
44-
}
45-
""",
29+
name = "rbe_platform_with_network_access",
30+
exec_properties = {
31+
"dockerNetwork": "standard",
32+
},
33+
parents = ["@npm//@angular/dev-infra-private/bazel/remote-execution:platform"],
4634
)
4735

4836
# @external_end

yarn.lock

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,9 @@
8484
dependencies:
8585
tslib "^2.0.0"
8686

87-
"@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#00bbf3f530406c78cf25d5b37641c5bdac5d047e":
87+
"@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#106d8c0d9de461c133e15a21ab6fae93890164f7":
8888
version "0.0.0"
89-
uid "00bbf3f530406c78cf25d5b37641c5bdac5d047e"
90-
resolved "https://github.com/angular/dev-infra-private-builds.git#00bbf3f530406c78cf25d5b37641c5bdac5d047e"
89+
resolved "https://github.com/angular/dev-infra-private-builds.git#106d8c0d9de461c133e15a21ab6fae93890164f7"
9190
dependencies:
9291
"@angular/benchpress" "0.2.1"
9392
"@bazel/buildifier" "^4.0.1"
@@ -117,7 +116,7 @@
117116
typed-graphqlify "^3.1.1"
118117
typescript "~4.2.4"
119118
yaml "^1.10.0"
120-
yargs "^16.2.0"
119+
yargs "^17.0.0"
121120

122121
"@angular/forms@12.0.0-rc.1":
123122
version "12.0.0-rc.1"
@@ -10238,7 +10237,6 @@ sass@1.32.12, sass@^1.32.8:
1023810237

1023910238
"sauce-connect-proxy@https://saucelabs.com/downloads/sc-4.6.4-linux.tar.gz":
1024010239
version "0.0.0"
10241-
uid "992e2cb0d91e54b27a4f5bbd2049f3b774718115"
1024210240
resolved "https://saucelabs.com/downloads/sc-4.6.4-linux.tar.gz#992e2cb0d91e54b27a4f5bbd2049f3b774718115"
1024310241

1024410242
saucelabs@^1.5.0:
@@ -12423,6 +12421,19 @@ yargs@^16.0.0, yargs@^16.1.1, yargs@^16.2.0:
1242312421
y18n "^5.0.5"
1242412422
yargs-parser "^20.2.2"
1242512423

12424+
yargs@^17.0.0:
12425+
version "17.0.1"
12426+
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.0.1.tgz#6a1ced4ed5ee0b388010ba9fd67af83b9362e0bb"
12427+
integrity sha512-xBBulfCc8Y6gLFcrPvtqKz9hz8SO0l1Ni8GgDekvBX2ro0HRQImDGnikfc33cgzcYUSncapnNcZDjVFIH3f6KQ==
12428+
dependencies:
12429+
cliui "^7.0.2"
12430+
escalade "^3.1.1"
12431+
get-caller-file "^2.0.5"
12432+
require-directory "^2.1.1"
12433+
string-width "^4.2.0"
12434+
y18n "^5.0.5"
12435+
yargs-parser "^20.2.2"
12436+
1242612437
yauzl@^2.10.0:
1242712438
version "2.10.0"
1242812439
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9"

0 commit comments

Comments
 (0)