Skip to content

chore(bazel): remove references to the decommissioned remote cache#435

Open
balajinvda wants to merge 4 commits into
mainfrom
chore/sync-bazelversion-drop-nvcfbarn
Open

chore(bazel): remove references to the decommissioned remote cache#435
balajinvda wants to merge 4 commits into
mainfrom
chore/sync-bazelversion-drop-nvcfbarn

Conversation

@balajinvda

@balajinvda balajinvda commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Why

The internal Buildbarn host was retired, but nine files still referenced it. The important one is not cosmetic: the per-service .bazel-remote-probe scripts defaulted NVCF_BAZEL_REMOTE_HOST to that host, so an unset variable pointed the probe at a dead endpoint instead of cleanly disabling the cache.

What changed

  • Probe scripts (6): no default host. An unset NVCF_BAZEL_REMOTE_HOST now disables the cache and builds local-only, which is the safe fallback these scripts already document. No replacement endpoint is hardcoded; the caller supplies it, matching the root .bazelrc.
  • nvsnap/.bazelrc: drop the dead endpoint from the :remote profile, leaving only policy and tuning flags.
  • byoo-otel-collector/README.md and grpc-proxy/proxy/geo/BUILD.bazel: comment references.

There are now zero references to the retired host in the repository.

While editing the geo BUILD.bazel comment, corrected a factual error. It claimed local = True "does NOT bypass result caching". It does: local is the union of no-sandbox, no-remote-exec, and no-cache. That same misconception is what kept byoo-otel-collector recompiling on every CI run instead of hitting the remote cache. Only the comment changed here; the target's tags are untouched.

Customer Release Notes

Not customer visible.

Testing

All six probe scripts pass bash -n. The behavior change is fail-safe by construction: previously an unset host produced a probe against a dead endpoint, now it produces a local-only build.

Notes

Not included, deliberately. This branch originally also synced every subtree .bazelversion to the root's 9.1.1. Local validation showed that is a migration, not a file edit, so it was dropped:

  • nats-auth-callout (Go) on 9.1.1: name 'sh_test' is not defined. Bazel 9 removed sh_test from the built-in globals; it needs an explicit load() plus a rules_shell dependency.
  • ratelimiter (Rust) on 9.1.1: protoc version does not match protobuf Bazel module.

Two of two sampled subtrees fail, for two different reasons, so converging the 15 subtrees currently on 8.6.0 up to the root's 9.1.1 needs per-subtree work and belongs in its own tracked effort. The separate float bug (four worker subtrees carrying no .bazelversion at all, so their release builds resolve whatever bazelisk considers latest) is fixed in #433.

References

Follows the root-level cleanup in #399.

Related Merge Requests/Pull Requests

#433 (pins the four worker subtrees that ship no .bazelversion).

Dependencies

None.

Summary by CodeRabbit

  • Bug Fixes

    • Remote caching is now disabled unless remote caching is explicitly enabled with both the remote-cache setting and a configured host (no host defaulting).
    • Removed the previous hardcoded remote-cache endpoint.
    • Tightened TLS enablement: remote cache requires a readable CA PEM; otherwise it falls back to local-only.
    • Updated remote-cache enablement/tls messaging and caching documentation.
  • Tests

    • Added a CI test that validates all .bazel-remote-probe scripts across host/TLS/CA scenarios and asserts the resulting BAZEL_REMOTE_FLAGS.

The internal Buildbarn host was retired, but it was still referenced in nine
files. The per-service .bazel-remote-probe scripts defaulted
NVCF_BAZEL_REMOTE_HOST to it, so an unset variable pointed the probe at a dead
host rather than cleanly disabling the cache.

- Probe scripts (6): no default host. An unset NVCF_BAZEL_REMOTE_HOST now
  disables the cache and builds local-only, which is the safe fallback the
  scripts already document. No new endpoint is hardcoded in its place; the
  caller supplies it, matching the root .bazelrc.
- nvsnap/.bazelrc: drop the dead endpoint from the :remote profile; the
  profile keeps only policy and tuning flags.
- byoo README, grpc-proxy geo BUILD.bazel: comment references.

While in the geo BUILD.bazel comment, corrected a factual error: it claimed
 does NOT bypass result caching. It does.  is the union
of no-sandbox, no-remote-exec and no-cache. The same misconception is what
kept byoo-otel-collector recompiling on every CI run.

Co-authored-by: Balaji Ganesan <bganesan@nvidia.com>
@balajinvda
balajinvda requested review from a team as code owners July 25, 2026 00:07
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7885d943-bcdd-4eef-966b-ec16351cfd39

📥 Commits

Reviewing files that changed from the base of the PR and between d9f3b96 and 4cef9a0.

