refactor(dev-infra): switch away from deprecated platform execution properties (#41941)

Bazel no longer recommends the use of `remote_execution_properties`
within `platform` definitions. Bazel intends to replace this attribute
with an object literal based attribute called `exec_properties`.

This simplifies the platform configuration and makes it more
readable. Additionally this make inheritance and overriding easier.

PR Close #41941
This commit is contained in:
Paul Gschwendtner 2021-05-04 15:32:58 +02:00 committed by Misko Hevery
parent 378bb04d7b
commit 19b12d7286

View File

@ -7,26 +7,24 @@ platform(
"@bazel_tools//platforms:x86_64", "@bazel_tools//platforms:x86_64",
"@bazel_tools//tools/cpp:clang", "@bazel_tools//tools/cpp:clang",
], ],
# We use a basic docker image from the Google Cloud container registry that supports exec_properties = {
# browser tests. Note that we usually do not use any of the local browsers, but the image # We use a basic docker image from the Google Cloud container registry that supports
# guarantees that necessary dependencies for launching browsers are installed. Since we # browser tests. Note that we usually do not use any of the local browsers, but the image
# do not rely on many binaries/tools from the image, the image doesn't need to be updated # guarantees that necessary dependencies for launching browsers are installed. Since we
# frequently. There are rare cases where it needs to be updated. e.g. for a more recent Bash # do not rely on many binaries/tools from the image, the image doesn't need to be updated
# version, or new system settings that are required for launching browsers. In order to do that, # frequently. There are rare cases where it needs to be updated. e.g. for a more recent Bash
# we need to either see if the `rbe-ubuntu16-04-webtest` image can be updated, or if we need to # version, or new system settings that are required for launching browsers. In order to do that,
# build and publish our own image to the Google cloud image registry. Additionally, we set the # we need to either see if the `rbe-ubuntu16-04-webtest` image can be updated, or if we need to
# `SYS_ADMIN` capability so that browsers can be launched with sandbox mode enabled. Related # build and publish our own image to the Google cloud image registry.
# information: https://developers.google.com/web/tools/puppeteer/troubleshooting#running_puppeteer_in_docker "container-image": "docker://gcr.io/cloud-marketplace/google/rbe-ubuntu16-04-webtest@sha256:886a12dc4726f5b991b46386292afa8d943b6703a5496c8a1e07cfde778d9044",
remote_execution_properties = """ # The `SYS_ADMIN` capability is added so that browsers can be launched with sandbox mode enabled. Related
properties: { # # information: https://developers.google.com/web/tools/puppeteer/troubleshooting#running_puppeteer_in_docker
name: "container-image" "dockerAddCapabilities": "SYS_ADMIN",
value:"docker://gcr.io/cloud-marketplace/google/rbe-ubuntu16-04-webtest@sha256:886a12dc4726f5b991b46386292afa8d943b6703a5496c8a1e07cfde778d9044" # By default in Google Cloud Remote build execution, network access is disabled. We explicitly set the
} # property in the platform again in case the default ever changes. Network access is not desirable in
properties: { # Bazel builds as it is potential source of flaky tests and therefore also breaks hermeticity.
name: "dockerAddCapabilities" "dockerNetwork": "off",
value: "SYS_ADMIN" },
}
""",
) )
filegroup( filegroup(