From 84cd22b6ee79dfd04428305eb437ca53d9df0471 Mon Sep 17 00:00:00 2001 From: Malte Poll <1780588+malt3@users.noreply.github.com> Date: Fri, 3 Nov 2023 11:45:58 +0100 Subject: [PATCH] bazel: add buildbarn toolchain (Ubuntu 22.04) --- .bazelrc | 7 ++++++- bazel/rbe/BUILD.bazel | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 bazel/rbe/BUILD.bazel diff --git a/.bazelrc b/.bazelrc index 9e144fb20..8591bfc7f 100644 --- a/.bazelrc +++ b/.bazelrc @@ -46,7 +46,7 @@ common --crosstool_top=@local_config_cc//:toolchain # bazel config to explicitly disable stamping (hide version information at build time) common:nostamp --nostamp --workspace_status_command= -# bazel config to use remote cache +# bazel config to use (buildbuddy) remote cache common:remote_cache --bes_results_url=https://app.buildbuddy.io/invocation/ common:remote_cache --bes_backend=grpcs://remote.buildbuddy.io common:remote_cache --remote_cache=grpcs://remote.buildbuddy.io @@ -56,4 +56,9 @@ common:remote_cache --experimental_remote_cache_compression common:remote_cache --nolegacy_important_outputs common:remote_cache_readonly --noremote_upload_local_results # Uploads logs & artifacts without writing to cache +common:build_barn_rbe_ubuntu_22_04 --remote_timeout=3600 +common:build_barn_rbe_ubuntu_22_04 --remote_executor=grpc://frontend.buildbarn:8980 # this maps to the kubernetes internal buildbarn/frontend service +common:build_barn_rbe_ubuntu_22_04 --extra_execution_platforms=//bazel/rbe:ubuntu-act-22-04-platform +common:build_barn_rbe_ubuntu_22_04 --shell_executable=/bin/bash + try-import %workspace%/.bazeloverwriterc diff --git a/bazel/rbe/BUILD.bazel b/bazel/rbe/BUILD.bazel new file mode 100644 index 000000000..67825b0d9 --- /dev/null +++ b/bazel/rbe/BUILD.bazel @@ -0,0 +1,24 @@ +constraint_setting( + name = "container-image", +) + +constraint_value( + name = "ubuntu-act-22-04", + constraint_setting = ":container-image", +) + +REMOTE_EXEC_CONSTRAINTS = [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + "@rules_nixpkgs_core//constraints:support_nix", + ":ubuntu-act-22-04", +] + +platform( + name = "ubuntu-act-22-04-platform", + constraint_values = REMOTE_EXEC_CONSTRAINTS, + exec_properties = { + "OSFamily": "linux", + "container-image": "docker://ghcr.io/catthehacker/ubuntu:act-22.04", + }, +)