📒 Files selected for processing (7)
  • src/compute-plane-services/ess-agent/scripts/.bazel-remote-probe
  • src/compute-plane-services/nvca/scripts/.bazel-remote-probe
  • src/control-plane-services/function-autoscaler/scripts/.bazel-remote-probe
  • src/control-plane-services/helm-reval/scripts/.bazel-remote-probe
  • src/invocation-plane-services/http-invocation/scripts/.bazel-remote-probe
  • src/invocation-plane-services/llm-api-gateway/scripts/.bazel-remote-probe
  • tools/ci/test-bazel-remote-probe
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/invocation-plane-services/llm-api-gateway/scripts/.bazel-remote-probe
  • src/invocation-plane-services/http-invocation/scripts/.bazel-remote-probe
  • src/compute-plane-services/nvca/scripts/.bazel-remote-probe
  • src/compute-plane-services/ess-agent/scripts/.bazel-remote-probe
  • src/control-plane-services/helm-reval/scripts/.bazel-remote-probe
  • src/control-plane-services/function-autoscaler/scripts/.bazel-remote-probe

📝 Walkthrough

Walkthrough

Remote-cache probes across service components now require an explicit host alongside the enable flag. The hardcoded nvsnap endpoint was removed, Bazel cache behavior documentation was updated, and a CI test validates probe behavior across configured and disabled scenarios.

Changes

Remote Cache Configuration

