[P4RT] Route pinned GitHub downloads through wget hook - #29289
Conversation
Bazel fetches external repositories without using SONiC web version control. Prefetch the pinned gRPC and googleapis archives with wget and provide them through a distdir. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Lun Yue <17232861+lunyue-ms@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
🟡 Changes recommended
The new prefetch logic should improve failure diagnostics and make EXIT cleanup best-effort to avoid masking original build failures and leaving behind temporary state.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adjusts the sonic-p4rt build flow so Bazel consumes pinned GitHub archives via a local --distdir that is populated using SONiC’s wget build hook, ensuring web version-control can record/mirror the downloads and reducing exposure to upstream rate limiting.
Changes:
- Add a Bazel distdir (
bazel-distdir) and always pass it via--distdir=.... - Prefetch the pinned
grpcandgoogleapisGitHub zip archives viawget, verifying SHA256 before Bazel runs. - Clean up the temporary distdir on exit.
File summaries
| File | Description |
|---|---|
| src/sonic-p4rt/Makefile | Adds distdir-based prefetch + SHA verification for pinned GitHub archives and wires --distdir into Bazel invocations. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| function cleanup { | ||
| # Note: make seems to hang if Bazel is still running | ||
| cd $(CURDIR)/sonic-pins && bazel $(BAZEL_OPTS) shutdown | ||
| rm -rf $(BAZEL_DISTDIR) | ||
| } |
| grep -Fq 'url = "$(GRPC_ARCHIVE_URL)"' sonic-pins/pins_infra_deps.bzl | ||
| grep -Fq 'sha256 = "$(GRPC_ARCHIVE_SHA256)"' sonic-pins/pins_infra_deps.bzl | ||
| grep -Fq 'url = "$(GOOGLEAPIS_ARCHIVE_URL)"' sonic-pins/pins_infra_deps.bzl | ||
| grep -Fq 'sha256 = "$(GOOGLEAPIS_ARCHIVE_SHA256)"' sonic-pins/pins_infra_deps.bzl |
|
Dependency value provenance for review: P4RT pins
|
Why I did it
Bazel downloads P4RT external repositories directly and bypasses the SONiC
wgethook. This prevents the web version-control flow from recording and mirroring the pinned archives, leaving builds exposed to upstream rate limiting.Work item tracking
How I did it
wgethook.sonic-pins.--distdir.How to verify it
Build the P4RT package with a clean Bazel repository cache:
Confirm the gRPC and googleapis archives are fetched by the SONiC
wgethook and Bazel consumes them from the configured distdir.Which release branch to backport (provide reason below if selected)
Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): 39378630
Failure type: build failure
Tested branch
Test result
Description for the changelog
Route P4RT pinned GitHub archives through SONiC web version control.
Link to config_db schema for YANG module changes
N/A. No YANG or config_db schema changes.
A picture of a cute animal (not mandatory but encouraged)