Skip to content

Commit 90068a6

Browse files
authored
ci: Switch ARM to RBE (envoyproxy#38860)
Fix envoyproxy#38800 Mostly resolve envoyproxy#38674 Signed-off-by: Ryan Northey <[email protected]>
1 parent 6917790 commit 90068a6

18 files changed

+5135
-20
lines changed

.bazelrc

+14
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ build:libc++ --action_env=BAZEL_LINKOPTS=-lm:-pthread
224224
build:libc++ --define force_libcpp=enabled
225225
build:clang-libc++ --config=libc++
226226
build:clang-libc++ --action_env=ARFLAGS=r
227+
build:arm64-clang-libc++ --config=clang-libc++
227228

228229
build:libc++20 --config=libc++
229230
# gRPC has a lot of deprecated-enum-enum-conversion warning. Remove once it is addressed
@@ -294,6 +295,16 @@ build:rbe-toolchain-clang-libc++ --action_env=CXXFLAGS=-stdlib=libc++
294295
build:rbe-toolchain-clang-libc++ --action_env=LDFLAGS=-stdlib=libc++
295296
build:rbe-toolchain-clang-libc++ --define force_libcpp=enabled
296297

298+
build:rbe-toolchain-arm64-clang-libc++ --config=rbe-toolchain
299+
build:rbe-toolchain-arm64-clang-libc++ --platforms=@envoy//bazel/rbe/toolchains:rbe_linux_arm64_clang_libcxx_platform
300+
build:rbe-toolchain-arm64-clang-libc++ --host_platform=@envoy//bazel/rbe/toolchains:rbe_linux_arm64_clang_libcxx_platform
301+
build:rbe-toolchain-arm64-clang-libc++ --crosstool_top=@envoy//bazel/rbe/toolchains/configs/linux/clang_libcxx/cc:toolchain
302+
build:rbe-toolchain-arm64-clang-libc++ --extra_toolchains=@envoy//bazel/rbe/toolchains/configs/linux/clang_libcxx/config:cc-toolchain-arm64
303+
build:rbe-toolchain-arm64-clang-libc++ --action_env=CC=clang --action_env=CXX=clang++
304+
build:rbe-toolchain-arm64-clang-libc++ --action_env=CXXFLAGS=-stdlib=libc++
305+
build:rbe-toolchain-arm64-clang-libc++ --action_env=LDFLAGS=-stdlib=libc++
306+
build:rbe-toolchain-arm64-clang-libc++ --define force_libcpp=enabled
307+
297308
build:rbe-toolchain-asan --config=clang-asan
298309
build:rbe-toolchain-asan --linkopt -fuse-ld=lld
299310
build:rbe-toolchain-asan --action_env=ENVOY_UBSAN_VPTR=1
@@ -338,6 +349,9 @@ build:remote-clang --config=rbe-toolchain-clang
338349
build:remote-clang-libc++ --config=remote
339350
build:remote-clang-libc++ --config=rbe-toolchain-clang-libc++
340351

352+
build:remote-arm64-clang-libc++ --config=remote
353+
build:remote-arm64-clang-libc++ --config=rbe-toolchain-arm64-clang-libc++
354+
341355
build:remote-gcc --config=remote
342356
build:remote-gcc --config=gcc
343357
build:remote-gcc --config=rbe-toolchain-gcc

.github/workflows/_precheck_publish.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,8 @@ jobs:
6868
name: Release (arm64)
6969
target-suffix: arm64
7070
arch: arm64
71-
bazel-extra: >-
72-
--config=remote-cache-envoy-engflow
73-
rbe: false
74-
runs-on: envoy-arm64-large
71+
rbe: true
72+
runs-on: ${{ vars.ENVOY_ARM_VM || 'ubuntu-24.04-arm' }}
7573
timeout-minutes: 180
7674
- target: docs
7775
name: Docs

.github/workflows/_publish_build.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ jobs:
7474
name: Release (arm64)
7575
arch: arm64
7676
bazel-extra: >-
77-
--config=remote-cache-envoy-engflow
78-
rbe: false
79-
runs-on: envoy-arm64-medium
77+
--config=remote-envoy-engflow
78+
rbe: true
79+
runs-on: ${{ vars.ENVOY_ARM_VM || 'ubuntu-24.04-arm' }}
8080

8181
distribution:
8282
permissions:
@@ -120,7 +120,7 @@ jobs:
120120
name: Package debs (arm64)
121121
arch: arm64
122122
cache-build-image-key-suffix: -arm64
123-
runs-on: github-arm64-2c-8gb
123+
runs-on: ${{ vars.ENVOY_ARM_VM || 'ubuntu-24.04-arm' }}
124124

125125
docker:
126126
permissions:

.github/workflows/_publish_verify.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,4 @@ jobs:
142142
arch: arm64
143143
bazel-extra: >-
144144
--config=remote-cache-envoy-engflow
145-
runs-on: github-arm64-2c-8gb
145+
runs-on: ${{ vars.ENVOY_ARM_VM || 'ubuntu-24.04-arm' }}

.github/workflows/_request_cache.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- target: docker-arm64
4848
arch: arm64
4949
cache-suffix: -arm64
50-
runs-on: github-arm64-2c-8gb
50+
runs-on: ${{ vars.ENVOY_ARM_VM || 'ubuntu-24.04-arm' }}
5151

5252
bazel:
5353
permissions:
@@ -77,9 +77,9 @@ jobs:
7777
--config=remote-envoy-engflow
7878
- name: Bazel (arm64/cache)
7979
arch: arm64
80-
runs-on: github-arm64-2c-8gb
80+
runs-on: ${{ vars.ENVOY_ARM_VM || 'ubuntu-24.04-arm' }}
8181
bazel-extra: >-
82-
--config=clang-libc++
82+
--config=remote-arm64-clang-libc++
8383
--config=common-envoy-engflow
8484
--config=cache-envoy-engflow
8585
targets: >-

bazel/BUILD

+8
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,14 @@ config_setting(
769769
define_values = {"engflow_rbe": "true"},
770770
)
771771

772+
selects.config_setting_group(
773+
name = "engflow_rbe_x86_64",
774+
match_all = [
775+
":engflow_rbe",
776+
":linux_x86_64",
777+
],
778+
)
779+
772780
selects.config_setting_group(
773781
name = "apple",
774782
match_any = [

bazel/envoy_binary.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def envoy_cc_binary(
3030
features = [],
3131
linkstatic = True):
3232
exec_properties = exec_properties | select({
33-
repository + "//bazel:engflow_rbe": {"Pool": rbe_pool} if rbe_pool else {},
33+
repository + "//bazel:engflow_rbe_x86_64": {"Pool": rbe_pool} if rbe_pool else {},
3434
"//conditions:default": {},
3535
})
3636
linker_inputs = envoy_exported_symbols_input()

bazel/envoy_library.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def envoy_cc_library(
104104
if tcmalloc_dep:
105105
deps += tcmalloc_external_deps(repository)
106106
exec_properties = exec_properties | select({
107-
repository + "//bazel:engflow_rbe": {"Pool": rbe_pool} if rbe_pool else {},
107+
repository + "//bazel:engflow_rbe_x86_64": {"Pool": rbe_pool} if rbe_pool else {},
108108
"//conditions:default": {},
109109
})
110110

bazel/envoy_test.bzl

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def envoy_cc_fuzz_test(
8888
tags = [],
8989
**kwargs):
9090
exec_properties = exec_properties | select({
91-
repository + "//bazel:engflow_rbe": {"Pool": rbe_pool} if rbe_pool else {},
91+
repository + "//bazel:engflow_rbe_x86_64": {"Pool": rbe_pool} if rbe_pool else {},
9292
"//conditions:default": {},
9393
})
9494
if not (corpus.startswith("//") or corpus.startswith(":") or corpus.startswith("@")):
@@ -175,7 +175,7 @@ def envoy_cc_test(
175175
exec_properties = {}):
176176
coverage_tags = tags + ([] if coverage else ["nocoverage"])
177177
exec_properties = exec_properties | select({
178-
repository + "//bazel:engflow_rbe": {"Pool": rbe_pool} if rbe_pool else {},
178+
repository + "//bazel:engflow_rbe_x86_64": {"Pool": rbe_pool} if rbe_pool else {},
179179
"//conditions:default": {},
180180
})
181181
native.cc_test(
@@ -222,7 +222,7 @@ def envoy_cc_test_library(
222222
alwayslink = 1,
223223
**kargs):
224224
exec_properties = exec_properties | select({
225-
repository + "//bazel:engflow_rbe": {"Pool": rbe_pool} if rbe_pool else {},
225+
repository + "//bazel:engflow_rbe_x86_64": {"Pool": rbe_pool} if rbe_pool else {},
226226
"//conditions:default": {},
227227
})
228228
disable_pch = kargs.pop("disable_pch", True)
@@ -292,7 +292,7 @@ def envoy_benchmark_test(
292292
repository = "",
293293
**kargs):
294294
exec_properties = exec_properties | select({
295-
repository + "//bazel:engflow_rbe": {"Pool": rbe_pool} if rbe_pool else {},
295+
repository + "//bazel:engflow_rbe_x86_64": {"Pool": rbe_pool} if rbe_pool else {},
296296
"//conditions:default": {},
297297
})
298298
native.sh_test(

bazel/rbe/toolchains/BUILD

+10
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ platform(
2222
parents = ["//bazel/rbe/toolchains/configs/linux/clang_libcxx/config:platform"],
2323
)
2424

25+
platform(
26+
name = "rbe_linux_arm64_clang_libcxx_platform",
27+
exec_properties = create_rbe_exec_properties_dict(
28+
docker_add_capabilities = "SYS_PTRACE,NET_RAW,NET_ADMIN",
29+
docker_network = "standard",
30+
docker_privileged = True,
31+
),
32+
parents = ["//bazel/rbe/toolchains/configs/linux/clang_libcxx/config:platform-arm64"],
33+
)
34+
2535
platform(
2636
name = "rbe_linux_gcc_platform",
2737
exec_properties = create_rbe_exec_properties_dict(

bazel/rbe/toolchains/configs/linux/clang_libcxx/cc/BUILD

+110
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite")
2+
load(":aarch64_cc_toolchain_config.bzl", aarch64_cc_toolchain_config = "cc_toolchain_config")
23
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config")
34
load(":cc_toolchain_config.bzl", "cc_toolchain_config")
45

@@ -44,6 +45,14 @@ filegroup(
4445
) + [":builtin_include_directory_paths"],
4546
)
4647

48+
filegroup(
49+
name = "compiler_deps_aarch64",
50+
srcs = glob(
51+
["extra_tools/**"],
52+
allow_empty = True,
53+
) + [":builtin_include_directory_paths_aarch64"],
54+
)
55+
4756
# This is the entry point for --crosstool_top. Toolchains are found
4857
# by lopping off the name of --crosstool_top and searching for
4958
# the "${CPU}" entry in the toolchains attribute.
@@ -54,6 +63,8 @@ cc_toolchain_suite(
5463
"k8": ":cc-compiler-k8",
5564
"armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
5665
"armeabi-v7a": ":cc-compiler-armeabi-v7a",
66+
"aarch64|clang": ":cc-compiler-aarch64",
67+
"aarch64": ":cc-compiler-aarch64",
5768
},
5869
)
5970

@@ -172,3 +183,102 @@ cc_toolchain(
172183
)
173184

174185
armeabi_cc_toolchain_config(name = "stub_armeabi-v7a")
186+
187+
aarch64_cc_toolchain_config(
188+
name = "arm64-local",
189+
abi_libc_version = "arm64-local",
190+
abi_version = "arm64-local",
191+
compile_flags = [
192+
"-fstack-protector",
193+
"-Wall",
194+
"-Wthread-safety",
195+
"-Wself-assign",
196+
"-Wunused-but-set-parameter",
197+
"-Wno-free-nonheap-object",
198+
"-fcolor-diagnostics",
199+
"-fno-omit-frame-pointer",
200+
],
201+
compiler = "clang",
202+
coverage_compile_flags = [
203+
"-fprofile-instr-generate",
204+
"-fcoverage-mapping",
205+
],
206+
coverage_link_flags = ["-fprofile-instr-generate"],
207+
cpu = "aarch64",
208+
cxx_builtin_include_directories = [
209+
"/opt/llvm/lib/clang/14.0.0/include",
210+
"/usr/local/include",
211+
"/usr/include/aarch64-linux-gnu",
212+
"/usr/include",
213+
"/opt/llvm/lib/clang/14.0.0/share",
214+
# "/opt/llvm/include/aarch64-unknown-linux-gnu/c++/v1",
215+
"/opt/llvm/include/c++/v1",
216+
],
217+
218+
cxx_flags = ["-stdlib=libc++"],
219+
dbg_compile_flags = ["-g"],
220+
host_system_name = "local",
221+
link_flags = [
222+
"-fuse-ld=/opt/llvm/bin/ld.lld",
223+
"-Wl,-no-as-needed",
224+
"-Wl,-z,relro,-z,now",
225+
"-B/opt/llvm/bin",
226+
"-lm",
227+
"-pthread",
228+
"-fuse-ld=lld",
229+
],
230+
link_libs = [
231+
"-l:libc++.a",
232+
"-l:libc++abi.a",
233+
],
234+
opt_compile_flags = [
235+
"-g0",
236+
"-O2",
237+
"-D_FORTIFY_SOURCE=1",
238+
"-DNDEBUG",
239+
"-ffunction-sections",
240+
"-fdata-sections",
241+
],
242+
opt_link_flags = ["-Wl,--gc-sections"],
243+
supports_start_end_lib = True,
244+
target_libc = "local",
245+
target_system_name = "local",
246+
tool_paths = {
247+
"ar": "/usr/bin/ar",
248+
"ld": "/usr/bin/ld",
249+
"llvm-cov": "/opt/llvm/bin/llvm-cov",
250+
"llvm-profdata": "/opt/llvm/bin/llvm-profdata",
251+
"cpp": "/usr/bin/cpp",
252+
"gcc": "/opt/llvm/bin/clang-14",
253+
"dwp": "/usr/bin/dwp",
254+
"gcov": "/opt/llvm/bin/llvm-profdata",
255+
"nm": "/usr/bin/nm",
256+
"objcopy": "/usr/bin/objcopy",
257+
"objdump": "/usr/bin/objdump",
258+
"strip": "/usr/bin/strip",
259+
},
260+
toolchain_identifier = "local",
261+
unfiltered_compile_flags = [
262+
"-no-canonical-prefixes",
263+
"-Wno-builtin-macro-redefined",
264+
"-D__DATE__=\"redacted\"",
265+
"-D__TIMESTAMP__=\"redacted\"",
266+
"-D__TIME__=\"redacted\"",
267+
],
268+
)
269+
270+
cc_toolchain(
271+
name = "cc-compiler-aarch64",
272+
all_files = ":compiler_deps_aarch64",
273+
ar_files = ":compiler_deps_aarch64",
274+
as_files = ":compiler_deps_aarch64",
275+
compiler_files = ":compiler_deps_aarch64",
276+
dwp_files = ":empty",
277+
linker_files = ":compiler_deps_aarch64",
278+
module_map = ":arm64.module.modulemap",
279+
objcopy_files = ":empty",
280+
strip_files = ":empty",
281+
supports_param_files = 1,
282+
toolchain_config = ":arm64-local",
283+
toolchain_identifier = "arm64-local",
284+
)

0 commit comments

Comments
 (0)