Layer / File(s) Summary
Require explicit remote cache hosts
src/compute-plane-services/*/.bazel-remote-probe, src/control-plane-services/*/.bazel-remote-probe, src/invocation-plane-services/*/.bazel-remote-probe
Probe scripts disable remote caching when the enable flag or host is absent, remove the default host, and preserve port, TLS, CA, and capability probing behavior.
Validate probe enablement scenarios
tools/ci/test-bazel-remote-probe
A sanitized CI test stubs grpcurl, discovers all probes, and checks disabled, enabled, and missing-CA scenarios.
Update Bazel cache policy documentation
src/compute-plane-services/nvsnap/.bazelrc, src/invocation-plane-services/grpc-proxy/proxy/geo/BUILD.bazel
The nvsnap configuration no longer defines a remote endpoint, and geo test comments document updated Bazel local execution and cache semantics.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: famousdirector

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits and accurately summarizes the main Bazel remote-cache cleanup.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/sync-bazelversion-drop-nvcfbarn

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/compute-plane-services/ess-agent/scripts/.bazel-remote-probe`:
- Around line 20-31: Add a reusable source-level behavioral test with a stubbed
grpcurl that exercises the shared remote-cache gate for an unset host, disabled
remote caching, and a configured host, then run it against all six
.bazel-remote-probe scripts:
src/compute-plane-services/ess-agent/scripts/.bazel-remote-probe (20-31),
src/compute-plane-services/nvca/scripts/.bazel-remote-probe (19-29),
src/control-plane-services/function-autoscaler/scripts/.bazel-remote-probe
(20-31), src/control-plane-services/helm-reval/scripts/.bazel-remote-probe
(18-29),
src/invocation-plane-services/http-invocation/scripts/.bazel-remote-probe
(20-31), and
src/invocation-plane-services/llm-api-gateway/scripts/.bazel-remote-probe
(20-31). Verify each probe’s host and remote-enabled gate produces the expected
behavior, and run the repository-native test runner.</code>

In `@src/invocation-plane-services/grpc-proxy/proxy/geo/BUILD.bazel`:
- Around line 77-80: Correct the comment describing local = True in the relevant
Bazel test configuration: state that it forces local unsandboxed execution and
disables remote execution, but does not disable all caching. Keep the
explanation that the external tag prevents Bazel from reusing cached test
results, and retain the requires-docker note.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5a518dbf-60c3-427f-9e52-5eac44c08098

📥 Commits

Reviewing files that changed from the base of the PR and between a5c5060 and 5ce357c.

📒 Files selected for processing (9)
  • src/compute-plane-services/byoo-otel-collector/README.md
  • src/compute-plane-services/ess-agent/scripts/.bazel-remote-probe
  • src/compute-plane-services/nvca/scripts/.bazel-remote-probe
  • src/compute-plane-services/nvsnap/.bazelrc
  • src/control-plane-services/function-autoscaler/scripts/.bazel-remote-probe
  • src/control-plane-services/helm-reval/scripts/.bazel-remote-probe
  • src/invocation-plane-services/grpc-proxy/proxy/geo/BUILD.bazel
  • src/invocation-plane-services/http-invocation/scripts/.bazel-remote-probe
  • src/invocation-plane-services/llm-api-gateway/scripts/.bazel-remote-probe

Comment thread src/compute-plane-services/ess-agent/scripts/.bazel-remote-probe
Comment thread src/invocation-plane-services/grpc-proxy/proxy/geo/BUILD.bazel Outdated
The byoo-otel-collector subtree has a version gate that requires bumping its
VERSION file whenever ANY file under the subtree changes, with no exemption
for documentation. Bumping the collector's version to fix a one-word comment
would cut a spurious release, so leave that reference for the next byoo change
that bumps VERSION for a real reason.

All functional references are still removed; the remaining one is a single
prose mention in a README.

Co-authored-by: Balaji Ganesan <bganesan@nvidia.com>
Two review findings.

Behavioral tests. bash -n only checks syntax, and this PR changed what the
probes decide, not just how they parse. Add tools/ci/test-bazel-remote-probe:
it sources every subtree probe with a stubbed grpcurl (no network) and asserts
the enable/disable decision across four cases: host unset, remote explicitly
off, host configured, and TLS requested without a CA pem. Six probes, four
cases each.

The host-unset case deliberately sets NVCF_BAZEL_REMOTE_TLS=0. Without that it
was vacuous: with TLS on, an unset CA pem also disables the cache, so the case
passed even with the old default host restored. Verified by reintroducing the
old default on one probe, confirming the test then fails, and restoring it.

Comment accuracy. The geo BUILD.bazel comment equated  with
disabling all caching. Measured on Bazel 9.1.1 with a scratch workspace: a
 genrule re-executes after a clean against a warm disk cache
while an otherwise identical no-sandbox + no-remote-exec genrule reports a disk
cache hit. So  does stop disk/remote reuse, but it is not a blanket
no-cache: the  tag is what prevents reusing a cached test result.
Comment now says exactly that.

Co-authored-by: Balaji Ganesan <bganesan@nvidia.com>
@balajinvda
balajinvda requested a review from a team as a code owner July 25, 2026 16:02
balajinvda added a commit that referenced this pull request Jul 25, 2026
The README still described the genrule as using local = True and claimed
remote-cache reuse via the decommissioned internal cache. Both are now wrong:
the tags are no-sandbox + no-remote-exec, the action is cache-eligible, and the
host Go toolchain is bound into the action key via --action_env so a compiler
bump cannot serve stale binaries.

VERSION 0.157.0 -> 0.157.1. The subtree has a gate requiring a VERSION bump
whenever any file under it changes, and this PR necessarily changes
otelcol/BUILD.bazel. Patch-level only, so the major/minor stays in lockstep
with the collector version in otel-collector-build.yaml, which the gate also
cross-checks. The produced binary is unchanged in content; only how it is
built and cached changes.

This also clears the last reference to the retired cache host, which #435 had
to leave in place precisely because that PR could not justify a VERSION bump
for a comment-only edit.

Co-authored-by: Balaji Ganesan <bganesan@nvidia.com>

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tools/ci/test-bazel-remote-probe`:
- Around line 31-35: Update the probe execution in the test script so
source/runtime failures are not suppressed: remove the unconditional success
fallback and preserve the command’s non-zero exit status while retaining the
intentional empty-output behavior for disabled configurations. Ensure check()
can distinguish a failed probe from a valid disabled result and reports the
failure.
- Around line 69-77: Add probe coverage in the test script for both CA-path
branches: add a readable CA with TLS enabled and assert the output includes the
corresponding --tls_certificate flag, then add a configured but nonexistent CA
path and assert the probe is disabled. Keep the existing tls-no-ca case and use
the established check/probe conventions and environment variables.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5889ab5f-8610-48c3-9178-41cbc9c3247c

📥 Commits

Reviewing files that changed from the base of the PR and between 5ce357c and d9f3b96.

📒 Files selected for processing (2)
  • src/invocation-plane-services/grpc-proxy/proxy/geo/BUILD.bazel
  • tools/ci/test-bazel-remote-probe
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/invocation-plane-services/grpc-proxy/proxy/geo/BUILD.bazel

Comment thread tools/ci/test-bazel-remote-probe Outdated
Comment thread tools/ci/test-bazel-remote-probe
Two review findings, and the first exposed a real defect in the probes.

The test discarded stderr and forced success, so a probe that CRASHED was
indistinguishable from one that deliberately disabled the cache, and every
disabled-case assertion would pass on a broken script. It now captures the exit
status separately and fails on any non-zero exit, printing the probe's stderr.

That immediately surfaced a bug: the probes guarded the TLS path with
-z BAZEL_REMOTE_CA_PEM, which only catches an unset variable. A variable set to
a path that does not exist fell through to the  below and failed the job
instead of cleanly declining the cache. The guard is now -r, covering unset and
unreadable alike, and the message reports the offending path.

Added the two missing cases: TLS with a readable CA pem (the success path that
emits --tls_certificate, previously uncovered, asserted to produce both grpcs://
and the certificate flag so a silent downgrade to plaintext cannot pass), and
TLS with an unreadable CA path. Six probes, six cases.

Every assertion is backed by a negative control, each verified to fail when the
defect is reintroduced: dead default host restored, CA guard reverted to -z,
TLS downgraded to plaintext, and a probe that exits non-zero.

Co-authored-by: Balaji Ganesan <bganesan@nvidia.com>
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.

1 participant