bazel: RBE cleanups — explicit rbe input, gcc worker image, macOS cache-only#1027
Closed
bazel: RBE cleanups — explicit rbe input, gcc worker image, macOS cache-only#1027
Conversation
Signed-off-by: Ryan Northey <ryan@synca.io>
Agent-Logs-Url: https://github.com/phlax/toolshed/sessions/35023e82-4b71-46d6-9a61-2aae6e38260a Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix cleanups for Bazel RBE configuration
bazel: RBE cleanups — explicit rbe input, gcc worker image, macOS cache-only
May 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing RBE integration in
_bazel.ymlmutatedbazel-argsvia string stripping to remove--config=rbe, x-compile jobs inherited RBE flags they can't use,test-gcclacked a gcc-capable worker container, andtest-macoshad no remote cache at all.Changes
New composite action:
actions/bazel/rbe/Encapsulates auth check + flag decision in one reusable place. Used by both
_bazel.ymlandtest-macos.flags(what to append),enabled(default'true')./actions/github/container/authonly whenenabled == 'true'flagsonly when: enabled AND not a PR event AND auth passed; otherwise emits::notice::and outputs empty string_bazel.ymlrbe: boolinput (defaultfalse); whenfalse, auth step is skipped entirelysteps.rbe.outputs.bazel-argsfrom the composite actioninputs.bazel-args, which no longer carries--config=rbebazel.ymlcallerstest,buildrbe: true;--config=rberemoved frombazel-argstest-gccrbe: true;--config=rbe-gccadded tobazel-argstest-macosGITHUB_TOKENforwarded for credential helperbazel/.bazelrccommon:rbe-gcc— overrides--host_platform/--extra_execution_platformsto the gcc worker platforms; used alongside--config=rbeand--config=gcccommon:rbe-cache-only— composesremote-cache + bes, noremote-exec; used by macOSbazel/platforms/rbe/BUILDAdded
linux_x64_gccandlinux_arm64_gccplatforms pointing at thedocker-v0.1.3gcc image:Original prompt
Background
PR envoyproxy#4260 enables EngFlow RBE for the Bazel CI workflows. The expensive jobs now run properly with RBE, but several cleanups are needed.
This task targets branch
bazel-rbeinphlax/toolshed(open the PR against that branch, NOT againstmainand NOT againstenvoyproxy/toolshed).Current state (branch
bazel-rbe).github/workflows/_bazel.yml: thebazeljob runs anactions/github/container/authstep (idrbe). The actual run step parsesinputs.bazel-args, and ifgithub.event_name != pull_requestandsteps.rbe.outputs.authorized != 'true', it strips--config=rbefrom the args via${args//--config=rbe/}. Thexcompile-x86-to-armandxcompile-arm-to-x86jobs also receiveinputs.bazel-argswhich now includes--config=rbe..github/workflows/bazel.yml:test,build, andtest-gccall pass--config=rbedirectly insidebazel-args.test-macosruns natively onmacos-14(does not call_bazel.yml) and uses no remote cache.Required cleanups
1. Add an explicit
rbeboolean input instead of stripping--config=rbefrombazel-argsIn
.github/workflows/_bazel.yml:rbe(defaultfalse) to theworkflow_callinputs.--config=rbefrombazel-argsin.github/workflows/bazel.ymlcallers and instead setrbe: trueon the callers that should use RBE.inputs.rbe == true), and--config=rbeshould be appended to the bazel command only when:inputs.rbe == true, ANDsteps.rbe.outputs.authorized == 'true'), ANDpull_requestevent (auth is allowed to be skipped/unavailable for PRs from forks — in that case run without rbe).inputs.bazel-argsby stripping substrings. Just conditionally append--config=rbeto the bazel command line.inputs.rbe == false, skip the auth step entirely (use a stepif:), and never add--config=rbe.::notice::when RBE was requested but skipped (auth failed or PR event), explaining why.2. x-compile jobs should NOT use RBE
The
xcompile-x86-to-armandxcompile-arm-to-x86jobs in.github/workflows/_bazel.ymlcurrently inheritinputs.bazel-argswhich (on thetestcaller) includes--config=rbe. These x-compile jobs are reportedly broken with RBE.--config=rberegardless of therbeinput. The cleanest way given change (1) above (where--config=rbeis no longer baked intobazel-args) is that they will simply never receive it. Verify that with the newrbeinput model the x-compile steps run plainbazel test ${{ inputs.bazel-args }} ...and do not get--config=rbe.3.
test-gccshould use RBE but with thegccworker containerThe gcc job in
.github/workflows/bazel.ymlcurrently does NOT use RBE (in current branch state — verify; if it does, it would fail because the default RBE worker image does not have gcc).test-gcccaller should setrbe: true.docker.io/envoyproxy/envoy-build:gcc-<tag>as a separate gcc-capable build image. Theenvoyproxy/toolshedrepo produces these images (seedocker/build/); the latest semver-published docker release at the time of writing isdocker-v0.1.3, which producedenvoyproxy/envoy-build:gcc-v0.1.3(as well asworker-v0.1.3).bazel/.bazelrc(e.g.common:rbe-gccor extendcommon:gccwhen combined withcommon:rbe) that overrides thecontainer-imageexec property on the platforms to point at the latest semver-published gcc image. The cleanest approach is likely:bazel/platforms/rbe/BUILD(e.g.linux_x64_gcc,linux_arm64_gcc) using aGCC_WORKER_IMAGEconstant pointing atdocker://docker.io/envoyproxy/envoy-build:gcc-v0.1.3@sha256:<digest>(look up the actual published digest by querying the registry forenvoyproxy/envoy-build:gcc-v0.1.3— if a digest cannot be resolved, leave a TODO comment to pin and use the floating tag for now).common:rbe-gccconfig inbazel/.bazelrcthat sets--host_platform=//platforms/rbe:linux_x64_gccand--extra_execution_platforms=//platforms/rbe:linux_x64_gcc,//platforms/rbe:linux_arm64_gcc(overriding the defaults set bycommon:remote-exec). It should NOT redefine theremote_executor/cache settings — instead the gcc job should pass--config=rbe --config=rbe-gcc(or the bazel.yml caller should set both--config=gccand the new--config=rbe-gcc, alongsiderbe: true).test-gcccaller that with these changes, gcc actions are dispatched onto the gcc worker container.Note: The latest docker release tag is
docker-v0.1.3(as of 2026-05-08). The image name isenvoyproxy/envoy-build:gcc-v0.1.3. Use this; when a new...This pull request was created from Copilot chat.