Skip to content

build: use platform from shared dev-infra package for remote execution #22555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ build:remote --project_id=internal-200822
# Needed due to: https://github.com/bazelbuild/bazel/issues/7254
build:remote --define=EXECUTOR=remote

# For remote execution, we use the `ubuntu16_04_clang` toolchain configurations. These only
# support `k8` or `armeabi-v7a`. Since we run on remotely with `k8` containers, we need to
# ensure that the proper CPU is configured so that the correct toolchain can be used.
# https://github.com/bazelbuild/bazel-toolchains/blob/master/configs/ubuntu16_04_clang/10.0.0/bazel_2.1.0/cc/BUILD#L50
# Since remote builds run within Google Cloud `k8`-based containers, we set the
# host and target CPU accordingly.
build:remote --cpu=k8
build:remote --host_cpu=k8

Expand All @@ -84,16 +82,12 @@ build:remote --remote_executor=remotebuildexecution.googleapis.com
build:remote --auth_enabled=true

# Setup the toolchain and platform for the remote build execution. The platform
# is automatically configured by the "rbe_autoconfig" rule in the project workpsace.
build:remote --crosstool_top=@rbe_default//cc:toolchain
build:remote --host_javabase=@rbe_default//java:jdk
build:remote --javabase=@rbe_default//java:jdk
build:remote --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
build:remote --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
build:remote --extra_execution_platforms=//tools:rbe_platform
build:remote --host_platform=//tools:rbe_platform
build:remote --platforms=//tools:rbe_platform
build:remote --extra_toolchains=@rbe_default//config:cc-toolchain
# is provided by the shared dev-infra package and targets k8 remote containers.
build:remote --crosstool_top=@npm//@angular/dev-infra-private/bazel/remote-execution/cpp:cc_toolchain_suite
build:remote --extra_toolchains=@npm//@angular/dev-infra-private/bazel/remote-execution/cpp:cc_toolchain
build:remote --extra_execution_platforms=@npm//@angular/dev-infra-private/bazel/remote-execution:platform
build:remote --host_platform=@npm//@angular/dev-infra-private/bazel/remote-execution:platform
build:remote --platforms=@npm//@angular/dev-infra-private/bazel/remote-execution:platform

################################
# --config=build-results #
Expand Down
36 changes: 0 additions & 36 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -66,42 +66,6 @@ load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories")

sass_repositories()

# Bring in bazel_toolchains for RBE setup configuration.
http_archive(
name = "bazel_toolchains",
# Patch `bazel-toolchains` to always consider the host platform as Linux. This is necessary
# because the RBE configurations are incorrectly based on the host platform and this breaks
# cross-platform remote execution. e.g. using RBE on macOS.
# See: https://github.com/bazelbuild/bazel-toolchains/issues/895
patches = ["//tools:rbe_cross_platform_workaround.patch"],
sha256 = "1adf5db506a7e3c465a26988514cfc3971af6d5b3c2218925cd6e71ee443fc3f",
strip_prefix = "bazel-toolchains-4.0.0",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/releases/download/4.0.0/bazel-toolchains-4.0.0.tar.gz",
"https://github.com/bazelbuild/bazel-toolchains/releases/download/4.0.0/bazel-toolchains-4.0.0.tar.gz",
],
)

load("@bazel_toolchains//repositories:repositories.bzl", bazel_toolchains_repositories = "repositories")

bazel_toolchains_repositories()

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

rbe_autoconfig(
name = "rbe_default",
# Need to specify a base container digest in order to ensure that we can use the checked-in
# platform configurations for the "ubuntu16_04" image. Otherwise the autoconfig rule would
# need to pull the image and run it in order determine the toolchain configuration.
# See: https://github.com/bazelbuild/bazel-toolchains/blob/master/configs/ubuntu16_04_clang/versions.bzl#L9
base_container_digest = "sha256:f6568d8168b14aafd1b707019927a63c2d37113a03bcee188218f99bd0327ea1",
digest = "sha256:dddaaddbe07a61c2517f9b08c4977fc23c4968fcb6c0b8b5971e955d2de7a961",
registry = "marketplace.gcr.io",
# We can't use the default "ubuntu16_04" RBE image provided by the autoconfig because we need
# a specific Linux kernel that comes with "libx11" in order to run headless browser tests.
repository = "google/rbe-ubuntu16-04-webtest",
)

# Load pinned rules_webtesting browser versions for tests.
#
# TODO(wagnermaciel): deduplicate browsers - this will load another version of chromium in the
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@angular-devkit/schematics": "^12.0.0-rc.0",
"@angular/bazel": "^12.0.0-rc.0",
"@angular/compiler-cli": "^12.0.0-rc.0",
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#3953ba9eea35a2660b6068523bafb92634042be9",
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#2e0271af93b020a811323fbc274afcf588dbc91e",
"@angular/platform-browser-dynamic": "^12.0.0-rc.0",
"@angular/platform-server": "^12.0.0-rc.0",
"@angular/router": "^12.0.0-rc.0",
Expand Down
15 changes: 0 additions & 15 deletions tools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,8 @@ package(default_visibility = ["//visibility:public"])
exports_files([
"system-config-tmpl.js",
"system-rxjs-operators.js",
"rbe_cross_platform_workaround.patch",
])

# Workaround for https://github.com/bazelbuild/bazel-toolchains/issues/356. We need the
# "SYS_ADMIN" capability in order to run browsers with sandbox enabled.
platform(
name = "rbe_platform",
parents = ["@rbe_default//config:platform"],
remote_execution_properties = """
{PARENT_REMOTE_EXECUTION_PROPERTIES}
properties: {
name: "dockerAddCapabilities"
value: "SYS_ADMIN"
}
""",
)

config_setting(
name = "view_engine_mode",
values = {
Expand Down
26 changes: 0 additions & 26 deletions tools/rbe_cross_platform_workaround.patch

This file was deleted.

Loading