fix: run infer-bazel-targets on namespace - #10896
Draft
basvandijk wants to merge 7 commits into
Draft
Conversation
Collaborator
Author
|
Maybe the stability issues are not caused by the runner, because this
|
basvandijk
marked this pull request as draft
July 24, 2026 12:15
Previously targets.py captured bazel's stderr and only printed it when the query failed. This swallowed all diagnostics of a *slow* query: in particular the remote downloader's deadline-exceeded retries and local-fallback warnings, which made the infer-bazel-targets job look completely idle while it was grinding through stuck fetches. Now only stdout (the resulting targets) is captured; stderr streams to the job log in real time. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…o contents cache
The custom repository rules in bazel/mainnet-icos-images.bzl and
bazel/mainnet-canisters.bzl never returned repo metadata, so Bazel 9's
repo contents cache ({repository_cache}/contents) refused to store them:
every fresh output base re-downloaded the 2.4-3.2 GB SetupOS/GuestOS
images (~17 GB across the 8 image repos) and the canister WASMs, even on
machines with a fully warm repository cache. This is a major contributor
to the instability of the infer-bazel-targets CI job, whose
rdeps(//..., ...) query forces fetching these repos on every run.
Both rules are reproducible - all downloads are sha256-pinned and the
remaining outputs are derived from the watched revisions JSON and rule
attributes - so declare exactly that by returning
repository_ctx.repo_metadata(reproducible = True).
Verified empirically with a fresh --repository_cache: the first fetch of
@mainnet_latest_hostos_images downloads 2.5 GB in ~59s and populates the
contents cache; a second fetch from a different output base sharing that
cache completes in ~9s with zero network traffic, external/<repo> being
a symlink into the contents cache. Same result for @mainnet_canisters.
Also enable --experimental_repository_cache_hardlinks so repository-cache
hits hardlink instead of copy, saving one on-disk copy per multi-GB blob.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
infer-bazel-targets, which runs onubuntu-latestis very unstable (example) and often very slow. This switches the job to run on Namespace (on the same runner profile which is going to be used for running our bazel build and test invocations) which runs the job in under 2 minutes.These were the resources used when running

infer-bazel-targetson the Namespace runner:We could potentially go one class below to 8x16 but considering the RBE setup is using 16x32 for the driver and 16x32 for the RBE workers to I rather use 16x32 for
infer-bazel-targetsas well to keep things simple and consistent for now. We can always lower it later if needed.