Repository navigation
fix(ci): split mesh/shell-station in natives-build and cache Rust/Zig targets - #8863
Merged
Merged
Conversation
… targets When a Rust dependency revision changes (such as bumping noq-proto or iroh in #8847), natives-build previously packed shell-station, mesh, and Linux readers for each target onto a single 4-core ubuntu-24.04 VM. Compiling two independent 200-crate iroh trees simultaneously exceeded the 5-minute with-timeout.sh budget, while mesh had no Cargo target cache, native-cargo-reg-v1 was shadowed by a 1 MB launcher cache, and win32-x64 did not cache ~/.cache/zig. - Split shell-station and mesh into separate natives-build matrix VMs when both or sibling parts are missing, and defer Linux reader/pion-reader builds to a stage-2 natives-linux-readers matrix job whenever shell-station for that target is rebuilt (readers stay in natives-build when shell-station is already prebuilt). - Accept per-slot R2 manifests (-shell, -mesh, -other, -readers) in scripts/native-handoff.mjs and cover them in test/native-handoff-direct.test.ts. - Separate Cargo registry caches by crate family (client/mesh/other) so heavy crates fall back to check-rust-ubuntu-24.04-{client,mesh}- instead of a 1 MB launcher cache. - Cache ~/.cache/zig for non-reader Linux/Windows zigbuild jobs and cache both shell-station and mesh Cargo targets keyed by RUST_TOOLCHAIN and Cargo.lock with prefix restore fallback (saving partial target caches only on main under a distinct partial key so exact lockfile keys stay complete). Co-authored-by: zuozijian <zuozijian@cue.surf>
- Download split natives-<target>*-<sha> receipt artifacts (flattening subdirs) in pion-station.yml, pion-station-main.yml, and preview.yml so downstream workflows find shell-station/mesh/reader receipts after slot splitting.
- Match check-rust cache paths (~/.cargo/registry and ~/.cargo/git) so native-cargo-reg-v2-{client,mesh}- actually fall back to warm check-rust-ubuntu-24.04-{client,mesh}- caches.
- Key native-zig-cache-v1 by target and slot so shell and mesh slots do not race on one shared key.
- Drop the 'partial-' prefix from main timeout target-cache keys so cache_prune.mbt assigns partial and full keys the same rolling kind, raise main's save budget to JOB_END - 45, and guard Cargo target saves with a >= 35 s remaining-time check.
- Depend natives-win-reader, natives-win-reader-main, and natives-harness directly on natives-build so they run in parallel with natives-linux-readers.
Co-authored-by: zuozijian <zuozijian@cue.surf>
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.
Root Cause
When a shared Rust dependency revision changes (e.g. bumping
noq-protoin #8847),natives-buildhit four compounding bottlenecks inside its 5-minute job cap:planpackedshell-station,mesh, and Linuxreader/pion-readerfor each target onto one 4-coreubuntu-24.04VM, forcing two independent 200-crateirohRust builds to fight over 4 cores (~370–400 s cold vs. 241 s budget).meshCargo target cache:station/native/meshhad no Actions cache at all, andnative-shell-cargo-v1did not include the RustTOOLCHAINversion in its key.native-cargo-reg-v1-*matched a 1 MBlaunchercache before falling back tocheck-rust-ubuntu-24.04-client-(86 MB) /check-rust-ubuntu-24.04-mesh-(79 MB), re-downloading 200+ crates and git repos on every miss.~/.cache/zigwas only cached whenreader:was in the job, forcingwin32-x64shell-station/meshto rebuild mingw-w64libc/compiler_rtfrom scratch.Changes
.github/workflows/pipeline.yml:shell-stationandmeshinto dedicatednatives-buildmatrix slots (shell,mesh,other) when sibling parts are present; keep single-VMdefaultslot unchanged when only one independent part or readers run.natives-linux-readersmatrix job (reusing*hosted-reader-steps) whenshell-stationfor a Linux target is rebuilt in the same run; aggregate both innativesand includenatives-linux-readersingate.native-cargo-reg-v2-{client,mesh,other}-), addnative-zig-cache-v1-<target>-, and cache bothnative-shell-cargo-v2andnative-mesh-cargo-v2keyed byRUST_TOOLCHAIN+Cargo.lockwith prefix fallback (main-only partial saves use a distinctpartial-<run_id>-<attempt>key so exact lockfile keys are never polluted)..github/actions/setup-native-linux/action.yml: exportRUST_TOOLCHAINfromscripts/native.ts.scripts/native-handoff.mjs&test/native-handoff-direct.test.ts: accept-shell,-mesh,-other, and-readersR2 manifest filenames and test restore + unknown-slot filtering..github/AGENTS.md: update Linuxnatives-build/natives-linux-readersdocumentation.Verification
python3 scripts/ci-timeouts.pypassed.node --test test/native-handoff-direct.test.ts test/native-missing-plan.test.ts(19/19 passed).set -euo pipefailacrossempty,reader-only,mesh-only,mesh+reader, and full#8847missing lists.Model: gemini-4-neon · Test frameworks: node:test, scripts/ci-timeouts.py
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.