fix(ci): scope the verified archive cache to ephemeral runners
The archive cache was wired into lanes that can select the persistent self-hosted pool, which keeps ~/.cache on its own layout and never needs the remote cache, and the consolidated benchmark's Windows rows restored and saved a directory they never create. Guard the cache steps with the same self-hosted exclusion as the pnpm store cache, drop them from the self-hosted standby and the manual benchmark matrix, and assert the guards in the workflow specs. Probe for sha256sum or shasum -a 256 so a host without either fails loudly instead of reporting a digest mismatch, clean partial downloads when a job is cancelled, keep the retry window plus its last attempt within five minutes, pin that contract in the test, and report cache-directory failures with the download URL.
This commit is contained in:
1 parent
3842f2b222
commit
5f2ff8790a
8 files changed
+171
-59
No files matched your search
@@ -177,23 +177,9 @@ jobs:
|
||||
- name: Install Playwright Chromium and WebKit
|
||||
run: pnpm --filter @deepseek-ai/dsh-web-frontend exec playwright install chromium webkit
|
||||
|
||||
- name: Restore verified bubblewrap archive
|
||||
id: bubblewrap-cache
|
||||
uses: actions/cache/[email protected]
|
||||
with:
|
||||
path: ~/.cache/dsh-ci/bubblewrap
|
||||
key: bubblewrap-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('scripts/prepare-ci-bubblewrap.sh') }}
|
||||
|
||||
- name: Prepare bubblewrap (unrestrict userns)
|
||||
run: bash scripts/prepare-ci-bubblewrap.sh
|
||||
|
||||
- name: Save verified bubblewrap archive
|
||||
if: steps.bubblewrap-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/[email protected]
|
||||
with:
|
||||
path: ~/.cache/dsh-ci/bubblewrap
|
||||
key: bubblewrap-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('scripts/prepare-ci-bubblewrap.sh') }}
|
||||
|
||||
- name: Run complete unsharded primary Node CI serially
|
||||
env:
|
||||
DSH_ARCHIVE_BASE_REF: ${{ github.event.before }}
|
||||
@@ -509,13 +495,9 @@ jobs:
|
||||
console.log(JSON.stringify({ arch: process.arch, cpus: os.cpus().length,
|
||||
memoryGiB: Math.round(os.totalmem() / 2 ** 30) }))"
|
||||
|
||||
- name: Restore verified bubblewrap archive
|
||||
id: bubblewrap-cache
|
||||
uses: actions/cache/restor[email protected]
|
||||
with:
|
||||
path: ~/.cache/dsh-ci/bubblewrap
|
||||
key: bubblewrap-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('scripts/prepare-ci-bubblewrap.sh') }}
|
||||
|
||||
# No archive cache: this manual matrix includes the persistent 64/96-core
|
||||
# fleet rows, and a `~` cache written by an ephemeral runner does not
|
||||
# restore into the preparation directory there.
|
||||
- name: Install and prepare Linux
|
||||
if: matrix.platform == 'linux'
|
||||
run: |
|
||||
@@ -530,13 +512,6 @@ jobs:
|
||||
if (( install_status != 0 )); then exit "$install_status"; fi
|
||||
exit "$sandbox_status"
|
||||
|
||||
- name: Save verified bubblewrap archive
|
||||
if: steps.bubblewrap-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/[email protected]
|
||||
with:
|
||||
path: ~/.cache/dsh-ci/bubblewrap
|
||||
key: bubblewrap-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('scripts/prepare-ci-bubblewrap.sh') }}
|
||||
|
||||
- name: Install (immutable)
|
||||
if: matrix.platform == 'windows'
|
||||
shell: pwsh
|
||||
|
||||
@@ -179,8 +179,11 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
|
||||
|
||||
# The persistent self-hosted pool keeps ~/.cache between jobs on its own
|
||||
# layout, so the archive cache follows the hosted-only pnpm store guard.
|
||||
- name: Restore verified bubblewrap archive
|
||||
id: bubblewrap-cache
|
||||
if: vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
|
||||
uses: actions/cache/[email protected]
|
||||
with:
|
||||
path: ~/.cache/dsh-ci/bubblewrap
|
||||
@@ -199,8 +202,11 @@ jobs:
|
||||
if (( install_status != 0 )); then exit "$install_status"; fi
|
||||
exit "$sandbox_status"
|
||||
|
||||
# The save step is skipped on a hit. A restored archive whose digest fails
|
||||
# is re-downloaded but not re-saved (the key already exists), so a tampered
|
||||
# entry survives until eviction; that needs deliberate cache poisoning.
|
||||
- name: Save verified bubblewrap archive
|
||||
if: steps.bubblewrap-cache.outputs.cache-hit != 'true'
|
||||
if: (vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]') && steps.bubblewrap-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/[email protected]
|
||||
with:
|
||||
path: ~/.cache/dsh-ci/bubblewrap
|
||||
@@ -420,8 +426,11 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-playwright-
|
||||
|
||||
# The persistent self-hosted pool keeps ~/.cache between jobs on its own
|
||||
# layout, so the archive cache follows the hosted-only pnpm store guard.
|
||||
- name: Restore verified bubblewrap archive
|
||||
id: bubblewrap-cache
|
||||
if: vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
|
||||
uses: actions/cache/[email protected]
|
||||
with:
|
||||
path: ~/.cache/dsh-ci/bubblewrap
|
||||
@@ -441,7 +450,7 @@ jobs:
|
||||
exit "$sandbox_status"
|
||||
|
||||
- name: Save verified bubblewrap archive
|
||||
if: steps.bubblewrap-cache.outputs.cache-hit != 'true'
|
||||
if: (vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]') && steps.bubblewrap-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/[email protected]
|
||||
with:
|
||||
path: ~/.cache/dsh-ci/bubblewrap
|
||||
@@ -560,8 +569,11 @@ jobs:
|
||||
- name: Install (immutable)
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
# The persistent self-hosted pool keeps ~/.cache between jobs on its own
|
||||
# layout, so the archive cache follows the hosted-only pnpm store guard.
|
||||
- name: Restore verified bubblewrap archive
|
||||
id: bubblewrap-cache
|
||||
if: vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
|
||||
uses: actions/cache/[email protected]
|
||||
with:
|
||||
path: ~/.cache/dsh-ci/bubblewrap
|
||||
@@ -571,7 +583,7 @@ jobs:
|
||||
run: bash scripts/prepare-ci-bubblewrap.sh
|
||||
|
||||
- name: Save verified bubblewrap archive
|
||||
if: steps.bubblewrap-cache.outputs.cache-hit != 'true'
|
||||
if: (vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]') && steps.bubblewrap-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/[email protected]
|
||||
with:
|
||||
path: ~/.cache/dsh-ci/bubblewrap
|
||||
|
||||
@@ -92,6 +92,9 @@ jobs:
|
||||
- name: Prepare bubblewrap (unrestrict userns)
|
||||
run: bash scripts/prepare-ci-bubblewrap.sh
|
||||
|
||||
# A restored archive whose digest fails is re-downloaded but not re-saved
|
||||
# (the hit key already exists), so a tampered entry survives until
|
||||
# eviction; that needs deliberate cache poisoning.
|
||||
- name: Save verified bubblewrap archive
|
||||
if: steps.bubblewrap-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/[email protected]
|
||||
|
||||
Reference in new issue
Block a user