Skip to content

feat(rbe): BuildBuddy remote execution + e2e RBE test#31

Merged
Sam Gammon (sgammon) merged 9 commits into
mainfrom
feat/buildbuddy-rbe
Jun 25, 2026
Merged

feat(rbe): BuildBuddy remote execution + e2e RBE test#31
Sam Gammon (sgammon) merged 9 commits into
mainfrom
feat/buildbuddy-rbe

Conversation

@sgammon

Copy link
Copy Markdown
Member

Configures rules_elide to build/test on BuildBuddy (remote execution + remote cache + Build Event Stream) behind opt-in --config profiles, and adds an e2e workspace that exercises the whole path through the Elide toolchain. Implements the approved design in docs/superpowers/specs/2026-06-24-buildbuddy-rbe-design.md.

What's here

  • .bazelrc remote 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 image gcr.io/flame-public/rbe-ubuntu20-04 (digest-pinned), network: off, and test.EstimatedMemory headroom 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 JUnit elide_java_test so a test action runs remotely too. Has its own copy of the platform target. Analysis verified locally (all targets configure).
  • CI job rbe (BuildBuddy) (ci.yml) — gated to same-repo events (the secret isn't exposed to fork PRs); writes the key into a git-ignored user.bazelrc and runs bazel test //... --config=remote.

Design choices

  • Opt-in, not default. This is a public ruleset — forcing remote on would break keyless/fork builds. Local builds stay local unless a dev drops their own key in user.bazelrc (now git-ignored).
  • Benchmarks excluded. The CodSpeed harness already forces remote/disk caches off, so inner loops never touch BuildBuddy.
  • Mirrors the proven HEATWAVE RBE setup but swaps its custom Wolfi worker for the public image and drops the rules_rs parent (not needed without Rust).

Validation note

The remote path can only be exercised in CI (it needs the BUILDBUDDY_API_KEY secret + network). Local validation here was analysis-only; the new rbe (BuildBuddy) job is what proves real remote compile/test — and is exactly what would surface any action-time network need under network: off.

Out of scope

Routing the existing tests/integration/kotlin-builder jobs through RBE (config is available for them to adopt later), a custom/hardened image, macOS RBE, remote persistent workers.

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
Copilot AI review requested due to automatic review settings June 24, 2026 23:31
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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .bazelrc profiles (buildbuddy, rbe, remote) and a Linux/amd64 BuildBuddy execution platform() target.
  • Introduces a new standalone e2e/rbe workspace (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.bazelrc and runs bazel 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.

Comment thread .bazelrc
Comment thread e2e/rbe/.bazelrc
Comment thread .bazelrc
Comment thread e2e/rbe/.bazelrc
Signed-off-by: Sam Gammon <sam@elide.dev>
@codspeed-hq

codspeed-hq Bot commented Jun 24, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 9 untouched benchmarks


Comparing feat/buildbuddy-rbe (32f77a7) with main (bb4ee0a)

Open in CodSpeed

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.

Comment thread .bazelrc Outdated
Comment thread .bazelignore
Comment thread e2e/rbe/.bazelversion Outdated
… 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).
@sgammon Sam Gammon (sgammon) merged commit b6c9c07 into main Jun 25, 2026
17 checks passed
@sgammon Sam Gammon (sgammon) deleted the feat/buildbuddy-rbe branch June 25, 2026 01:05
This was referenced Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants