Skip to content

Commit d530584

Browse files
authored
Configure remote builds to use EngFlow (#11887)
This allows us to use EngFlow's remote build grid to execute our builds. Once we hook this up into our CI actions, this will lead to significantly faster CI runs.
1 parent 69e67ae commit d530584

21 files changed

Lines changed: 1892 additions & 25 deletions

.bazelrc

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ build --flag_alias=headless=//common:headless
1111

1212
# Set the default java toolchain
1313

14+
build --java_language_version=11
1415
build --java_runtime_version=remotejdk_11
1516
build --tool_java_language_version=11
17+
build --tool_java_runtime_version=remotejdk_11
1618

1719
# We target java 8 by default
1820

@@ -75,3 +77,45 @@ test:windows --test_env="PROGRAMFILES(X86)"="C:\\Program Files (x86)"
7577
test --test_timeout=1800
7678

7779
test:node_debug --test_output=streamed --test_strategy=exclusive --test_timeout=9999 --nocache_test_results
80+
81+
# The RBE to use
82+
build:remote --bes_results_url=https://gypsum.cluster.engflow.com/invocation
83+
build:remote --bes_backend=grpcs://gypsum.cluster.engflow.com
84+
build:remote --remote_executor=grpcs://gypsum.cluster.engflow.com
85+
build:remote --remote_cache=grpcs://gypsum.cluster.engflow.com
86+
87+
# The number of cores available
88+
build:remote -j 50
89+
90+
# Build Without The Bytes
91+
build:remote --remote_download_outputs=minimal
92+
93+
build:remote --define=EXECUTOR=remote
94+
build:remote --experimental_inmemory_dotd_files
95+
build:remote --experimental_inmemory_jdeps_files
96+
build:remote --remote_timeout=3600
97+
build:remote --spawn_strategy=remote,local
98+
#build:remote --nolegacy_important_outputs
99+
build:remote --incompatible_strict_action_env=true
100+
101+
build:remote --crosstool_top=//common/remote-build/cc:toolchain
102+
build:remote --extra_execution_platforms=//common/remote-build:platform
103+
build:remote --extra_toolchains=//common/remote-build:cc-toolchain
104+
build:remote --host_platform=//common/remote-build:platform
105+
build:remote --platforms=//common/remote-build:platform
106+
107+
# The Docker images are running Linux
108+
build:remote --cpu=k8
109+
build:remote --host_cpu=k8
110+
111+
build:remote --disk_cache=
112+
113+
build:remote --incompatible_enable_cc_toolchain_resolution
114+
build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
115+
test:remote --test_env=DISPLAY=:99.0
116+
test:remote --test_tag_filters=-edge,-safari,-remote
117+
118+
# Env vars we can hard code
119+
build:remote --action_env=HOME=/home/dev
120+
build:remote --action_env=PATH=/bin:/usr/bin:/usr/local/bin
121+
test:remote --test_env=HOME=/home/dev

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,7 @@ bazel-testlogs
128128
/.vscode/
129129
/.scannerwork/
130130
/.bazelrc.local
131+
132+
# Engflow
133+
*.crt
134+
*.key

WORKSPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ default_python_version = "3.8"
4949
python_register_multi_toolchains(
5050
name = "python",
5151
default_version = default_python_version,
52+
ignore_root_user_error = True,
5253
python_versions = [
5354
"3.8",
5455
"3.9",

common/browsers.bzl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ COMMON_TAGS = [
77
chrome_data = select({
88
"@selenium//common:use_pinned_linux_chrome": [
99
"@linux_chromedriver//:chromedriver",
10-
"@linux_chrome//:chrome-linux",
10+
"@linux_chrome//:files",
11+
"@linux_chrome//:chrome-linux/chrome",
1112
],
1213
"@selenium//common:use_pinned_macos_chrome": [
1314
"@mac_chromedriver//:chromedriver",
@@ -29,7 +30,8 @@ edge_data = select({
2930
firefox_data = select({
3031
"@selenium//common:use_pinned_linux_firefox": [
3132
"@linux_geckodriver//:geckodriver",
32-
"@linux_firefox//:firefox",
33+
"@linux_firefox//:files",
34+
"@linux_firefox//:firefox/firefox",
3335
],
3436
"@selenium//common:use_pinned_macos_firefox": [
3537
"@mac_geckodriver//:geckodriver",

common/remote-build/BUILD.bazel

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2020 The Bazel Authors. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# This file is auto-generated by github.com/bazelbuild/bazel-toolchains/pkg/rbeconfigsgen
16+
# and should not be modified directly.
17+
18+
package(default_visibility = ["//visibility:public"])
19+
20+
toolchain(
21+
name = "cc-toolchain",
22+
exec_compatible_with = [
23+
"@platforms//os:linux",
24+
"@platforms//cpu:x86_64",
25+
],
26+
target_compatible_with = [
27+
"@platforms//os:linux",
28+
"@platforms//cpu:x86_64",
29+
],
30+
toolchain = "//common/remote-build/cc:cc-compiler-k8",
31+
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
32+
)
33+
34+
platform(
35+
name = "platform",
36+
constraint_values = [
37+
"@platforms//os:linux",
38+
"@platforms//cpu:x86_64",
39+
],
40+
exec_properties = {
41+
"container-image": "docker://docker.io/shs96c/selenium-remote-build@sha256:314b60a3c2b82f512c0f3fdba0aed8983f2b9bfdf2901a4f41511abdfd6dd74a",
42+
"OSFamily": "Linux",
43+
"dockerReuse": "True",
44+
"dockerRunAsRoot": "False",
45+
"dockerUseEntrypoint": "True",
46+
"sandboxAllowed": "False",
47+
},
48+
parents = ["@local_config_platform//:host"],
49+
)

common/remote-build/cc/BUILD

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# Copyright 2016 The Bazel Authors. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# This becomes the BUILD file for @local_config_cc// under non-BSD unixes.
16+
17+
load(":cc_toolchain_config.bzl", "cc_toolchain_config")
18+
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config")
19+
load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite")
20+
21+
package(default_visibility = ["//visibility:public"])
22+
23+
licenses(["notice"]) # Apache 2.0
24+
25+
cc_library(
26+
name = "malloc",
27+
)
28+
29+
filegroup(
30+
name = "empty",
31+
srcs = [],
32+
)
33+
34+
filegroup(
35+
name = "cc_wrapper",
36+
srcs = ["cc_wrapper.sh"],
37+
)
38+
39+
filegroup(
40+
name = "compiler_deps",
41+
srcs = glob(["extra_tools/**"], allow_empty = True) + [":builtin_include_directory_paths"],
42+
)
43+
44+
# This is the entry point for --crosstool_top. Toolchains are found
45+
# by lopping off the name of --crosstool_top and searching for
46+
# the "${CPU}" entry in the toolchains attribute.
47+
cc_toolchain_suite(
48+
name = "toolchain",
49+
toolchains = {
50+
"k8|gcc": ":cc-compiler-k8",
51+
"k8": ":cc-compiler-k8",
52+
"armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
53+
"armeabi-v7a": ":cc-compiler-armeabi-v7a",
54+
},
55+
)
56+
57+
cc_toolchain(
58+
name = "cc-compiler-k8",
59+
toolchain_identifier = "local",
60+
toolchain_config = ":local",
61+
all_files = ":compiler_deps",
62+
ar_files = ":compiler_deps",
63+
as_files = ":compiler_deps",
64+
compiler_files = ":compiler_deps",
65+
dwp_files = ":empty",
66+
linker_files = ":compiler_deps",
67+
objcopy_files = ":empty",
68+
strip_files = ":empty",
69+
supports_param_files = 1,
70+
module_map = None,
71+
)
72+
73+
cc_toolchain_config(
74+
name = "local",
75+
cpu = "k8",
76+
compiler = "gcc",
77+
toolchain_identifier = "local",
78+
host_system_name = "local",
79+
target_system_name = "local",
80+
target_libc = "local",
81+
abi_version = "local",
82+
abi_libc_version = "local",
83+
cxx_builtin_include_directories = ["/usr/lib/gcc/x86_64-linux-gnu/9/include",
84+
"/usr/local/include",
85+
"/usr/include/x86_64-linux-gnu",
86+
"/usr/include",
87+
"/usr/include/c++/9",
88+
"/usr/include/x86_64-linux-gnu/c++/9",
89+
"/usr/include/c++/9/backward"],
90+
tool_paths = {"ar": "/usr/bin/ar",
91+
"ld": "/usr/bin/ld",
92+
"llvm-cov": "None",
93+
"llvm-profdata": "None",
94+
"cpp": "/usr/bin/cpp",
95+
"gcc": "/usr/bin/gcc",
96+
"dwp": "/usr/bin/dwp",
97+
"gcov": "/usr/bin/gcov",
98+
"nm": "/usr/bin/nm",
99+
"objcopy": "/usr/bin/objcopy",
100+
"objdump": "/usr/bin/objdump",
101+
"strip": "/usr/bin/strip"},
102+
compile_flags = ["-fstack-protector",
103+
"-Wall",
104+
"-Wunused-but-set-parameter",
105+
"-Wno-free-nonheap-object",
106+
"-fno-omit-frame-pointer"],
107+
opt_compile_flags = ["-g0",
108+
"-O2",
109+
"-D_FORTIFY_SOURCE=1",
110+
"-DNDEBUG",
111+
"-ffunction-sections",
112+
"-fdata-sections"],
113+
dbg_compile_flags = ["-g"],
114+
cxx_flags = ["-std=c++0x"],
115+
link_flags = ["-fuse-ld=gold",
116+
"-Wl,-no-as-needed",
117+
"-Wl,-z,relro,-z,now",
118+
"-B/usr/bin",
119+
"-pass-exit-codes"],
120+
link_libs = ["-lstdc++",
121+
"-lm"],
122+
opt_link_flags = ["-Wl,--gc-sections"],
123+
unfiltered_compile_flags = ["-fno-canonical-system-headers",
124+
"-Wno-builtin-macro-redefined",
125+
"-D__DATE__=\"redacted\"",
126+
"-D__TIMESTAMP__=\"redacted\"",
127+
"-D__TIME__=\"redacted\""],
128+
coverage_compile_flags = ["--coverage"],
129+
coverage_link_flags = ["--coverage"],
130+
supports_start_end_lib = True,
131+
)
132+
133+
# Android tooling requires a default toolchain for the armeabi-v7a cpu.
134+
cc_toolchain(
135+
name = "cc-compiler-armeabi-v7a",
136+
toolchain_identifier = "stub_armeabi-v7a",
137+
toolchain_config = ":stub_armeabi-v7a",
138+
all_files = ":empty",
139+
ar_files = ":empty",
140+
as_files = ":empty",
141+
compiler_files = ":empty",
142+
dwp_files = ":empty",
143+
linker_files = ":empty",
144+
objcopy_files = ":empty",
145+
strip_files = ":empty",
146+
supports_param_files = 1,
147+
)
148+
149+
armeabi_cc_toolchain_config(name = "stub_armeabi-v7a")

common/remote-build/cc/WORKSPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT EDIT: automatically generated WORKSPACE file for cc_autoconf rule
2+
workspace(name = "local_config_cc")
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Copyright 2019 The Bazel Authors. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""A Starlark cc_toolchain configuration rule"""
16+
17+
load(
18+
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
19+
"feature",
20+
"tool_path",
21+
)
22+
23+
def _impl(ctx):
24+
toolchain_identifier = "stub_armeabi-v7a"
25+
host_system_name = "armeabi-v7a"
26+
target_system_name = "armeabi-v7a"
27+
target_cpu = "armeabi-v7a"
28+
target_libc = "armeabi-v7a"
29+
compiler = "compiler"
30+
abi_version = "armeabi-v7a"
31+
abi_libc_version = "armeabi-v7a"
32+
cc_target_os = None
33+
builtin_sysroot = None
34+
action_configs = []
35+
36+
supports_pic_feature = feature(name = "supports_pic", enabled = True)
37+
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
38+
features = [supports_dynamic_linker_feature, supports_pic_feature]
39+
40+
cxx_builtin_include_directories = []
41+
artifact_name_patterns = []
42+
make_variables = []
43+
44+
tool_paths = [
45+
tool_path(name = "ar", path = "/bin/false"),
46+
tool_path(name = "cpp", path = "/bin/false"),
47+
tool_path(name = "dwp", path = "/bin/false"),
48+
tool_path(name = "gcc", path = "/bin/false"),
49+
tool_path(name = "gcov", path = "/bin/false"),
50+
tool_path(name = "ld", path = "/bin/false"),
51+
tool_path(name = "llvm-profdata", path = "/bin/false"),
52+
tool_path(name = "nm", path = "/bin/false"),
53+
tool_path(name = "objcopy", path = "/bin/false"),
54+
tool_path(name = "objdump", path = "/bin/false"),
55+
tool_path(name = "strip", path = "/bin/false"),
56+
]
57+
58+
return cc_common.create_cc_toolchain_config_info(
59+
ctx = ctx,
60+
features = features,
61+
action_configs = action_configs,
62+
artifact_name_patterns = artifact_name_patterns,
63+
cxx_builtin_include_directories = cxx_builtin_include_directories,
64+
toolchain_identifier = toolchain_identifier,
65+
host_system_name = host_system_name,
66+
target_system_name = target_system_name,
67+
target_cpu = target_cpu,
68+
target_libc = target_libc,
69+
compiler = compiler,
70+
abi_version = abi_version,
71+
abi_libc_version = abi_libc_version,
72+
tool_paths = tool_paths,
73+
make_variables = make_variables,
74+
builtin_sysroot = builtin_sysroot,
75+
cc_target_os = cc_target_os,
76+
)
77+
78+
armeabi_cc_toolchain_config = rule(
79+
implementation = _impl,
80+
attrs = {},
81+
provides = [CcToolchainConfigInfo],
82+
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
This file is generated by cc_configure and contains builtin include directories
2+
that /usr/bin/gcc reported. This file is a dependency of every compilation action and
3+
changes to it will be reflected in the action cache key. When some of these
4+
paths change, Bazel will make sure to rerun the action, even though none of
5+
declared action inputs or the action commandline changes.
6+
7+
/usr/lib/gcc/x86_64-linux-gnu/9/include
8+
/usr/local/include
9+
/usr/include/x86_64-linux-gnu
10+
/usr/include
11+
/usr/include/c++/9
12+
/usr/include/x86_64-linux-gnu/c++/9
13+
/usr/include/c++/9/backward

0 commit comments

Comments
 (0)