mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-18 05:39:50 +08:00
Without a per-arch SCCACHE_GHA_VERSION, both matrix jobs (linux-amd64-cpu8 and linux-arm64-cpu8) target the same GHA cache key. Run 1 on 2026-04-24 showed this concretely: arm64 started first and landed 575/1064 cache writes; amd64 started ~1 min later and every one of its 1062 writes failed, leaving the cache with no amd64 entries at all. Partitioning by matrix.runner ensures each arch gets its own cache namespace, letting us see real warm-cache behavior on the subsequent Run 2-4 dispatches. Signed-off-by: Jonas Toelke <jtoelke@nvidia.com>
74 lines
2.6 KiB
YAML
74 lines
2.6 KiB
YAML
name: Shadow — Shared CPU Spike
|
||
|
||
# OS-49 Phase 2 / PR 1 — non-blocking spike. Runs `cargo check` on the
|
||
# nv-gha-runners shared CPU pool (`linux-{amd64,arm64}-cpu8`) with a
|
||
# GHA-backed sccache.
|
||
#
|
||
# Plan, decision thresholds, and results live in the Linear doc attached
|
||
# to OS-126 ("OS-126 — Shared CPU spike plan & results"). Dispatch this
|
||
# workflow 4–5 times after merge and record numbers there.
|
||
|
||
on:
|
||
workflow_dispatch:
|
||
|
||
permissions:
|
||
contents: read
|
||
packages: read
|
||
|
||
env:
|
||
CARGO_TERM_COLOR: always
|
||
CARGO_INCREMENTAL: "0"
|
||
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||
# Wire sccache (already RUSTC_WRAPPER in mise.toml) to the GHA cache
|
||
# backend instead of the EKS memcached used by ARC.
|
||
SCCACHE_GHA_ENABLED: "true"
|
||
|
||
jobs:
|
||
rust-check:
|
||
name: cargo check (${{ matrix.runner }})
|
||
strategy:
|
||
fail-fast: false
|
||
matrix:
|
||
runner: [linux-amd64-cpu8, linux-arm64-cpu8]
|
||
runs-on: ${{ matrix.runner }}
|
||
env:
|
||
# Partition the GHA sccache cache per-arch. Without this, matrix jobs
|
||
# collide on the same cache key, and the later-starting job's writes
|
||
# fail with 409 Conflict while the earlier one's writes land — leaving
|
||
# subsequent runs with asymmetric and mostly-empty caches.
|
||
# (Run 1 on 2026-04-24 showed amd64 with 0/1062 writes succeeding
|
||
# while arm64 got 575/1064.)
|
||
SCCACHE_GHA_VERSION: ${{ matrix.runner }}
|
||
container:
|
||
image: ghcr.io/nvidia/openshell/ci:latest
|
||
credentials:
|
||
username: ${{ github.actor }}
|
||
password: ${{ secrets.GITHUB_TOKEN }}
|
||
timeout-minutes: 60
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- name: Install tools
|
||
run: mise install
|
||
|
||
- name: Configure GHA sccache backend
|
||
# Exposes ACTIONS_CACHE_URL / ACTIONS_RUNTIME_TOKEN to subsequent steps
|
||
# so sccache (wrapped around rustc via RUSTC_WRAPPER in mise.toml) can
|
||
# initialize the GHA cache. Without this, sccache fails at startup with
|
||
# "cache url for ghac not found". The action also installs its own
|
||
# sccache binary; harmless since mise's sccache remains on PATH.
|
||
uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
|
||
|
||
- name: Cache Rust target and registry
|
||
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
|
||
with:
|
||
shared-key: shadow-shared-cpu-spike-${{ matrix.runner }}
|
||
cache-directories: .cache/sccache
|
||
|
||
- name: cargo check
|
||
run: mise x -- cargo check --workspace --all-targets
|
||
|
||
- name: sccache stats
|
||
if: always()
|
||
run: mise x -- sccache --show-stats
|