feat(ebpf): Build minimized BTFs natively with Bazel #61206
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.42) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 337 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.348
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #61206"
general
weight: 0.35
chouquette
What does this PR do?
Builds
minimized-btfs.tar.xzwith Bazel instead of the invoke task, the S3-processed BTFHub archive and the btf-gen image.corereloextracts one stub ELF holding only the.BTFand CO-RE relocation records of the system-probe objects, so minimization reruns only when relocations change, not on every eBPF edit.btfhub_archivelists the pinnedDataDog/btfhub-archivecommit (tracked by Renovate) and splits each arch's kernels into 64 buckets; a BTFHub bump reruns only the buckets that changed.//pkg/ebpf:minimized_btfsrunsbpftool gen min_core_btfper bucket and packs a deterministic tarball.//pkg/ebpf:minimized_btfs_testchecks the stub minimizes 12 pinned kernels exactly like the real objects. Both need GitHub, so they aremanual.generate_minimized_btfs_{x64,arm64}now run those targets on the Bazel runners. Job names and the artifact are unchanged, so package, installer and KMT jobs consume it as before.--//bazel/rules/ebpf:package_minimized_btfs(off by default) maps the tarball into the Bazel system-probe install tree.<details>
<summary>Functional changes</summary>
| Before | After |
| --- | --- |
|
generate_minimized_btfs_waited forbuild_system-probeandbuild_processed_btfhub_archive| They start immediately and build the same CO-RE objects themselves || Unchanged eBPF objects and BTFHub reused an S3 tarball; any change re-minimized every kernel | The Bazel remote cache reuses per-bucket results; only changed relocations or BTFHub buckets rerun |
| Release branches were meant to skip the S3 cache, but the regex never matched |
RUN_ALL_BUILDSand<major>.<minor>.xbranches bypass the remote cache || — |
bazel test //pkg/ebpf:minimized_btfs_testchecks stub/object equivalence on every run of the job |Unchanged: the tarball content and layout (identical to the legacy task for x86_64 and arm64), the Omnibus copy, and
bazel test //...(the new targets aremanualand the packaging flag is off).</details>
Motivation
Moves BTF minimization off the invoke task and its S3 cache so it is cached and reproducible like the rest of the Bazel build. The legacy pieces (
build_processed_btfhub_archive, invoke tasks,CI_IMAGE_BTF_GENvariables) are deleted in a follow-up once this runs green in CI.Describe how you validated your changes
//pkg/ebpf:minimized_btfson x86_64 and arm64 workspaces and compared it with the legacygenerate-minimized-btfsoutput at the same BTFHub commit: identical trees (3576 BTFs on x86_64, 1711 on arm64).minimized_btfs_testand thecorerelounit tests pass.