Skip to content

ci: reuse apt downloads in scoped Linux plugin builds - #1335

Merged
zackees merged 6 commits into
masterfrom
infra/1286-scoped-apt-reuse
Oct 17, 2026
Merged

zackees merged 6 commits into
masterfrom
infra/1286-scoped-apt-reuse

Conversation

@zackees

@zackees zackees commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Refs #1286.

Measured problem

The first plugin warm PR had 41/41 compiler hits but still took 169 s (70 s target step) versus 153 s / 57 s cold. Apt downloaded 147 MB in 30 s, masking the compiler benefit.

We tested sharing the existing container archive. Its first restore hit downloaded 337 MB but apt still fetched 147 MB. A workspace-layout normalization then made 563 .debs available, yet apt still needed 142 MB: only about 5 MB of the host requirement matched. That run took 145 s / 46 s with 41 hits, but network conditions differ and the large shared archive is not justified by those small package savings. Both attempts are preserved in commit history and audit evidence; they are superseded at HEAD.

Current implementation

Use a host-specific workspace-relative .targets-apt/*.deb archive. Apt installs consume that exact directory and retain downloaded packages. PRs and merge groups restore only; selected trusted master pushes save fresh commit-keyed snapshots, avoiding a permanently frozen package set. The declared targets-apt family is bounded to 200 MB LRU (actual host downloads ~147 MB). No container cache paths, extra container dependency payload, or new workflow file. The existing Tier 2 cache stays unchanged.

Developer-note changes select linux-v4l2 so real CI validates installation and reports usable/retained package counts. Ten focused apt/cache/stdlib/uv checks pass. Live master seeding and later PR download/runtime benefit still need verification; no net apt-cache speedup is claimed yet. Compiler reuse itself is already 41/41.

@zackees
zackees enabled auto-merge October 17, 2026 20:08
@zackees
zackees added this pull request to the merge queue Oct 17, 2026
@zackees
zackees removed this pull request from the merge queue due to a manual request Oct 17, 2026
@zackees

zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member Author

First live result found an archive HIT without usable apt reuse: 337 MB restored, then 147 MB downloaded again. Automatic merge has been disabled and the PR dequeued. Actions toolkit resolvePaths stores paths relative to GITHUB_WORKSPACE; the container /__w/repo/repo and hosted /home/runner/work/repo/repo differ in depth. Added a real local tar reproduction and package-only normalization into the real apt directory, plus archive-count diagnostics and the existing docker-clean safeguard. Thirteen focused tests pass; next CI run must show actual retained packages and reduced downloads before requeueing.

@zackees
zackees added this pull request to the merge queue Oct 17, 2026
@zackees

zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member Author

Current HEAD passes CI. Live host-archive cold run 39066443172 / job 117495175835 starts with zero packages, retains 323 .debs totaling 142 MiB, and records 41/41 compiler hits. Retention is below the 200 MiB declared family bound. Re-enabled normal auto-merge so trusted master can seed this exact host package set. Subsequent warm download/runtime validation remains under #1286; the failed shared-container experiments are superseded and not claimed as useful.

Merged via the queue into master with commit d1acae0 Oct 17, 2026
22 checks passed
@zackees
zackees deleted the infra/1286-scoped-apt-reuse branch October 26, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant