feat(rbe): BuildBuddy remote execution + e2e RBE test#31
Conversation
Configure rules_elide to build/test on BuildBuddy RBE + remote cache + Build
Event Stream, behind opt-in --config profiles, and add an e2e workspace that
exercises the path end-to-end through the Elide toolchain.
- .bazelrc: composable remote profiles —
--config=buildbuddy BES + remote cache
--config=rbe + remote execution on //tools/platforms:rbe_linux_amd64
--config=remote alias for --config=rbe
Opt-in by design (public ruleset): local builds stay local; CI passes the
config + key. Key injected via user.bazelrc (now git-ignored), never committed.
- //tools/platforms:rbe_linux_amd64: RBE platform on the public BuildBuddy glibc
image (digest-pinned), network=off, JVM-test memory headroom. No custom worker
image — the Elide toolchain ships its native binary as an action input.
- e2e/rbe: minimal Java+Kotlin workspace (cross-language lib + Kotlin binary +
JUnit test) with its own copy of the platform; analysis verified locally.
- ci.yml: `rbe (BuildBuddy)` job, gated to same-repo events (the secret is not
exposed to fork PRs), runs `bazel test //... --config=remote`.
- Benchmarks untouched: inner loops never touch BuildBuddy.
Design: docs/superpowers/specs/2026-06-24-buildbuddy-rbe-design.md
protobuf (transitive via rules_elide) also contributes to the shared `maven` repo; declare known_contributing_modules = ["protobuf"] to suppress the bzlmod layering warning on `bazel build` in e2e/rbe.
There was a problem hiding this comment.
Pull request overview
This PR adds opt-in BuildBuddy remote cache/BES + remote execution (RBE) support to rules_elide, along with a dedicated end-to-end workspace and CI job intended to exercise Elide’s Java/Kotlin compile and JUnit test actions under RBE.
Changes:
- Adds composable
.bazelrcprofiles (buildbuddy,rbe,remote) and a Linux/amd64 BuildBuddy executionplatform()target. - Introduces a new standalone
e2e/rbeworkspace (MODULE/BUILD/sample sources) plus matching remote profiles to validate the full toolchain path. - Adds a gated CI workflow job that injects the BuildBuddy API key via
user.bazelrcand runsbazel test //... --config=remote.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/platforms/BUILD.bazel | Adds the BuildBuddy RBE execution platform definition (container-image, network off, memory estimate). |
| e2e/rbe/tools/platforms/BUILD.bazel | Duplicates the RBE platform target inside the standalone e2e workspace. |
| e2e/rbe/sample/HelloTest.java | Adds a minimal JUnit test to ensure a test action runs via the Elide toolchain. |
| e2e/rbe/sample/Hello.java | Adds a minimal Java library dependency for the cross-language graph. |
| e2e/rbe/sample/Greeter.kt | Adds Kotlin code depending on the Java library to exercise Kotlin→Java compilation. |
| e2e/rbe/sample/App.kt | Adds a small Kotlin binary to exercise Kotlin binary compilation/link. |
| e2e/rbe/README.md | Documents how to run the e2e workspace locally/CI with BuildBuddy remote configs. |
| e2e/rbe/MODULE.bazel | Defines the standalone bzlmod workspace, toolchain registration, and JUnit deps. |
| e2e/rbe/BUILD.bazel | Defines the minimal Java/Kotlin/test target graph compiled and tested through Elide. |
| e2e/rbe/.bazelversion | Pins Bazelisk/Bazel version for the e2e workspace. |
| e2e/rbe/.bazelrc | Adds the e2e workspace’s base Bazel flags and BuildBuddy remote config profiles. |
| docs/superpowers/specs/2026-06-24-buildbuddy-rbe-design.md | Adds the approved design document describing goals, activation model, and implementation. |
| .gitignore | Ignores user.bazelrc to keep injected BuildBuddy API keys out of git. |
| .github/workflows/ci.yml | Adds the gated rbe (BuildBuddy) CI job to run the new e2e workspace under --config=remote. |
| .bazelrc | Adds root workspace BuildBuddy remote config profiles and try-import user.bazelrc. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Sam Gammon <sam@elide.dev>
Merging this PR will not alter performance
|
Under remote execution the JUnit test runs via `elide java`, which on the public rbe-ubuntu20-04 image falls back to the image's system JDK (Java 11) — Elide's bundled GraalVM 25 is not among the shipped action inputs. Elide's javac otherwise defaults to JDK 25 bytecode (class 69), so the test died with UnsupportedClassVersionError. Pin lib + HelloTest to `--release 11` (class 55).
Address PR review: - Disable Elide persistent workers under --config=rbe (--//elide:use_workers=false / --@rules_elide//elide:use_workers=false). Workers are a local strategy Bazel won't run on the executor; forcing Elide's supported one-shot compiles keeps every compile a plain remote action. Verified the workers-off path builds + tests. - Document that --config=rbe/=remote pins the Linux/x86_64 RBE platform and so expects a Linux x86_64 build host (CI provides it); non-Linux hosts use --config=buildbuddy for remote cache + BES only. Noted in both .bazelrc files and e2e/rbe/README.md.
Signed-off-by: Sam Gammon <sam@elide.dev>
Signed-off-by: Sam Gammon <sam@elide.dev>
Signed-off-by: Sam Gammon <sam@elide.dev>
… java config
The elide_*_test launcher runs `elide java`, which needs an external JDK (it
probes JAVA_HOME/PATH). Unlike the kotlin builder launcher, it shipped no JDK
and relied on a system `java` — absent in BuildBuddy's scrubbed test env
("No external JVM found in PATH"). Mirror the builder: add a
current_java_runtime `_jdk` to the test rules, ship it in the launcher
runfiles, and export JAVA_HOME from its rlocation so tests are hermetic on any
executor/container.
Also addresses PR review (Copilot):
- .bazelrc: replace the duplicated/bare-level java_* lines with
--java_runtime_version / --tool_java_runtime_version = remotejdk_21 (proper
version labels). 21 because tests/kotlin_builder compiles to -jvm-target=21
(class 65), which the shipped runtime must load.
- .bazelignore: add e2e/rbe + e2e/vanilla (nested workspaces).
- e2e/rbe/.bazelversion: 9.1.0 -> 9.1.1 to match root + other workspaces.
Validated locally: full //tests/... suite (36 tests) passes; with
--java_runtime_version=remotejdk_21 the launcher resolves the downloaded
remotejdk21_linux/bin/java (not local_jdk).
Configures
rules_elideto build/test on BuildBuddy (remote execution + remote cache + Build Event Stream) behind opt-in--configprofiles, and adds an e2e workspace that exercises the whole path through the Elide toolchain. Implements the approved design indocs/superpowers/specs/2026-06-24-buildbuddy-rbe-design.md.What's here
.bazelrcremote profiles (composable):--config=buildbuddy— BES + remote cache--config=rbe— the above + remote execution on//tools/platforms:rbe_linux_amd64--config=remote— alias for--config=rbe(the usual entrypoint)//tools/platforms:rbe_linux_amd64— RBE platform on the public BuildBuddy glibc imagegcr.io/flame-public/rbe-ubuntu20-04(digest-pinned),network: off, andtest.EstimatedMemoryheadroom for JVM test actions. No custom worker image: the Elide toolchain ships its native binary to the executor as an action input.e2e/rbe/— a minimal standalone workspace:lib(Java) ←kt_lib(Kotlin, cross-language) ←kt_app(Kotlin binary), plus a JUnitelide_java_testso a test action runs remotely too. Has its own copy of the platform target. Analysis verified locally (all targets configure).rbe (BuildBuddy)(ci.yml) — gated to same-repo events (the secret isn't exposed to fork PRs); writes the key into a git-ignoreduser.bazelrcand runsbazel test //... --config=remote.Design choices
user.bazelrc(now git-ignored).rules_rsparent (not needed without Rust).Validation note
The remote path can only be exercised in CI (it needs the
BUILDBUDDY_API_KEYsecret + network). Local validation here was analysis-only; the newrbe (BuildBuddy)job is what proves real remote compile/test — and is exactly what would surface any action-time network need undernetwork: off.Out of scope
Routing the existing
tests/integration/kotlin-builderjobs through RBE (config is available for them to adopt later), a custom/hardened image, macOS RBE, remote persistent workers.