mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-24 19:41:18 +00:00
ci: bound Blacksmith sticky disk growth (#109934)
This commit is contained in:
committed by
GitHub
parent
e316e1c440
commit
00a64f6e95
15
.github/actions/setup-node-env/action.yml
vendored
15
.github/actions/setup-node-env/action.yml
vendored
@@ -124,12 +124,10 @@ runs:
|
||||
if: inputs.sticky-disk == 'true'
|
||||
uses: useblacksmith/stickydisk@5b350170ae4ef55b536b548ef5f5896e76a6b54f # v1.4.0
|
||||
with:
|
||||
# One stable disk per node-version. The v2 per-PR/per-manifest-hash
|
||||
# keys minted a new backing disk for every PR and dependency change
|
||||
# and saturated Blacksmith's installation-wide sticky-disk budget,
|
||||
# 429-failing every mount. Install inputs live in the runtime
|
||||
# fingerprint marker below instead of the key, so dependency changes
|
||||
# refresh this disk in place rather than allocating a new one.
|
||||
# One stable disk per Node line. The v2 per-PR/per-manifest-hash keys
|
||||
# saturated Blacksmith's installation-wide sticky-disk budget. Install
|
||||
# inputs, runner platform, and the exact Node patch live in the runtime
|
||||
# marker below, so changes refresh this disk in place.
|
||||
key: ${{ github.repository }}-node-deps-bind-v3-${{ inputs.node-version }}
|
||||
path: /var/tmp/openclaw-node-deps
|
||||
# Single semantic writer: only the designated trusted-push job may
|
||||
@@ -273,7 +271,7 @@ runs:
|
||||
# the '**/package.json' glob only sees checkout manifests. Recomputing
|
||||
# this hash any later would sweep snapshot-internal package.json files
|
||||
# into the fingerprint and permanently miss the warm path.
|
||||
DEPS_FINGERPRINT: node-${{ inputs.node-version }}-frozen-${{ inputs.frozen-lockfile }}-${{ hashFiles('**/package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml', '.npmrc', '.pnpmfile.cjs', 'pnpmfile.cjs', '.github/actions/setup-node-env/sticky-importers.sh', 'scripts/postinstall-bundled-plugins.mjs', 'scripts/preinstall-package-manager-warning.mjs', 'scripts/prepare-git-hooks.mjs') }}
|
||||
DEPS_INPUT_FINGERPRINT: frozen-${{ inputs.frozen-lockfile }}-${{ hashFiles('**/package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml', '.npmrc', '.pnpmfile.cjs', 'pnpmfile.cjs', '.github/actions/setup-node-env/sticky-importers.sh', 'scripts/postinstall-bundled-plugins.mjs', 'scripts/preinstall-package-manager-warning.mjs', 'scripts/prepare-git-hooks.mjs') }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
sticky_root=/var/tmp/openclaw-node-deps
|
||||
@@ -289,9 +287,10 @@ runs:
|
||||
exit 1
|
||||
fi
|
||||
findmnt --target "$workspace_modules"
|
||||
deps_fingerprint="os-${RUNNER_OS:?}-arch-${RUNNER_ARCH:?}-node-$(node --version)-${DEPS_INPUT_FINGERPRINT:?}"
|
||||
# zizmor: ignore[github-env] static trusted path defined in this composite action.
|
||||
echo "PNPM_CONFIG_STORE_DIR=$sticky_store" >> "$GITHUB_ENV"
|
||||
echo "OPENCLAW_STICKY_DEPS_FINGERPRINT=$DEPS_FINGERPRINT" >> "$GITHUB_ENV"
|
||||
echo "OPENCLAW_STICKY_DEPS_FINGERPRINT=$deps_fingerprint" >> "$GITHUB_ENV"
|
||||
# pnpm exec may reconcile a restored workspace before nested builds.
|
||||
# Sticky jobs already have every build tool, so invoke their Node entrypoints directly.
|
||||
echo "OPENCLAW_BUILD_ALL_NO_PNPM=1" >> "$GITHUB_ENV"
|
||||
|
||||
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@@ -1021,10 +1021,6 @@ jobs:
|
||||
# repository-global state and must never be produced by fork code.
|
||||
sticky-disk: ${{ github.event_name != 'workflow_dispatch' && github.repository == 'openclaw/openclaw' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'openclaw/openclaw') && 'true' || 'false' }}
|
||||
use-actions-cache: ${{ github.event_name != 'workflow_dispatch' && github.repository == 'openclaw/openclaw' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'openclaw/openclaw') && 'false' || 'true' }}
|
||||
# Designated dependency-snapshot writer: exactly one trusted-push job
|
||||
# per node-version key refreshes the protected disk; every other
|
||||
# sticky consumer mounts read-only.
|
||||
save-sticky-disk: "true"
|
||||
runtime-cache-sticky-disk: ${{ github.event_name != 'workflow_dispatch' && github.repository == 'openclaw/openclaw' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'openclaw/openclaw') && 'true' || 'false' }}
|
||||
save-node-compile-cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && 'true' || 'false' }}
|
||||
|
||||
@@ -1827,9 +1823,9 @@ jobs:
|
||||
# Blacksmith same-repo runs clone dependencies from a sticky disk.
|
||||
# Fork PRs must keep actions/cache: sticky snapshots are writable,
|
||||
# repository-global state and must never be produced by fork code.
|
||||
sticky-disk: ${{ github.event_name != 'workflow_dispatch' && github.repository == 'openclaw/openclaw' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'openclaw/openclaw') && 'true' || 'false' }}
|
||||
runtime-cache-sticky-disk: ${{ github.event_name != 'workflow_dispatch' && github.repository == 'openclaw/openclaw' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'openclaw/openclaw') && 'true' || 'false' }}
|
||||
use-actions-cache: ${{ github.event_name != 'workflow_dispatch' && github.repository == 'openclaw/openclaw' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'openclaw/openclaw') && 'false' || 'true' }}
|
||||
sticky-disk: ${{ (matrix.node_version == null || matrix.node_version == '24.x') && github.event_name != 'workflow_dispatch' && github.repository == 'openclaw/openclaw' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'openclaw/openclaw') && 'true' || 'false' }}
|
||||
runtime-cache-sticky-disk: ${{ (matrix.node_version == null || matrix.node_version == '24.x') && github.event_name != 'workflow_dispatch' && github.repository == 'openclaw/openclaw' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'openclaw/openclaw') && 'true' || 'false' }}
|
||||
use-actions-cache: ${{ (matrix.node_version == null || matrix.node_version == '24.x') && github.event_name != 'workflow_dispatch' && github.repository == 'openclaw/openclaw' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'openclaw/openclaw') && 'false' || 'true' }}
|
||||
vitest-fs-cache: "true"
|
||||
node-compile-cache: "true"
|
||||
node-compile-cache-scope: "test"
|
||||
|
||||
25
.github/workflows/vitest-cache-warm.yml
vendored
25
.github/workflows/vitest-cache-warm.yml
vendored
@@ -5,6 +5,10 @@ on:
|
||||
types: [vitest-cache-warm]
|
||||
schedule:
|
||||
- cron: "17 8 * * *"
|
||||
workflow_run: # zizmor: ignore[dangerous-triggers] successful main-push CI only; read-only default-branch checkout, no artifacts or untrusted ref
|
||||
workflows: [CI]
|
||||
branches: [main]
|
||||
types: [completed]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -15,7 +19,7 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
warm:
|
||||
if: github.repository == 'openclaw/openclaw'
|
||||
if: github.repository == 'openclaw/openclaw' && (github.event_name != 'workflow_run' || (github.event.workflow_run.event == 'push' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main'))
|
||||
runs-on: blacksmith-8vcpu-ubuntu-2404
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
@@ -26,21 +30,21 @@ jobs:
|
||||
uses: ./.github/actions/setup-node-env
|
||||
with:
|
||||
install-bun: "false"
|
||||
node-compile-cache: "true"
|
||||
node-compile-cache: ${{ github.event_name != 'workflow_run' && 'true' || 'false' }}
|
||||
node-compile-cache-scope: "test"
|
||||
runtime-cache-sticky-disk: "true"
|
||||
save-node-compile-cache: "true"
|
||||
# Daily deadline writer for the protected dependency snapshot:
|
||||
# canonical main pushes cancel each other under merge traffic, so
|
||||
# build-artifacts commits can starve; this scheduled run cannot be
|
||||
# superseded and keeps the snapshot within a day of main.
|
||||
runtime-cache-sticky-disk: ${{ github.event_name != 'workflow_run' && 'true' || 'false' }}
|
||||
save-node-compile-cache: ${{ github.event_name != 'workflow_run' && 'true' || 'false' }}
|
||||
# This disposable, non-cancelled workflow is the sole dependency
|
||||
# snapshot writer. Main CI completion coalesces refreshes without
|
||||
# putting required build jobs in a cancel-on-pending mutex.
|
||||
save-sticky-disk: "true"
|
||||
save-vitest-fs-cache: "true"
|
||||
save-vitest-fs-cache: ${{ github.event_name != 'workflow_run' && 'true' || 'false' }}
|
||||
sticky-disk: "true"
|
||||
use-actions-cache: "false"
|
||||
vitest-fs-cache: "true"
|
||||
vitest-fs-cache: ${{ github.event_name != 'workflow_run' && 'true' || 'false' }}
|
||||
|
||||
- name: Select broad cache seed
|
||||
if: github.event_name != 'workflow_run'
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
@@ -68,4 +72,5 @@ jobs:
|
||||
EOF
|
||||
|
||||
- name: Warm transform and compile caches
|
||||
if: github.event_name != 'workflow_run'
|
||||
run: node scripts/ci-run-node-test-shard.mjs
|
||||
|
||||
Reference in New Issue
Block a user