From 01910127eca7cb9e1b8868009ccdebc11f517e6d Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Thu, 15 Oct 2026 22:23:36 -0700 Subject: [PATCH 1/4] quest: claim m0/ci/mbx-r2 Co-Authored-By: Claude Opus 5.5 From 306336f27295d2ea6bef2420457df36bc2d363fc Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Thu, 15 Oct 2026 22:34:17 -0700 Subject: [PATCH 2/4] ci: cache Rust builds in R2 through mbx's S3 backend Every job that used the Actions cache now reads the private mbx-moq-dev R2 bucket instead, and the macOS and Windows platform jobs gain a cache. Only cache.yml writes, with a key held in a `cache-write` Environment that only `main` can deploy to. It now warms x86 Linux, macOS, and Windows alongside ARM64 Linux, since the 10 GB budget no longer decides which platforms get a cache. The bucket and lifecycle rule are checked in under infra/mbx; the tokens and Environment are maintainer steps documented in infra/README.md. Co-Authored-By: Claude Opus 5.5 --- .github/actions/rust-cache/action.yml | 136 +++++++++++------- .github/workflows/cache.yml | 121 +++++++++++----- .github/workflows/check.yml | 17 ++- .github/workflows/interop.yml | 11 +- .github/workflows/nightly.yml | 20 ++- .github/workflows/obs.yml | 15 +- .github/workflows/platform.yml | 13 +- .github/workflows/release-ffi.yml | 8 +- .github/workflows/release-kt-lib.yml | 4 +- .github/workflows/release-rs.yml | 18 +-- .github/workflows/ts.yml | 3 + .github/workflows/uring.yml | 3 + .github/workflows/wasm.yml | 10 +- .github/workflows/x11.yml | 3 + infra/README.md | 64 +++++++++ infra/justfile | 1 + infra/mbx/bun.lock | 195 ++++++++++++++++++++++++++ infra/mbx/justfile | 15 ++ infra/mbx/lifecycle.json | 11 ++ infra/mbx/package.json | 7 + quest/m0/ci/README.md | 2 +- quest/m0/ci/mbx-r2-verify.md | 25 ++++ quest/m0/ci/mbx-r2.md | 34 ----- quest/m0/ci/nix-cache.md | 4 +- quest/m0/ci/platform-queue.md | 2 +- 25 files changed, 574 insertions(+), 168 deletions(-) create mode 100644 infra/mbx/bun.lock create mode 100644 infra/mbx/justfile create mode 100644 infra/mbx/lifecycle.json create mode 100644 infra/mbx/package.json create mode 100644 quest/m0/ci/mbx-r2-verify.md delete mode 100644 quest/m0/ci/mbx-r2.md diff --git a/.github/actions/rust-cache/action.yml b/.github/actions/rust-cache/action.yml index 43727027141..36c7bc650af 100644 --- a/.github/actions/rust-cache/action.yml +++ b/.github/actions/rust-cache/action.yml @@ -1,65 +1,107 @@ name: Rust cache -description: Install mbx, put its Cargo shim on PATH, and restore the build cache the default branch warms. +description: Install mbx, put its Cargo shim on PATH, and back it with the R2 build cache that `main` writes. inputs: - scope: - description: Key space for the store. A workflow that builds a different set of artifacts needs its own. - default: shared - save-on-dispatch: - description: Let a trusted workflow_dispatch seed the cache (the warming workflow only). + access-key-id: + description: R2 access key id. Empty, as for a fork pull request, builds cold. + default: "" + secret-access-key: + description: R2 secret access key matching `access-key-id`. + default: "" + write: + description: Publish compilations to the cache. Only cache.yml, holding the `cache-write` Environment's key, sets it. default: "false" runs: using: composite steps: - # The pinned action saves in a post step guarded by success(), so failed - # builds cannot publish a cache even when dispatch saving is enabled. - - uses: jdx/mr-boxington-action@7234d3dd1a6ca8f6c381eea8e4dfb03f18fcf777 # v1.3.0 + # Only the write key is a boundary: it lives in the `cache-write` + # Environment, which only `main` can deploy to, so a pull request's code + # never sees it, even from this repository. The read key is a plain repo + # secret; fork pull requests get no secrets at all and build cold. + # + # A writer without its key means the Environment is misconfigured, and + # building on would leave every reader cold with nothing to say why. + - name: Cache credentials + shell: bash + env: + KEY_ID: ${{ inputs.access-key-id }} + SECRET: ${{ inputs.secret-access-key }} + WRITE: ${{ inputs.write }} + run: | + if [ -z "$KEY_ID" ] || [ -z "$SECRET" ]; then + if [ "$WRITE" = "true" ]; then + echo "::error::write is set but the cache-write Environment supplied no R2 key" + exit 1 + fi + echo "::warning::No R2 cache credentials, as for a fork pull request; building cold" + exit 0 + fi + { + echo "AWS_ACCESS_KEY_ID=$KEY_ID" + echo "AWS_SECRET_ACCESS_KEY=$SECRET" + echo "MBX_REMOTE_S3_ENDPOINT=https://dd618f5dbd5da77b8296f1613c301f5c.r2.cloudflarestorage.com" + echo "MBX_REMOTE_S3_REGION=auto" + } >> "$GITHUB_ENV" + + # mbx keys every compilation on the compiler, target, and inputs, so one + # bucket serves every toolchain and workflow without a cache key of ours. + # The namespace splits it per runner platform anyway, so a platform's + # usage and misses can be read off its own prefix. + # + # mbx narrows itself to read-only outside a push to a protected branch, so + # `write` alone cannot publish from a pull request or the merge queue. The + # Environment above is what enforces it; mbx's check is a second guard. + - uses: jdx/mr-boxington-action@47ce49b32025d93a7a2f4570815afaa2b7092240 # v1.7.2 with: - version: 1.10.0 - # `github-cache-mode` is left at its `target` default. That transports - # Cargo's pruned target tree, the same payload Swatinem carried, with - # mbx's per-compilation store on top. The `objects` closure is portable - # across differing target directories, which nothing here needs, and - # measured slower. It transports `./target` relative to the working - # directory and ignores CARGO_TARGET_DIR, so a workflow that sets one - # has to point it there. - # - # The key is spelled out because the generated one cannot name this - # repository's compiler. It keys on `rustc -vV` from PATH, which here is - # whatever the runner image ships: the compiler these jobs build with - # exists only inside `nix develop`. The `toolchain` input is no help - # either, since it names a rustup toolchain and probes - # `rustc + -vV`, and nothing installs that channel through rustup. - # - # flake.lock pins that compiler, so hashing the flake identifies it more - # precisely than `rustc -vV` would, and rolls the cache when the dev - # shell changes. Build scripts link against Nix store paths, so a - # restored executable whose dynamic linker moved is worse than a cold - # cache. rust-toolchain.toml is in the hash because it picks the channel, - # even though it is kept in sync with the flake. - # - # Every segment the generated layout carries has to be carried here too: - # the runner pair, so a job on an x86 runner cannot restore the ARM64 - # store, and `target`, so changing `github-cache-mode` cannot - # restore the other payload. The trailing run id rolls the key on every - # run, which is what lets a repeated `workflow_dispatch` seed a cold - # cache against GitHub's immutable entries. - cache-key: ${{ runner.os }}-${{ runner.arch }}-mbx-target-${{ inputs.scope }}-${{ hashFiles('flake.nix', 'flake.lock', 'rust-toolchain.toml') }}-${{ github.run_id }}-${{ github.run_attempt }} - restore-keys: ${{ runner.os }}-${{ runner.arch }}-mbx-target-${{ inputs.scope }}-${{ hashFiles('flake.nix', 'flake.lock', 'rust-toolchain.toml') }}- - save-on-workflow-dispatch: ${{ inputs.save-on-dispatch }} + version: 1.24.0 + backend: ${{ inputs.access-key-id != '' && inputs.secret-access-key != '' && 'remote' || 'local' }} + remote-url: s3://mbx-moq-dev + namespace: ${{ runner.os }}-${{ runner.arch }} + remote-mode: ${{ inputs.write == 'true' && 'read-write' || 'read-only' }} + + # The action only warns when it cannot reach the remote, which is how a + # revoked or mistyped key would look. A cache that silently never hits + # costs every job its full build, so refuse instead. A writer also has to + # come out read-write: mbx narrows it to read-only when `main` loses its + # protection, and nothing would publish again. + - name: Check the cache + if: inputs.access-key-id != '' && inputs.secret-access-key != '' + shell: bash + env: + WRITE: ${{ inputs.write }} + run: | + report=$(mbx doctor --json || true) + remote=$(jq -r '.checks[] | select(.name == "remote") | "\(.severity): \(.detail)"' <<< "$report") + policy=$(jq -r '.checks[] | select(.name == "policy") | .detail' <<< "$report") + echo "remote: $remote" + echo "policy: $policy" + case "$remote" in + pass:*) ;; + *) echo "::error::R2 cache unusable: $remote"; exit 1 ;; + esac + if [ "$WRITE" = "true" ] && [[ "$policy" != *"effective read-write" ]]; then + echo "::error::the cache writer cannot publish: $policy" + exit 1 + fi # The shim is how mbx reaches Cargo. The action above only puts `mbx` itself # on PATH, which reaches a build that spells the wrapper out; nothing here # does, and release-plz spawns Cargo where no environment variable could. - # `mbx setup` installs a `cargo` launcher instead, and flake.nix puts its - # directory in front of the dev shell's pinned toolchain. + # `mbx setup` installs a `cargo` launcher instead. Its directory goes on + # PATH for jobs that use the runner's rustup toolchain, and flake.nix puts + # it back in front of the dev shell's pinned toolchain. # - # `--status` is the assertion, not decoration: the shim is the only thing - # routing Cargo through mbx, so a setup that quietly did nothing would build - # every job uncached and still report success. + # The shim existing is the assertion: it is the only thing routing Cargo + # through mbx, so a setup that quietly did nothing would build every job + # uncached and still report success. - name: Cargo shim shell: bash run: | mbx setup --yes - mbx setup --status + shim=$(mbx setup --status 2>/dev/null | sed -n '1s/.*: //p' || true) + if [ ! -e "$shim" ]; then + echo "::error::mbx setup installed no Cargo shim: $(mbx setup --status 2>&1)" + exit 1 + fi + echo "${shim%[/\\]*}" >> "$GITHUB_PATH" diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index 9214eb91f41..5a0c104cc4f 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -1,18 +1,18 @@ name: Cache -# Populates the Rust build cache that pull request jobs restore, and the dev +# Populates the R2 Rust build cache that every other job reads, and the dev # shell closure that every nix job substitutes. # -# Actions scopes cache reads to the current branch plus the default branch, so -# only caches written here on `main` are reachable from a pull request. This -# workflow is therefore the single trusted writer. The action refuses to publish -# from a pull request regardless. +# This is the only writer. The R2 write key lives in the `cache-write` +# Environment, whose deployment policy admits only `main`, so no pull request, +# merge queue, or dispatched run can hold it. mbx also refuses to publish from +# anything but a push to a protected branch, so a manual dispatch could not +# seed the cache either; the push that changes the toolchain warms it instead. # -# The Rust store is ARM64 only, because every job that restores it runs there. -# Each store is about 6 GB against the repository's 10 GB budget, and Actions -# evicts least recently used first, so an x86 store nobody on a pull request -# read was enough to push out the one they all do. The x86 leg still pushes its -# dev shell, which the x86 jobs substitute. +# mbx uploads each compilation it misses and nothing else, so a warm after a +# small merge compiles and publishes only what that merge changed. Every +# runner platform a pull request, the merge queue, or Nightly builds Rust on +# gets a leg, since compilations never cross platforms. # # This runs the unscoped suite rather than the diff-scoped one: the point is to # leave artifacts for whatever a future PR happens to touch, not to check `main` @@ -33,16 +33,14 @@ on: - "flake.nix" - "flake.lock" - ".github/workflows/cache.yml" - # The action pin and the cache key both live here, and either can roll - # the store. Without this the sole writer would not re-run after such a - # change, leaving every PR reader cold until something else landed. + # The mbx pin lives here, and a new mbx can change what it keys on. + # Without this the sole writer would not re-run after such a change, + # leaving every reader cold until something else landed. - ".github/actions/rust-cache/**" - # Priming a cold cache by hand, e.g. after a toolchain bump rolls the key. - workflow_dispatch: -# Queue rather than cancel. A warm takes 30-50 minutes and `main` merges more -# often than that, so cancelling meant no warm ever finished and every pull -# request restored a store hours stale. Actions keeps only the newest pending +# Queue rather than cancel. A cold warm takes 30-50 minutes and `main` merges +# more often than that, so cancelling meant no warm ever finished and every +# pull request read a cache hours stale. Actions keeps only the newest pending # run per group, so merges that land mid-warm still coalesce into one. concurrency: group: cache-${{ github.ref }} @@ -54,13 +52,10 @@ jobs: strategy: fail-fast: false matrix: - include: - - runner: ubuntu-24.04-arm - rust: true - - runner: ubuntu-latest - rust: false + runner: [ubuntu-24.04-arm, ubuntu-latest] runs-on: ${{ matrix.runner }} timeout-minutes: 60 + environment: cache-write steps: - name: Free disk space @@ -105,35 +100,89 @@ jobs: nix develop --profile /tmp/devshell --command true cachix push kixelated /tmp/devshell - # The single writer. `save-on-dispatch` is what lets the - # `workflow_dispatch` above prime a cold store; the action otherwise saves - # only on pushes to the default branch. - name: Rust cache - if: matrix.rust uses: ./.github/actions/rust-cache with: - save-on-dispatch: true + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} + write: true - # Both halves, so the saved cache carries the lint artifacts (clippy rmeta) + # Both halves, so the cache carries the lint artifacts (clippy rmeta) # and the test artifacts (codegen + linked test binaries). They share # little, and a PR usually needs both. # - # `continue-on-error` because the action saves only from a successful - # job, and the artifacts are worth saving whatever a lint or test on - # `main` says: a formatting slip or one flaky test otherwise left every - # pull request restoring a store days stale. The pull request gates are - # what report those failures. + # mbx publishes each compilation as it finishes, so a lint or test that + # fails on `main` costs nothing already built. `continue-on-error` keeps + # that failure from turning the warm red: the pull request gates are what + # report it. - name: Check - if: matrix.rust continue-on-error: true run: nix develop --command just ci check --all env: MOQ_STRICT: 1 - name: Test - if: ${{ matrix.rust && !cancelled() }} + if: ${{ !cancelled() }} continue-on-error: true run: nix develop --command just ci test --all env: MOQ_STRICT: 1 NEXTEST_PROFILE: ci + + # The Rust half of platform.yml, which the merge queue, `release`, and Nightly + # run against the runner's rustup toolchain instead of the dev shell. + platform: + name: Warm (${{ matrix.runner }}) + strategy: + fail-fast: false + matrix: + include: + - runner: macos-latest + os: macos + - runner: windows-2022 + os: windows + runs-on: ${{ matrix.runner }} + timeout-minutes: 90 + environment: cache-write + defaults: + run: + shell: bash + env: + CARGO_TARGET_DIR: ${{ github.workspace }}/target + NEXTEST_PROFILE: ci + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Install Rust + uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable + - name: Install NASM + if: matrix.os == 'windows' + shell: pwsh + run: | + choco install nasm -y --no-progress + "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + - uses: ./.github/actions/just + - name: Install nextest + uses: taiki-e/install-action@e407f7bafb71fd004bc5c2da3032e5470cbb6ef0 # v2.87.24 + with: + tool: nextest@0.9.146 + + - name: Rust cache + uses: ./.github/actions/rust-cache + with: + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} + write: true + + # The same recipes platform.yml runs, unscoped. As above, a failure here + # is the gates' to report. + - name: Compile + continue-on-error: true + run: just rs ${{ matrix.os }} --all + + - name: Test + if: ${{ !cancelled() }} + continue-on-error: true + run: just rs ${{ matrix.os }}-test diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b81f255a8c5..6516ab44755 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -71,13 +71,14 @@ jobs: - uses: DeterminateSystems/flake-checker-action@786422608c7bded2bbc9741ad9f91356842bf520 # main if: steps.scope.outputs.needed == 'true' - # cache.yml warms the default-branch store on `main`. Pull requests restore - # it; the action refuses to publish from a pull request, and Actions would - # scope such an entry to the PR's own branch anyway, where no later PR - # could read it while it ate the repository's 10 GB budget. + # Read only: cache.yml warms the R2 cache from `main`, and this job never + # holds the write key. - name: Rust cache if: steps.scope.outputs.needed == 'true' uses: ./.github/actions/rust-cache + with: + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} # The same recipe a developer runs locally. It diffs against # the merge group base SHA (or origin/$GITHUB_BASE_REF for a PR) and touches @@ -141,10 +142,13 @@ jobs: extra-substituters = https://kixelated.cachix.org extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - # Restore only, same as the `check` job above. + # Read only, same as the `check` job above. - name: Rust cache if: steps.scope.outputs.needed == 'true' uses: ./.github/actions/rust-cache + with: + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} # NEXTEST_PROFILE picks up the longer hang timeout in .config/nextest.toml; # without it a runner under load could trip the local one. @@ -196,6 +200,9 @@ jobs: - name: Rust cache if: steps.scope.outputs.needed == 'true' uses: ./.github/actions/rust-cache + with: + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} - name: Prove sensitivity if: steps.scope.outputs.needed == 'true' diff --git a/.github/workflows/interop.yml b/.github/workflows/interop.yml index 676469e81a6..c96b86f7915 100644 --- a/.github/workflows/interop.yml +++ b/.github/workflows/interop.yml @@ -70,14 +70,13 @@ jobs: extra-substituters = https://kixelated.cachix.org extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - # Reuse ~/.cargo + ./target across nightly runs so only changed crates - # recompile (the relay, cli, moq-ffi, and moq-c all build from source). + # The relay, cli, moq-ffi, and moq-c all build from source; read whatever + # compilations cache.yml's x86 warm shares with them. - name: Rust cache - uses: Swatinem/rust-cache@f0d9c3887740aee45f6153b24b3a6b815192ec16 # v2 + uses: ./.github/actions/rust-cache with: - # A pull request's entry is scoped to its own branch, where no later - # run reads it, while it spends the budget the shared store needs. - save-if: ${{ github.event_name != 'pull_request' }} + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} # Playwright's Chromium isn't in the nix devShell. Install it plus its apt # runtime libs (`--with-deps` needs the host package manager) so the diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 3b6b5606dcd..601cdc858ac 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -45,6 +45,7 @@ concurrency: jobs: x11: uses: ./.github/workflows/x11.yml + secrets: inherit # Each independent workload gets its own hour. Rust and JS benchmark groups # keep one build environment each, so splitting the feature compile does not @@ -113,11 +114,13 @@ jobs: extra-substituters = https://kixelated.cachix.org extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - # Restore only, like `tests` below. Saving its own store cost 3.6 GB of the - # repository's 10 GB budget and evicted the one every pull request restores. + # Read only, like every job but cache.yml's. - name: Rust cache if: ${{ !matrix.uncached }} uses: ./.github/actions/rust-cache + with: + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} # perf samples worker switch-outs in kernel context into a large buffer; bench-lock refuses without it. - name: Allow perf kernel sampling @@ -171,6 +174,9 @@ jobs: extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - name: Rust cache uses: ./.github/actions/rust-cache + with: + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} - name: Test run: nix develop --command just ${{ matrix.recipe }} env: @@ -180,10 +186,10 @@ jobs: # Full platform coverage without rebuilding after every main queue merge. platform: uses: ./.github/workflows/platform.yml + secrets: inherit # Plays the matrix in headless Chromium through moq-shaper and grades what the - # listener heard against test/audio-quality/budgets.json. ARM64 like wasm.yml, - # the only architecture cache.yml warms a Rust store for. + # listener heard against test/audio-quality/budgets.json. ARM64 like wasm.yml. audio-quality: name: Audio quality runs-on: ubuntu-24.04-arm @@ -206,6 +212,9 @@ jobs: extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - name: Rust cache uses: ./.github/actions/rust-cache + with: + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} # Playwright's Chromium isn't in the nix devShell; `--with-deps` installs # its apt runtime libs, and run.sh's own install then no-ops. - name: Playwright Chromium @@ -341,6 +350,9 @@ jobs: extra-substituters = https://kixelated.cachix.org extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - uses: ./.github/actions/rust-cache + with: + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} - name: Collect and compare sizes run: nix develop --command just gh size-nightly size-report "$GITHUB_RUN_ID" env: diff --git a/.github/workflows/obs.yml b/.github/workflows/obs.yml index 3d5c965894a..a02d9c523b0 100644 --- a/.github/workflows/obs.yml +++ b/.github/workflows/obs.yml @@ -116,17 +116,14 @@ jobs: extra-substituters = https://kixelated.cachix.org extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - # cache.yml warms the default-branch store on `main`. Pull requests restore - # it; the action refuses to publish from a pull request. It holds - # dev-profile artifacts, which is why `just obs ci` builds moq-ffi in debug - # rather than the preset's release. - # - # Skipped on a `main` push, where the action would save: this job builds a - # sliver of the workspace, and its entry, being newest, is the one every - # pull request then restores in place of the warmer's. + # Read only: cache.yml warms the R2 cache from `main`. It holds dev-profile + # artifacts, which is why `just obs ci` builds moq-ffi in debug rather + # than the preset's release. - name: Rust cache - if: github.ref != 'refs/heads/main' uses: ./.github/actions/rust-cache + with: + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} # The same recipe a developer runs on Linux. Warnings are errors here, via # the platform's CI preset. diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 509bb7894aa..ae774975bf8 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -75,7 +75,7 @@ jobs: if: needs.scope.outputs.rs == 'true' || needs.scope.outputs.cpp == 'true' || needs.scope.outputs.obs == 'true' # OBS uses the Visual Studio 17 2022 CMake generator. runs-on: windows-2022 - # The suites run serially without a Rust cache; the full macOS suite measured 43 min. + # The suites run serially; the full macOS suite measured 43 min without a Rust cache. timeout-minutes: 90 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -95,6 +95,12 @@ jobs: uses: taiki-e/install-action@e407f7bafb71fd004bc5c2da3032e5470cbb6ef0 # v2.87.24 with: tool: nextest@0.9.146 + # Read only: cache.yml warms these platforms from `main`. + - name: Rust cache + uses: ./.github/actions/rust-cache + with: + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} - name: Install uniffi-bindgen-cpp if: needs.scope.outputs.cpp == 'true' || needs.scope.outputs.obs == 'true' shell: bash @@ -135,6 +141,11 @@ jobs: uses: taiki-e/install-action@e407f7bafb71fd004bc5c2da3032e5470cbb6ef0 # v2.87.24 with: tool: nextest@0.9.146 + - name: Rust cache + uses: ./.github/actions/rust-cache + with: + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} - name: Install uniffi-bindgen-cpp if: needs.scope.outputs.obs == 'true' run: cargo install uniffi-bindgen-cpp --locked --git https://github.com/kixelated/uniffi-bindgen-cpp --tag v0.11.0-kixelated.4+v0.32.2 diff --git a/.github/workflows/release-ffi.yml b/.github/workflows/release-ffi.yml index 44937e13f23..a57999b86c1 100644 --- a/.github/workflows/release-ffi.yml +++ b/.github/workflows/release-ffi.yml @@ -89,8 +89,8 @@ jobs: with: targets: ${{ matrix.target }} - # No Rust cache: its entry would evict the store every pull request - # restores from the 10 GB budget. See cache.yml. + # No Rust cache: shipped binaries compile from source rather than from + # whatever the shared R2 cache holds. - name: Install cross-compilation tools (Linux ARM64) if: matrix.target == 'aarch64-unknown-linux-gnu' @@ -148,8 +148,8 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable - # No Rust cache: its entry would evict the store every pull request - # restores from the 10 GB budget. See cache.yml. + # No Rust cache: shipped binaries compile from source rather than from + # whatever the shared R2 cache holds. # Go uses a third-party generator; build.sh skips Go when it is absent. - name: Install uniffi-bindgen-go diff --git a/.github/workflows/release-kt-lib.yml b/.github/workflows/release-kt-lib.yml index 0a93b71b2aa..96ca06ece0c 100644 --- a/.github/workflows/release-kt-lib.yml +++ b/.github/workflows/release-kt-lib.yml @@ -202,8 +202,8 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable - # No Rust cache: its entry would evict the store every pull request - # restores from the 10 GB budget. See cache.yml. + # No Rust cache: shipped binaries compile from source rather than from + # whatever the shared R2 cache holds. # Generate the UniFFI Kotlin so the sibling :moq-ffi project compiles. - name: Generate bindings diff --git a/.github/workflows/release-rs.yml b/.github/workflows/release-rs.yml index de27458731d..b1ab6fb82c1 100644 --- a/.github/workflows/release-rs.yml +++ b/.github/workflows/release-rs.yml @@ -26,7 +26,7 @@ on: - "flake.lock" - ".release-plz.toml" - ".github/workflows/release-rs.yml" - # Releasing by hand, e.g. after a skipped push or a cold cache. Dispatch it + # Releasing by hand, e.g. after a skipped push. Dispatch it # on `release`; the job refuses any other ref. workflow_dispatch: @@ -42,9 +42,7 @@ jobs: # against the registry, so cargo-semver-checks would otherwise build # rustdoc for every crate, baseline and current, into a throwaway target # directory. Pin one absolute path instead so the ~30 crates share their - # dependency builds and the cache below can carry them between runs. It - # has to be this path: the cache action transports `./target` relative to - # the working directory and does not read CARGO_TARGET_DIR. + # dependency builds. CARGO_TARGET_DIR: ${{ github.workspace }}/target steps: @@ -81,12 +79,8 @@ jobs: extra-substituters = https://kixelated.cachix.org extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - # Its own scope rather than the shared store cache.yml warms: this holds - # cargo-semver-checks rustdoc, not check and test artifacts, and mixing - # the two would have each restoring a target tree built for the other. - # This workflow only runs on `release`, so it is the sole writer of its scope. - # The cache action saves push runs only on the default branch, so pushes - # here restore without saving; a dispatch on `release` refreshes it. + # Read only: cache.yml warms the R2 cache from `main`. Crates publish as + # source, so nothing this reads ends up in a release. # # The action's shim is what gets mbx in here at all. release-plz spawns # Cargo and cargo-semver-checks itself, so no environment variable reaches @@ -94,8 +88,8 @@ jobs: - name: Rust cache uses: ./.github/actions/rust-cache with: - scope: release-rs - save-on-dispatch: true + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} - name: Release run: nix develop --command just rs release diff --git a/.github/workflows/ts.yml b/.github/workflows/ts.yml index de682c95480..74d53a956dc 100644 --- a/.github/workflows/ts.yml +++ b/.github/workflows/ts.yml @@ -66,6 +66,9 @@ jobs: - name: Rust cache uses: ./.github/actions/rust-cache + with: + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} - name: FFmpeg and TSDuck controls if: ${{ !cancelled() }} diff --git a/.github/workflows/uring.yml b/.github/workflows/uring.yml index 6e0261b2248..1259a1a0122 100644 --- a/.github/workflows/uring.yml +++ b/.github/workflows/uring.yml @@ -57,6 +57,9 @@ jobs: - name: Rust cache uses: ./.github/actions/rust-cache + with: + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} - name: io_uring run: nix develop --command just rs uring-changed "$CI_BASE" diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index d28b6b076a9..c6c93e9fa3d 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -67,8 +67,8 @@ jobs: wasm: name: WASM if: github.event.action != 'closed' - # ARM64 like check.yml, the only architecture cache.yml warms a Rust store - # for; the harness builds the relay natively, which that store covers. + # ARM64 like check.yml; the harness builds the relay natively, which the + # check warm covers. runs-on: ubuntu-24.04-arm timeout-minutes: 60 @@ -92,10 +92,12 @@ jobs: extra-substituters = https://kixelated.cachix.org extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - # cache.yml warms the default-branch store on `main`. Pull requests restore - # it; the action refuses to publish from a pull request. + # Read only: cache.yml warms the R2 cache from `main`. - name: Rust cache uses: ./.github/actions/rust-cache + with: + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} # Playwright's Chromium isn't in the nix devShell. Install it plus its apt # runtime libs (`--with-deps` needs the host package manager); run.sh's own diff --git a/.github/workflows/x11.yml b/.github/workflows/x11.yml index 3fa2200c924..7e34573b125 100644 --- a/.github/workflows/x11.yml +++ b/.github/workflows/x11.yml @@ -40,6 +40,9 @@ jobs: extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - name: Rust cache uses: ./.github/actions/rust-cache + with: + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} - name: Capture comparison run: nix develop --command just rs x11-bench-ci env: diff --git a/infra/README.md b/infra/README.md index dba5cb5e3aa..67cd13b429f 100644 --- a/infra/README.md +++ b/infra/README.md @@ -8,12 +8,15 @@ infrastructure. | `infra/apt` | `apt.moq.dev` | `apt-moq-dev` | Debian/Ubuntu package repository | | `infra/rpm` | `rpm.moq.dev` | `rpm-moq-dev` | Fedora/RHEL package repository | | `infra/moq-sh` | `moq.sh` | | The `moq` installer script | +| `infra/mbx` | | `mbx-moq-dev` | Private Rust build cache for CI | Each worker is a standalone bun package with a `wrangler.jsonc` and a small TypeScript handler. The apt and rpm workers proxy GETs out of the R2 bucket with appropriate `Content-Type` and `Cache-Control` headers for the file kind. The moq.sh worker serves `install.sh` from its bundle at every path, with the newest `moq-cli` release filled in as the default version. +`infra/mbx` has no Worker: CI reaches its bucket directly through mbx's S3 +client. ## Deploying a worker @@ -103,6 +106,67 @@ After this, every release that publishes a `.deb` or `.rpm` (one of the triggers `apt-repo.yml` / `rpm-repo.yml`, which downloads the assets, regenerates the repository metadata, signs it, and uploads the diff. +## Bootstrapping the Rust build cache + +`.github/actions/rust-cache` points mbx at the private `mbx-moq-dev` bucket, +namespaced per runner OS and architecture. Only `cache.yml`, on a push to +`main`, writes. Everything else reads, and fork pull requests, which get no +secrets, build cold. The write key is what enforces that: it lives in a GitHub +Environment that only `main` can deploy to. mbx refusing to publish outside +a protected-branch push is a second guard, not the boundary. + +All of this runs once, by a maintainer: + +1. **Create the bucket and its lifecycle rule** under your `wrangler login`: + + ```bash + just infra mbx create + ``` + + `lifecycle.json` deletes every object 30 days after upload and aborts + multipart uploads left incomplete for a day. mbx writes each compilation + once and never refreshes it, so a result still in use expires too; the + next `main` warm that misses it compiles and uploads it again. After + editing the rules, `just infra mbx lifecycle` applies them. + +2. **Create two R2 API tokens** in the dashboard (R2 -> Manage API tokens -> + Create Account API token), both scoped to `mbx-moq-dev` only. Wrangler + cannot create R2 tokens. Each shows an Access Key ID and a Secret Access + Key once. + + - `mbx-read`: **Object Read only**. + - `mbx-write`: **Object Read & Write**. + +3. **Create the `cache-write` Environment**, deployable from `main` only. A + protected-branches policy would admit `release` as well, so name `main` + instead: + + ```bash + gh api -X PUT repos/moq-dev/moq/environments/cache-write --input - <<'EOF' + {"deployment_branch_policy": {"protected_branches": false, "custom_branch_policies": true}} + EOF + gh api -X POST repos/moq-dev/moq/environments/cache-write/deployment-branch-policies \ + -f name=main -f type=branch + ``` + +4. **Store the keys under the same two names at both levels.** An Environment + secret shadows a repository secret of the same name, so `cache.yml` gets the + write key and every other job the read key, all through one pair of names: + + ```bash + # mbx-write, readable only by jobs in the cache-write Environment + gh secret set MBX_R2_ACCESS_KEY_ID --env cache-write --repo moq-dev/moq + gh secret set MBX_R2_SECRET_ACCESS_KEY --env cache-write --repo moq-dev/moq + + # mbx-read, for every other job + gh secret set MBX_R2_ACCESS_KEY_ID --repo moq-dev/moq + gh secret set MBX_R2_SECRET_ACCESS_KEY --repo moq-dev/moq + ``` + +Without the repository secrets, readers warn and build cold. Without the +Environment, `cache.yml` fails rather than warm nothing, and so does a key the +bucket refuses, in any job. + ## Rotating the signing key If the key needs to be rotated, repeat steps 3 through 5 with a new key diff --git a/infra/justfile b/infra/justfile index 513c5d6dc88..b10f26352e5 100644 --- a/infra/justfile +++ b/infra/justfile @@ -3,6 +3,7 @@ set fallback mod apt mod rpm mod moq-sh +mod mbx # Deploy all infra workers. deploy: diff --git a/infra/mbx/bun.lock b/infra/mbx/bun.lock new file mode 100644 index 00000000000..2bbe83e2bca --- /dev/null +++ b/infra/mbx/bun.lock @@ -0,0 +1,195 @@ +{ + "lockfileVersion": 2, + "configVersion": 1, + "workspaces": { + "": { + "name": "mbx-moq-dev", + "devDependencies": { + "wrangler": "^4", + }, + }, + }, + "packages": { + "@cloudflare/kv-asset-handler": ["@cloudflare/kv-asset-handler@0.5.0", "", {}, "sha512-jxQYkj8dSIzc0cD6cMMNdOc1UVjqSqu8BZdor5s8cGjW2I8BjODt/kWPVdY+u9zj3ms75Q5qaZgnxUad83+eAg=="], + + "@cloudflare/unenv-preset": ["@cloudflare/unenv-preset@2.16.2", "", { "peerDependencies": { "unenv": "2.0.0-rc.24", "workerd": ">1.20260305.0 <2.0.0-0" }, "optionalPeers": ["workerd"] }, "sha512-JBP1+Z7ZSNG/d4mRP+y8VC5dka3tZVMLEZRvS+rzQ4DGV1EoxRFQckcJTTkXbHSQiTj0DtNI01Zwb/V2fX0mvQ=="], + + "@cloudflare/workerd-darwin-64": ["@cloudflare/workerd-darwin-64@1.20261012.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-dkTL9aY3V4D40b+jBpGPCistWUPFQ/M61wlWi6i1o8MvHFFgEw7EQkcaYEv6Yd3bkPDD/3TFT4hRsMb2xVZSwQ=="], + + "@cloudflare/workerd-darwin-arm64": ["@cloudflare/workerd-darwin-arm64@1.20261012.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-2/nVGcKXjNNI+DhxKSepTKvFng9H7aN2WXv6Zu67iqgI6JrxypNt5kTPv4ZHosxrcfyKMci/2RfN7GIrN0BitQ=="], + + "@cloudflare/workerd-linux-64": ["@cloudflare/workerd-linux-64@1.20261012.1", "", { "os": "linux", "cpu": "x64" }, "sha512-uMe7ONHnLxStD1Ye0YFHBO36uj4cStv5P53rW+5GVWXFT8BRjqVixlH0IqCAHe1Pmcwyd1+7fVoGde89MZSCJg=="], + + "@cloudflare/workerd-linux-arm64": ["@cloudflare/workerd-linux-arm64@1.20261012.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-I0VMdcXk7ygG5vYDce0ePTBFdnBXC0i9WiBY5mWiv0iTinbfea6/rHqSQ7B1UMpjgrYVs9E0m4bZ9ufsk5GCFA=="], + + "@cloudflare/workerd-windows-64": ["@cloudflare/workerd-windows-64@1.20261012.1", "", { "os": "win32", "cpu": "x64" }, "sha512-c5hQvNx574UEoknaCFvMa/NdLrrYiALNbe6sx1okW8uOiRYWxrFuA8WpXFnBJ5XJypm0TEAHYaUTGv3rRLpY7Q=="], + + "@cspotcode/source-map-support": ["@cspotcode/source-map-support@0.8.1", "", { "dependencies": { "@jridgewell/trace-mapping": "0.3.9" } }, "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw=="], + + "@emnapi/runtime": ["@emnapi/runtime@1.11.3", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA=="], + + "@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.28.2", "", { "os": "aix", "cpu": "ppc64" }, "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ=="], + + "@esbuild/android-arm": ["@esbuild/android-arm@0.28.2", "", { "os": "android", "cpu": "arm" }, "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg=="], + + "@esbuild/android-arm64": ["@esbuild/android-arm64@0.28.2", "", { "os": "android", "cpu": "arm64" }, "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A=="], + + "@esbuild/android-x64": ["@esbuild/android-x64@0.28.2", "", { "os": "android", "cpu": "x64" }, "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q=="], + + "@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.28.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw=="], + + "@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.28.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw=="], + + "@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.28.2", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw=="], + + "@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.28.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg=="], + + "@esbuild/linux-arm": ["@esbuild/linux-arm@0.28.2", "", { "os": "linux", "cpu": "arm" }, "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w=="], + + "@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.28.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug=="], + + "@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.28.2", "", { "os": "linux", "cpu": "ia32" }, "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ=="], + + "@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.28.2", "", { "os": "linux", "cpu": "none" }, "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ=="], + + "@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.28.2", "", { "os": "linux", "cpu": "none" }, "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA=="], + + "@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.28.2", "", { "os": "linux", "cpu": "ppc64" }, "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ=="], + + "@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.28.2", "", { "os": "linux", "cpu": "none" }, "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA=="], + + "@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.28.2", "", { "os": "linux", "cpu": "s390x" }, "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg=="], + + "@esbuild/linux-x64": ["@esbuild/linux-x64@0.28.2", "", { "os": "linux", "cpu": "x64" }, "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ=="], + + "@esbuild/netbsd-arm64": ["@esbuild/netbsd-arm64@0.28.2", "", { "os": "none", "cpu": "arm64" }, "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw=="], + + "@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.28.2", "", { "os": "none", "cpu": "x64" }, "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw=="], + + "@esbuild/openbsd-arm64": ["@esbuild/openbsd-arm64@0.28.2", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ=="], + + "@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.28.2", "", { "os": "openbsd", "cpu": "x64" }, "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw=="], + + "@esbuild/openharmony-arm64": ["@esbuild/openharmony-arm64@0.28.2", "", { "os": "none", "cpu": "arm64" }, "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q=="], + + "@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.28.2", "", { "os": "sunos", "cpu": "x64" }, "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g=="], + + "@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.28.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ=="], + + "@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.28.2", "", { "os": "win32", "cpu": "ia32" }, "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA=="], + + "@esbuild/win32-x64": ["@esbuild/win32-x64@0.28.2", "", { "os": "win32", "cpu": "x64" }, "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g=="], + + "@img/colour": ["@img/colour@1.1.0", "", {}, "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ=="], + + "@img/sharp-darwin-arm64": ["@img/sharp-darwin-arm64@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-arm64": "1.3.4" }, "os": "darwin", "cpu": "arm64" }, "sha512-QRUlFQ0WxvdWyqqG/WtI3iupfD5rBzmCHXSdPsY91sAtVtTo7Q4cb6zOccZ3gqEqkr0f1As1ehLqmEpDsRf+lg=="], + + "@img/sharp-darwin-x64": ["@img/sharp-darwin-x64@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-x64": "1.3.4" }, "os": "darwin", "cpu": "x64" }, "sha512-+BR255RhDlpygUpOc/Jdt1nT6DQ3XG/ERo5wbcdOf5Q320dKtPCKPLR1LJs9VGXRaMa8l1uUa0tkCNOXiAxZUw=="], + + "@img/sharp-freebsd-wasm32": ["@img/sharp-freebsd-wasm32@0.35.5", "", { "dependencies": { "@img/sharp-wasm32": "0.35.5" }, "os": "freebsd" }, "sha512-Y/z91nEZ4uIBX5X3nfTovjU9lHNKFYbL2lpHCLVNmXQK03VIZvXBBt0KxbPGp2SdGSF+2mQU4e+hQaWOt86iAw=="], + + "@img/sharp-libvips-darwin-arm64": ["@img/sharp-libvips-darwin-arm64@1.3.4", "", { "os": "darwin", "cpu": "arm64" }, "sha512-5R89nBYiRdUlSWJxPhO+GVtaXzXSxKnRu/xqMn3KTA3L9EB9Oy/P+Nn2f2vlhPuUdy/Zusb2DarbyTpGCfEDuw=="], + + "@img/sharp-libvips-darwin-x64": ["@img/sharp-libvips-darwin-x64@1.3.4", "", { "os": "darwin", "cpu": "x64" }, "sha512-iR2OKH80yi0U+dUplyh3/xdpFvps6YkCwsXenIJxqxR1v9o+xtKTGbS9H7cps+2Vxjc8B1j96p75NmTGjIhtpQ=="], + + "@img/sharp-libvips-linux-arm": ["@img/sharp-libvips-linux-arm@1.3.4", "", { "os": "linux", "cpu": "arm" }, "sha512-LmRtTsOHuvM2+wlO2Db37dx5MiZhB0FvSunciw48YjdOkZz9KAiRbm8ujeMOA1INqmei5NapFxYEK1D1ZSidmw=="], + + "@img/sharp-libvips-linux-arm64": ["@img/sharp-libvips-linux-arm64@1.3.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-Y3dgX/6lE2QhQb+Gxy0WZxfg9MEm/JBjamZpS2IklP7xIQoKN4hzAm7KcMVGtaVDt3neE9OKBC7vAfonA/Lr1A=="], + + "@img/sharp-libvips-linux-ppc64": ["@img/sharp-libvips-linux-ppc64@1.3.4", "", { "os": "linux", "cpu": "ppc64" }, "sha512-Le6boB8Tai0Nis+gIxIpKx68UDVVIqdR8Tin5Yf1z2LJJQLDJvCDRqRu+jC2qCoD+eIomonmOwB4smBRxfVpYQ=="], + + "@img/sharp-libvips-linux-riscv64": ["@img/sharp-libvips-linux-riscv64@1.3.4", "", { "os": "linux", "cpu": "none" }, "sha512-aHkkIEHPRdQEegJN20MLmGtxYD9R2wQr3Cwpddnu5+YKMt6Uzax7S9h5gpZTo8wyrGuZSlfQ63OevL5mTyOC7Q=="], + + "@img/sharp-libvips-linux-s390x": ["@img/sharp-libvips-linux-s390x@1.3.4", "", { "os": "linux", "cpu": "s390x" }, "sha512-ra/mB6MikESDUO7Yg+Mi95bFBb9GsObURuhnOv3OqknjGe9sZrG8tCe9q0xSIGrtLgvgw0gKnFWcK4blSgQOuQ=="], + + "@img/sharp-libvips-linux-x64": ["@img/sharp-libvips-linux-x64@1.3.4", "", { "os": "linux", "cpu": "x64" }, "sha512-GJ//SSXbnwSDes02umB3nDJLFcQzw8a18V8fyhqr6tV515tOEMdImjjxj1AoafMRz56F3PHgftnj1QEKSU1zkw=="], + + "@img/sharp-libvips-linuxmusl-arm64": ["@img/sharp-libvips-linuxmusl-arm64@1.3.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-hvulFwtjUcagsis6BBxHwGFwWoNZjgYmULGVrZcyfNbjA8hKILbRxGg15/7w5HDyXHXUos/j6baAWqnCyQ2DWA=="], + + "@img/sharp-libvips-linuxmusl-x64": ["@img/sharp-libvips-linuxmusl-x64@1.3.4", "", { "os": "linux", "cpu": "x64" }, "sha512-6zXKeE/p39I1AmA3cJG35eyBGNqNddLnUXjhwBnsGjFPWqf5VKkDBEqaEkPDoTEtkxwi2vv8Tcr2mDyP4So7Fg=="], + + "@img/sharp-linux-arm": ["@img/sharp-linux-arm@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm": "1.3.4" }, "os": "linux", "cpu": "arm" }, "sha512-LEaXK2WdXVK5ykcw0buWyPMsmLLL2vpHLD6yrNSW+JGEL3BZPA4tpKN6iaMc4AxTTAoaX/sU1rOL51lcIz48ZQ=="], + + "@img/sharp-linux-arm64": ["@img/sharp-linux-arm64@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm64": "1.3.4" }, "os": "linux", "cpu": "arm64" }, "sha512-LYVx5JTsOM2CBzmxreh+nl64/3H6Xb09iSLknqH47z2T2DFFxDeFLP5y4dJwe6H7uGQlHPyEEtIqyo3DYsRwdQ=="], + + "@img/sharp-linux-ppc64": ["@img/sharp-linux-ppc64@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-ppc64": "1.3.4" }, "os": "linux", "cpu": "ppc64" }, "sha512-QVxAAq8evVRI9ia2vqgwrmWucn5Dfv+JdWzj75pD8omHLPSP7f8p20O8jxzjCcuCEQEOtYOZUmX1hkiZ0kdevA=="], + + "@img/sharp-linux-riscv64": ["@img/sharp-linux-riscv64@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-riscv64": "1.3.4" }, "os": "linux", "cpu": "none" }, "sha512-LtdreXguaavKODPIfzJ4kffx7UNt1omwtK0rch4EBbbSTXPnxWmYSayXdLJw0fJzQ97kHt1gL/yh4tvU+nCyRQ=="], + + "@img/sharp-linux-s390x": ["@img/sharp-linux-s390x@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-s390x": "1.3.4" }, "os": "linux", "cpu": "s390x" }, "sha512-UZasTOFiYzotTsGOCu42BfUzP6Tu6Do/947iRm1RsLKvlllxwGcn4RN27LibGWceix4Y+Pmw3jsnTcCQIgWjqA=="], + + "@img/sharp-linux-x64": ["@img/sharp-linux-x64@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-x64": "1.3.4" }, "os": "linux", "cpu": "x64" }, "sha512-SxFtLTeJInhAA9Q836kux2vZNeOBQEx658qvbboZScr0wIARym3IcGmW7KpVD5sbVg0Ojy+udFQdayYIZyoNog=="], + + "@img/sharp-linuxmusl-arm64": ["@img/sharp-linuxmusl-arm64@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-arm64": "1.3.4" }, "os": "linux", "cpu": "arm64" }, "sha512-9HbMclmI1zlNkFRs3z9/eBtDjfD0sGlrX1z6b1qwmiFY5ElDLh4BC0LPBdVp7z1DXFiKlIcznf+ZlsuZzLxQqg=="], + + "@img/sharp-linuxmusl-x64": ["@img/sharp-linuxmusl-x64@0.35.5", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-x64": "1.3.4" }, "os": "linux", "cpu": "x64" }, "sha512-4KOphqB035HrVdqLZfCgMzzERrQkkzOwRhl4OAkRO1YCldbaFjySXMaK534Mo0V+LndnlJk+sbUyLeU0ULyD1A=="], + + "@img/sharp-wasm32": ["@img/sharp-wasm32@0.35.5", "", { "dependencies": { "@emnapi/runtime": "^1.11.3" } }, "sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ=="], + + "@img/sharp-webcontainers-wasm32": ["@img/sharp-webcontainers-wasm32@0.35.5", "", { "dependencies": { "@img/sharp-wasm32": "0.35.5" }, "cpu": "none" }, "sha512-hfhF/FmoQyTUkA0bIKFOtw536BQSeBMe6BF6QyWlrPxT754+TFLaZ7sKKTfvvM0yJgKgaYTwnFCIZ/GuDw5SUA=="], + + "@img/sharp-win32-arm64": ["@img/sharp-win32-arm64@0.35.5", "", { "os": "win32", "cpu": "arm64" }, "sha512-X4t7g+7ZA5DKblCBEXGjUqqemj4vczING/5viFwAL8h4N3qYeyjwdCvRLHi4EdOUI+2Z7UFlp1VM+p/AuEtm6Q=="], + + "@img/sharp-win32-ia32": ["@img/sharp-win32-ia32@0.35.5", "", { "os": "win32", "cpu": "ia32" }, "sha512-5Zm82LoBc43nhwNybZlG7Y1KO//Zhsn306fQl29ZOuStHLGTo3BWL83q3cznX0poxSAMuYL1On/BHBxkBeKr6A=="], + + "@img/sharp-win32-x64": ["@img/sharp-win32-x64@0.35.5", "", { "os": "win32", "cpu": "x64" }, "sha512-x76eH0vEiHlcMQu8Y8IenntaACtddpT6W0wmXtWrnKcnKI7ME5DdgqhAD6SEWOEl1v2zDvkZDhFA9KnURwpfqg=="], + + "@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="], + + "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.6.0", "", {}, "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw=="], + + "@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.9", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ=="], + + "@poppinss/colors": ["@poppinss/colors@4.1.6", "", { "dependencies": { "kleur": "^4.1.5" } }, "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg=="], + + "@poppinss/dumper": ["@poppinss/dumper@0.6.5", "", { "dependencies": { "@poppinss/colors": "^4.1.5", "@sindresorhus/is": "^7.0.2", "supports-color": "^10.0.0" } }, "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw=="], + + "@poppinss/exception": ["@poppinss/exception@1.2.3", "", {}, "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw=="], + + "@sindresorhus/is": ["@sindresorhus/is@7.2.0", "", {}, "sha512-P1Cz1dWaFfR4IR+U13mqqiGsLFf1KbayybWwdd2vfctdV6hDpUkgCY0nKOLLTMSoRd/jJNjtbqzf13K8DCCXQw=="], + + "@speed-highlight/core": ["@speed-highlight/core@1.2.24", "", {}, "sha512-qeW2e1l78afw8VhRPfPQ1Gjj+KU5XFQ/OFV5ti6eTa9bruO7mJyZtA4vw0ofqmA3tKCkROE9xLk3VZoeRc98nw=="], + + "blake3-wasm": ["blake3-wasm@2.1.5", "", {}, "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g=="], + + "cookie": ["cookie@1.1.1", "", {}, "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ=="], + + "detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], + + "error-stack-parser-es": ["error-stack-parser-es@1.0.5", "", {}, "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA=="], + + "esbuild": ["esbuild@0.28.2", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.28.2", "@esbuild/android-arm": "0.28.2", "@esbuild/android-arm64": "0.28.2", "@esbuild/android-x64": "0.28.2", "@esbuild/darwin-arm64": "0.28.2", "@esbuild/darwin-x64": "0.28.2", "@esbuild/freebsd-arm64": "0.28.2", "@esbuild/freebsd-x64": "0.28.2", "@esbuild/linux-arm": "0.28.2", "@esbuild/linux-arm64": "0.28.2", "@esbuild/linux-ia32": "0.28.2", "@esbuild/linux-loong64": "0.28.2", "@esbuild/linux-mips64el": "0.28.2", "@esbuild/linux-ppc64": "0.28.2", "@esbuild/linux-riscv64": "0.28.2", "@esbuild/linux-s390x": "0.28.2", "@esbuild/linux-x64": "0.28.2", "@esbuild/netbsd-arm64": "0.28.2", "@esbuild/netbsd-x64": "0.28.2", "@esbuild/openbsd-arm64": "0.28.2", "@esbuild/openbsd-x64": "0.28.2", "@esbuild/openharmony-arm64": "0.28.2", "@esbuild/sunos-x64": "0.28.2", "@esbuild/win32-arm64": "0.28.2", "@esbuild/win32-ia32": "0.28.2", "@esbuild/win32-x64": "0.28.2" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA=="], + + "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], + + "kleur": ["kleur@4.1.5", "", {}, "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ=="], + + "miniflare": ["miniflare@5.20261012.0-beta", "", { "dependencies": { "@cspotcode/source-map-support": "0.8.1", "sharp": "0.35.5", "undici": "7.29.1", "workerd": "1.20261012.1", "ws": "8.21.0", "youch": "4.1.0-beta.10" } }, "sha512-Cjrs+vHHQ7krLO4HYELYpYBJBuMhcnNZD/Z5z/UcQSnFqWSQY3DhtTCFalXgI1/yO1iK+YrRKK8EYkumrEopxg=="], + + "path-to-regexp": ["path-to-regexp@6.3.0", "", {}, "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ=="], + + "pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="], + + "semver": ["semver@7.8.5", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA=="], + + "sharp": ["sharp@0.35.5", "", { "dependencies": { "@img/colour": "^1.1.0", "detect-libc": "^2.1.2", "semver": "^7.8.5" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.35.5", "@img/sharp-darwin-x64": "0.35.5", "@img/sharp-freebsd-wasm32": "0.35.5", "@img/sharp-libvips-darwin-arm64": "1.3.4", "@img/sharp-libvips-darwin-x64": "1.3.4", "@img/sharp-libvips-linux-arm": "1.3.4", "@img/sharp-libvips-linux-arm64": "1.3.4", "@img/sharp-libvips-linux-ppc64": "1.3.4", "@img/sharp-libvips-linux-riscv64": "1.3.4", "@img/sharp-libvips-linux-s390x": "1.3.4", "@img/sharp-libvips-linux-x64": "1.3.4", "@img/sharp-libvips-linuxmusl-arm64": "1.3.4", "@img/sharp-libvips-linuxmusl-x64": "1.3.4", "@img/sharp-linux-arm": "0.35.5", "@img/sharp-linux-arm64": "0.35.5", "@img/sharp-linux-ppc64": "0.35.5", "@img/sharp-linux-riscv64": "0.35.5", "@img/sharp-linux-s390x": "0.35.5", "@img/sharp-linux-x64": "0.35.5", "@img/sharp-linuxmusl-arm64": "0.35.5", "@img/sharp-linuxmusl-x64": "0.35.5", "@img/sharp-webcontainers-wasm32": "0.35.5", "@img/sharp-win32-arm64": "0.35.5", "@img/sharp-win32-ia32": "0.35.5", "@img/sharp-win32-x64": "0.35.5" } }, "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g=="], + + "supports-color": ["supports-color@10.2.2", "", {}, "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g=="], + + "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], + + "undici": ["undici@7.29.1", "", {}, "sha512-RYONW2MeafgYlkVOKYKkA/Ag7BmXqgIWCa8t1m0JcxrQg9pI9lEqRhAOruOBCbAohOa/gkCF+iPi9hrgvTzu6Q=="], + + "unenv": ["unenv@2.0.0-rc.24", "", { "dependencies": { "pathe": "^2.0.3" } }, "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw=="], + + "workerd": ["workerd@1.20261012.1", "", { "optionalDependencies": { "@cloudflare/workerd-darwin-64": "1.20261012.1", "@cloudflare/workerd-darwin-arm64": "1.20261012.1", "@cloudflare/workerd-linux-64": "1.20261012.1", "@cloudflare/workerd-linux-arm64": "1.20261012.1", "@cloudflare/workerd-windows-64": "1.20261012.1" }, "bin": { "workerd": "bin/workerd" } }, "sha512-tEHoMPsMga0seVjxfsR8Pd3f8IRqYwkq++dTUKI5Gdgj6zuSDluYwisydq+dn90SsIACwBquJUQ1nBpcOqaWTA=="], + + "wrangler": ["wrangler@4.151.0", "", { "dependencies": { "@cloudflare/kv-asset-handler": "0.5.0", "@cloudflare/unenv-preset": "2.16.2", "blake3-wasm": "2.1.5", "esbuild": "0.28.2", "miniflare": "5.20261012.0-beta", "path-to-regexp": "6.3.0", "unenv": "2.0.0-rc.24", "workerd": "1.20261012.1" }, "optionalDependencies": { "fsevents": "2.3.3" }, "peerDependencies": { "@cloudflare/workers-types": "^5.20261006.1" }, "optionalPeers": ["@cloudflare/workers-types"], "bin": { "wrangler": "bin/wrangler.js", "wrangler2": "bin/wrangler.js", "cf-wrangler": "bin/cf-wrangler.js" } }, "sha512-ra8MpzSR+ClkbGofu9S+AmAKjytS60MqSuayXKpa1CAYIzP+NIc8q6EiF55Gz5PS3lxT4qcvMuPHihCNhTPpDg=="], + + "ws": ["ws@8.21.0", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g=="], + + "youch": ["youch@4.1.0-beta.10", "", { "dependencies": { "@poppinss/colors": "^4.1.5", "@poppinss/dumper": "^0.6.4", "@speed-highlight/core": "^1.2.7", "cookie": "^1.0.2", "youch-core": "^0.3.3" } }, "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ=="], + + "youch-core": ["youch-core@0.3.3", "", { "dependencies": { "@poppinss/exception": "^1.2.2", "error-stack-parser-es": "^1.0.5" } }, "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA=="], + } +} diff --git a/infra/mbx/justfile b/infra/mbx/justfile new file mode 100644 index 00000000000..dfd6c894b64 --- /dev/null +++ b/infra/mbx/justfile @@ -0,0 +1,15 @@ +set fallback + +# No Worker config names the account here, so wrangler would ask. +export CLOUDFLARE_ACCOUNT_ID := "dd618f5dbd5da77b8296f1613c301f5c" + +# Create the mbx-moq-dev R2 bucket and apply its lifecycle rules. Run once. +create: + bun install --frozen-lockfile + bun wrangler r2 bucket create mbx-moq-dev + just lifecycle + +# Replace the bucket's lifecycle rules with lifecycle.json. +lifecycle: + bun install --frozen-lockfile + bun wrangler r2 bucket lifecycle set mbx-moq-dev --file lifecycle.json --force diff --git a/infra/mbx/lifecycle.json b/infra/mbx/lifecycle.json new file mode 100644 index 00000000000..bd974fc6e88 --- /dev/null +++ b/infra/mbx/lifecycle.json @@ -0,0 +1,11 @@ +{ + "rules": [ + { + "id": "expire", + "enabled": true, + "conditions": { "prefix": "" }, + "deleteObjectsTransition": { "condition": { "type": "Age", "maxAge": 2592000 } }, + "abortMultipartUploadsTransition": { "condition": { "type": "Age", "maxAge": 86400 } } + } + ] +} diff --git a/infra/mbx/package.json b/infra/mbx/package.json new file mode 100644 index 00000000000..ff24f994ed1 --- /dev/null +++ b/infra/mbx/package.json @@ -0,0 +1,7 @@ +{ + "name": "mbx-moq-dev", + "private": true, + "devDependencies": { + "wrangler": "^4" + } +} diff --git a/quest/m0/ci/README.md b/quest/m0/ci/README.md index 1b311c5a471..f777796a145 100644 --- a/quest/m0/ci/README.md +++ b/quest/m0/ci/README.md @@ -67,6 +67,6 @@ The historical samples locate candidates; they are not controlled benchmarks. - [Reduce test cost](/quest/m0/ci/test-cost.md) - measure and retire low-value expensive work - [Reduce setup cost](/quest/m0/ci/setup-cost.md) - select cleanup and setup from actual workload needs - [Require platform gates](/quest/m0/ci/platform-queue.md) - activate the consolidated platform checks in the main and release rulesets after the workflow lands -- [mbx on R2](/quest/m0/ci/mbx-r2.md) - Rust builds on every OS read an R2 cache that only `main` writes, escaping the 10 GB Actions cache +- [Verify the R2 Rust cache](/quest/m0/ci/mbx-r2-verify.md) - condition: the maintainer bootstrap; then measure hits, restore time, and expiry - [Nix cache](/quest/m0/ci/nix-cache.md) - `nix.moq.dev` on R2 replaces Cachix for CI and releases - [Nightly after FFI reuse](/quest/m0/ci/nightly-ffi-reuse.md) - condition: the first scheduled Nightly and `moq-ffi-v*` tag after #5549 and #5527; measure them and verify the shared build diff --git a/quest/m0/ci/mbx-r2-verify.md b/quest/m0/ci/mbx-r2-verify.md new file mode 100644 index 00000000000..70765e83d8d --- /dev/null +++ b/quest/m0/ci/mbx-r2-verify.md @@ -0,0 +1,25 @@ +# [S] Verify the R2 Rust cache + +## Goal + +Condition: a maintainer has run the `mbx-moq-dev` bootstrap in +`infra/README.md` (bucket, lifecycle rule, both R2 tokens, the `cache-write` +Environment and its secrets), and `cache.yml` has warmed every leg from `main` +since. Check it with `gh run list --workflow cache.yml --branch main`. + +Then confirm the cache earns its keep, and record the numbers in the PR that +closes this: + +- Each warm's `Check the cache` step reports `effective read-write`, and a + pull request's reports `effective read-only`. +- Check, Test, and the macOS and Windows merge queue jobs show mbx remote hits + for code the pull request did not touch. +- Restore plus build time against the 150-210s Actions restore of the ~6 GB + store it replaced, from the same diff before and after. +- Bucket size and request counts after a month, against the 30-day expiry in + `infra/mbx/lifecycle.json`. Shorten or lengthen it from that. + +## Related + +- [Require platform gates](/quest/m0/ci/platform-queue.md) - the macOS and Windows jobs this cache serves +- [Nix cache](/quest/m0/ci/nix-cache.md) - the same R2 and Environment bootstrap for Nix diff --git a/quest/m0/ci/mbx-r2.md b/quest/m0/ci/mbx-r2.md deleted file mode 100644 index 9badd2224ea..00000000000 --- a/quest/m0/ci/mbx-r2.md +++ /dev/null @@ -1,34 +0,0 @@ -# [M] mbx caches Rust builds in R2 - -## Goal - -Every Rust CI job on Linux, macOS, and Windows restores compilation artifacts -from an R2 bucket instead of the Actions cache, so the 10 GB repository -budget no longer decides which jobs get a cache. Only workflows running on -`main` can write; pull requests and the merge queue read. - -## Plan - -- mbx supports `s3://` remotes with an R2 endpoint, needs no server, and - already narrows itself to read-only outside protected-branch pushes. That - client check is a convenience, not the boundary: the write key lives only - in a GitHub Environment (e.g. `cache-write`) whose deployment branch policy - allows `main`, so a same-repo PR cannot read it. A read-only key is a plain - repo secret; fork PRs get neither and build cold. -- A private bucket, separate from the public Nix cache bucket. Namespaces per - OS and architecture; expire old objects with an R2 lifecycle rule rather - than a cleanup job. -- The pinned mbx (1.10.0) is well behind upstream; check which version the - R2 backend and its read-only enforcement need. -- The bucket, lifecycle rule, and keys follow the apt/rpm bootstrap in - `infra/README.md`: checked in where wrangler allows, commands documented - where it does not. Creating them and the Environment are maintainer - actions; ask before running each. -- Once R2 serves Linux, retire the Actions-cache path and the per-workflow - Swatinem caches (Swift) rather than run both. -- Measure restore time against the 150-210s Actions restore of the ~6 GB - store; R2 transfers only the objects a build misses, so it may be faster. - -## Related - -- [Platform in the merge queue](/quest/m0/ci/platform-queue.md) - the macOS and Windows jobs this gives a cache diff --git a/quest/m0/ci/nix-cache.md b/quest/m0/ci/nix-cache.md index 7a2bad22f28..045852d850a 100644 --- a/quest/m0/ci/nix-cache.md +++ b/quest/m0/ci/nix-cache.md @@ -17,7 +17,7 @@ and push. trust boundary. Keep it and the bucket key in GitHub Environments that `main` and the release tags can deploy from, and nothing else. Release tags are unprotected today (no tag ruleset), so restricting who can create them - comes first; a separate release Environment from the mbx one is fine. A + comes first; a separate release Environment from mbx's `cache-write` is fine. A leaked bucket key cannot make a client accept a path. - Serve the bucket like apt and rpm: a Worker in `infra/nix` with a checked-in `wrangler.jsonc` and custom domain, cache headers suited to `.narinfo` @@ -34,4 +34,4 @@ and push. ## Related -- [mbx on R2](/quest/m0/ci/mbx-r2.md) - shares the Environment and bootstrap pattern, not the bucket +- [Verify the R2 Rust cache](/quest/m0/ci/mbx-r2-verify.md) - the mbx bucket's bootstrap in `infra/README.md` is the pattern; share it, not the bucket diff --git a/quest/m0/ci/platform-queue.md b/quest/m0/ci/platform-queue.md index 1a1444bda39..633091b9bf6 100644 --- a/quest/m0/ci/platform-queue.md +++ b/quest/m0/ci/platform-queue.md @@ -35,4 +35,4 @@ the implementation PR. ## Related -- [mbx on R2](/quest/m0/ci/mbx-r2.md) - gives platform jobs a Rust cache +- [Verify the R2 Rust cache](/quest/m0/ci/mbx-r2-verify.md) - confirms the platform jobs hit their Rust cache From e471f2026ce3b68acaeb27c812f4013517d19cf4 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Mon, 19 Oct 2026 21:08:59 -0700 Subject: [PATCH 3/4] ci: write the Rust cache from the merge queue and main Jobs on main and in its merge queue now publish what they compile to R2, in the cache-write Environment, and pull requests only read. cache.yml keeps only the dev shell push. mbx 1.25.0's MBX_REMOTE_TRUST_WRITES lets the queue and Nightly's schedule write, since mbx alone trusts only protected pushes. Co-Authored-By: Claude Opus 5.5 --- .github/actions/rust-cache/action.yml | 53 ++++++----- .github/workflows/cache.yml | 126 ++------------------------ .github/workflows/check.yml | 10 +- .github/workflows/dependabot.yml | 5 +- .github/workflows/interop.yml | 6 +- .github/workflows/nightly.yml | 17 +++- .github/workflows/obs.yml | 4 +- .github/workflows/platform.yml | 7 +- .github/workflows/release-rs.yml | 2 +- .github/workflows/ts.yml | 2 + .github/workflows/wasm.yml | 4 +- .github/workflows/x11.yml | 2 + infra/README.md | 42 ++++++--- quest/m0/ci/README.md | 10 +- quest/m0/ci/mbx-r2-verify.md | 15 +-- 15 files changed, 122 insertions(+), 183 deletions(-) diff --git a/.github/actions/rust-cache/action.yml b/.github/actions/rust-cache/action.yml index 36c7bc650af..3f35f6794e5 100644 --- a/.github/actions/rust-cache/action.yml +++ b/.github/actions/rust-cache/action.yml @@ -1,5 +1,5 @@ name: Rust cache -description: Install mbx, put its Cargo shim on PATH, and back it with the R2 build cache that `main` writes. +description: Install mbx, put its Cargo shim on PATH, and back it with the R2 build cache that `main` and its merge queue write. inputs: access-key-id: @@ -8,30 +8,34 @@ inputs: secret-access-key: description: R2 secret access key matching `access-key-id`. default: "" - write: - description: Publish compilations to the cache. Only cache.yml, holding the `cache-write` Environment's key, sets it. - default: "false" runs: using: composite steps: - # Only the write key is a boundary: it lives in the `cache-write` - # Environment, which only `main` can deploy to, so a pull request's code - # never sees it, even from this repository. The read key is a plain repo - # secret; fork pull requests get no secrets at all and build cold. + # Runs on `main` and in its merge queue write; everything else reads. A + # queued pull request is about to become `main`, so its code is trusted + # like `main`'s, and publishing from the queue keeps the cache current + # with what lands without building it again after the merge. # - # A writer without its key means the Environment is misconfigured, and + # The write key is the boundary. It lives in the `cache-write` + # Environment, whose branch policy admits exactly the refs `WRITE` names, + # and its secrets shadow the repository's read key under the same names. + # So every job that can run on those refs names the Environment there, and + # a pull request's code never sees the write key, even from this + # repository. Fork pull requests get no secrets at all and build cold. + # + # A writer without a key means the Environment is misconfigured, and # building on would leave every reader cold with nothing to say why. - name: Cache credentials shell: bash env: KEY_ID: ${{ inputs.access-key-id }} SECRET: ${{ inputs.secret-access-key }} - WRITE: ${{ inputs.write }} + WRITE: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/gh-readonly-queue/main/') }} run: | if [ -z "$KEY_ID" ] || [ -z "$SECRET" ]; then if [ "$WRITE" = "true" ]; then - echo "::error::write is set but the cache-write Environment supplied no R2 key" + echo "::error::$GITHUB_REF writes the cache but the cache-write Environment supplied no R2 key" exit 1 fi echo "::warning::No R2 cache credentials, as for a fork pull request; building cold" @@ -42,34 +46,37 @@ runs: echo "AWS_SECRET_ACCESS_KEY=$SECRET" echo "MBX_REMOTE_S3_ENDPOINT=https://dd618f5dbd5da77b8296f1613c301f5c.r2.cloudflarestorage.com" echo "MBX_REMOTE_S3_REGION=auto" + if [ "$WRITE" = "true" ]; then + echo "MBX_REMOTE_MODE=read-write" + # mbx trusts only a push to a protected branch, which leaves out + # the merge queue and Nightly's schedule. Its guess is bypassed on + # purpose: the Environment already decided who holds the write key. + echo "MBX_REMOTE_TRUST_WRITES=true" + else + echo "MBX_REMOTE_MODE=read-only" + fi } >> "$GITHUB_ENV" # mbx keys every compilation on the compiler, target, and inputs, so one # bucket serves every toolchain and workflow without a cache key of ours. # The namespace splits it per runner platform anyway, so a platform's - # usage and misses can be read off its own prefix. - # - # mbx narrows itself to read-only outside a push to a protected branch, so - # `write` alone cannot publish from a pull request or the merge queue. The - # Environment above is what enforces it; mbx's check is a second guard. + # usage and misses can be read off its own prefix. The remote mode comes + # from MBX_REMOTE_MODE above. - uses: jdx/mr-boxington-action@47ce49b32025d93a7a2f4570815afaa2b7092240 # v1.7.2 with: - version: 1.24.0 + version: 1.25.0 backend: ${{ inputs.access-key-id != '' && inputs.secret-access-key != '' && 'remote' || 'local' }} remote-url: s3://mbx-moq-dev namespace: ${{ runner.os }}-${{ runner.arch }} - remote-mode: ${{ inputs.write == 'true' && 'read-write' || 'read-only' }} # The action only warns when it cannot reach the remote, which is how a # revoked or mistyped key would look. A cache that silently never hits # costs every job its full build, so refuse instead. A writer also has to - # come out read-write: mbx narrows it to read-only when `main` loses its - # protection, and nothing would publish again. + # come out read-write, or nothing would publish and every reader would + # drift cold unnoticed. - name: Check the cache if: inputs.access-key-id != '' && inputs.secret-access-key != '' shell: bash - env: - WRITE: ${{ inputs.write }} run: | report=$(mbx doctor --json || true) remote=$(jq -r '.checks[] | select(.name == "remote") | "\(.severity): \(.detail)"' <<< "$report") @@ -80,7 +87,7 @@ runs: pass:*) ;; *) echo "::error::R2 cache unusable: $remote"; exit 1 ;; esac - if [ "$WRITE" = "true" ] && [[ "$policy" != *"effective read-write" ]]; then + if [ "$MBX_REMOTE_MODE" = "read-write" ] && [[ "$policy" != *"effective read-write" ]]; then echo "::error::the cache writer cannot publish: $policy" exit 1 fi diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index 7c458edd008..8a496ce8be8 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -1,22 +1,9 @@ name: Cache -# Populates the R2 Rust build cache that every other job reads, and the dev -# shell closure that every nix job substitutes. +# Pushes the dev shell closure that every nix job substitutes. # -# This is the only writer. The R2 write key lives in the `cache-write` -# Environment, whose deployment policy admits only `main`, so no pull request, -# merge queue, or dispatched run can hold it. mbx also refuses to publish from -# anything but a push to a protected branch, so a manual dispatch could not -# seed the cache either; the push that changes the toolchain warms it instead. -# -# mbx uploads each compilation it misses and nothing else, so a warm after a -# small merge compiles and publishes only what that merge changed. Every -# runner platform a pull request, the merge queue, or Nightly builds Rust on -# gets a leg, since compilations never cross platforms. -# -# This runs the unscoped suite rather than the diff-scoped one: the point is to -# leave artifacts for whatever a future PR happens to touch, not to check `main` -# (the PR that became `main` was already checked). It blocks nobody. +# The Rust build cache is not warmed here: `main` and its merge queue publish +# what they compile as they run (see .github/actions/rust-cache). permissions: contents: read @@ -24,24 +11,17 @@ permissions: on: push: branches: [main] - # A docs-only merge can't change the build graph, so don't spend a runner. + # Only the flake decides the dev shell, so don't spend a runner otherwise. paths: - - "rs/**" - - "Cargo.toml" - - "Cargo.lock" - - "rust-toolchain.toml" - "flake.nix" - "flake.lock" + - "nix/**" - ".github/workflows/cache.yml" - # The mbx pin lives here, and a new mbx can change what it keys on. - # Without this the sole writer would not re-run after such a change, - # leaving every reader cold until something else landed. - - ".github/actions/rust-cache/**" + # Priming the shell by hand, e.g. after a failed push. + workflow_dispatch: -# Queue rather than cancel. A cold warm takes 30-50 minutes and `main` merges -# more often than that, so cancelling meant no warm ever finished and every -# pull request read a cache hours stale. Actions keeps only the newest pending -# run per group, so merges that land mid-warm still coalesce into one. +# Queue rather than cancel, so a run always finishes. Actions keeps only the +# newest pending run per group, so merges that land mid-run coalesce into one. concurrency: group: cache-${{ github.ref }} cancel-in-progress: false @@ -55,7 +35,6 @@ jobs: runner: [ubuntu-24.04-arm, ubuntu-latest] runs-on: ${{ matrix.runner }} timeout-minutes: 60 - environment: cache-write steps: - name: Checkout @@ -94,90 +73,3 @@ jobs: # out the build-time inputs. nix develop --profile /tmp/devshell --command true cachix push kixelated /tmp/devshell - - - name: Rust cache - uses: ./.github/actions/rust-cache - with: - access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} - secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} - write: true - - # Both halves, so the cache carries the lint artifacts (clippy rmeta) - # and the test artifacts (codegen + linked test binaries). They share - # little, and a PR usually needs both. - # - # mbx publishes each compilation as it finishes, so a lint or test that - # fails on `main` costs nothing already built. `continue-on-error` keeps - # that failure from turning the warm red: the pull request gates are what - # report it. - - name: Check - continue-on-error: true - run: nix develop --command just ci check --all - env: - MOQ_STRICT: 1 - - - name: Test - if: ${{ !cancelled() }} - continue-on-error: true - run: nix develop --command just ci test --all - env: - MOQ_STRICT: 1 - NEXTEST_PROFILE: ci - - # The Rust half of platform.yml, which the merge queue, `release`, and Nightly - # run against the runner's rustup toolchain instead of the dev shell. - platform: - name: Warm (${{ matrix.runner }}) - strategy: - fail-fast: false - matrix: - include: - - runner: macos-latest - os: macos - - runner: windows-2022 - os: windows - runs-on: ${{ matrix.runner }} - timeout-minutes: 90 - environment: cache-write - defaults: - run: - shell: bash - env: - CARGO_TARGET_DIR: ${{ github.workspace }}/target - NEXTEST_PROFILE: ci - - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - name: Install Rust - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable - - name: Install NASM - if: matrix.os == 'windows' - shell: pwsh - run: | - choco install nasm -y --no-progress - "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - uses: ./.github/actions/just - - name: Install nextest - uses: taiki-e/install-action@e407f7bafb71fd004bc5c2da3032e5470cbb6ef0 # v2.87.24 - with: - tool: nextest@0.9.146 - - - name: Rust cache - uses: ./.github/actions/rust-cache - with: - access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} - secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} - write: true - - # The same recipes platform.yml runs, unscoped. As above, a failure here - # is the gates' to report. - - name: Compile - continue-on-error: true - run: just rs ${{ matrix.os }} --all - - - name: Test - if: ${{ !cancelled() }} - continue-on-error: true - run: just rs ${{ matrix.os }}-test diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 6828371f704..146d22ca624 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -28,6 +28,8 @@ jobs: # superseded in-flight build via the concurrency group above. if: github.event.action != 'closed' runs-on: ubuntu-24.04-arm + # `main` and its merge queue write the Rust cache; see .github/actions/rust-cache. + environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/gh-readonly-queue/main/')) && 'cache-write' || '' }} # Backstop a hang instead of holding the runner for the 6-hour default. timeout-minutes: 60 @@ -65,8 +67,8 @@ jobs: - uses: DeterminateSystems/flake-checker-action@786422608c7bded2bbc9741ad9f91356842bf520 # main if: steps.scope.outputs.needed == 'true' - # Read only: cache.yml warms the R2 cache from `main`, and this job never - # holds the write key. + # Pull requests read. The merge queue writes what it compiles, so the + # cache follows what lands on `main` without a second build after it. - name: Rust cache if: steps.scope.outputs.rust == 'true' uses: ./.github/actions/rust-cache @@ -96,6 +98,8 @@ jobs: name: Test if: github.event.action != 'closed' runs-on: ubuntu-24.04-arm + # `main` and its merge queue write the Rust cache; see .github/actions/rust-cache. + environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/gh-readonly-queue/main/')) && 'cache-write' || '' }} timeout-minutes: 60 steps: @@ -130,7 +134,7 @@ jobs: extra-substituters = https://kixelated.cachix.org extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - # Read only, same as the `check` job above. + # Reads and writes like the `check` job above. - name: Rust cache if: steps.scope.outputs.rust == 'true' uses: ./.github/actions/rust-cache diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml index 9fe2cae19af..ef2e910d2fe 100644 --- a/.github/workflows/dependabot.yml +++ b/.github/workflows/dependabot.yml @@ -12,9 +12,8 @@ name: Dependabot # calls one `gh` command against the pull request number. # # The moq-bot token rather than GITHUB_TOKEN: a merge enabled by GITHUB_TOKEN -# does not trigger further workflow runs, which would silently skip Cache -# (the Rust cache warm keyed on Cargo.lock, exactly what the cargo group -# changes), release-rs and release-js on every auto-merged bump. +# does not trigger further workflow runs, which would silently skip +# release-rs and release-js on every auto-merged bump. permissions: {} diff --git a/.github/workflows/interop.yml b/.github/workflows/interop.yml index 4dfbe481479..5801574371d 100644 --- a/.github/workflows/interop.yml +++ b/.github/workflows/interop.yml @@ -42,6 +42,8 @@ jobs: interop: name: Interop runs-on: ubuntu-latest + # `main` and its merge queue write the Rust cache; see .github/actions/rust-cache. + environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/gh-readonly-queue/main/')) && 'cache-write' || '' }} # The matrix runs in real time (ffmpeg -re pacing + per-subscriber timeouts); # this is a safety net against a hung relay/client plus a cold first build. timeout-minutes: 60 @@ -65,8 +67,8 @@ jobs: extra-substituters = https://kixelated.cachix.org extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - # The relay, cli, moq-ffi, and moq-c all build from source; read whatever - # compilations cache.yml's x86 warm shares with them. + # The relay, cli, moq-ffi, and moq-c all build from source. The nightly + # run publishes them for the pull requests that touch the harness. - name: Rust cache uses: ./.github/actions/rust-cache with: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index b247c26cb2f..e94dc62569f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -54,6 +54,8 @@ jobs: nightly: name: Nightly (${{ matrix.name }}) runs-on: ${{ matrix.runner || 'ubuntu-24.04-arm' }} + # `main` and its merge queue write the Rust cache; see .github/actions/rust-cache. + environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/gh-readonly-queue/main/')) && 'cache-write' || '' }} timeout-minutes: 60 strategy: fail-fast: false @@ -168,7 +170,7 @@ jobs: extra-substituters = https://kixelated.cachix.org extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - # Read only, like every job but cache.yml's. + # Writes from `main`, like every Rust cache user there. - name: Rust cache if: ${{ !matrix.uncached }} uses: ./.github/actions/rust-cache @@ -280,6 +282,8 @@ jobs: tests: name: Tests (${{ matrix.recipe }}) runs-on: ubuntu-24.04-arm + # `main` and its merge queue write the Rust cache; see .github/actions/rust-cache. + environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/gh-readonly-queue/main/')) && 'cache-write' || '' }} timeout-minutes: 60 strategy: fail-fast: false @@ -330,6 +334,8 @@ jobs: media-engines: name: Media (${{ matrix.engine }} player) runs-on: ubuntu-24.04-arm + # `main` and its merge queue write the Rust cache; see .github/actions/rust-cache. + environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/gh-readonly-queue/main/')) && 'cache-write' || '' }} timeout-minutes: 60 strategy: fail-fast: false @@ -348,6 +354,9 @@ jobs: extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - name: Rust cache uses: ./.github/actions/rust-cache + with: + access-key-id: ${{ secrets.MBX_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.MBX_R2_SECRET_ACCESS_KEY }} - name: Install publisher and player engines run: nix develop --command bash -c "bun install --frozen-lockfile && bunx playwright install --with-deps chromium ${{ matrix.engine }}" - name: Media and negative controls @@ -375,10 +384,12 @@ jobs: # Plays the matrix in headless Chromium and the native player through moq-shaper # and grades what the listener heard against test/audio-quality/budgets.json. - # ARM64 like wasm.yml, the only architecture cache.yml warms a Rust store for. + # ARM64 like wasm.yml. audio-quality: name: Audio quality runs-on: ubuntu-24.04-arm + # `main` and its merge queue write the Rust cache; see .github/actions/rust-cache. + environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/gh-readonly-queue/main/')) && 'cache-write' || '' }} # Thirty-six rows at a minute each, plus the relay, CLI, and shaper built from source. timeout-minutes: 90 steps: @@ -531,6 +542,8 @@ jobs: # Measures what these release jobs upload rather than rebuilding it. needs: [release-py-ffi, release-shared-ffi, release-moq-c, release-moq-relay, release-moq-cli] runs-on: ubuntu-24.04-arm + # `main` and its merge queue write the Rust cache; see .github/actions/rust-cache. + environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/gh-readonly-queue/main/')) && 'cache-write' || '' }} timeout-minutes: 120 permissions: contents: read diff --git a/.github/workflows/obs.yml b/.github/workflows/obs.yml index 994ddb09a70..c9cff749e2f 100644 --- a/.github/workflows/obs.yml +++ b/.github/workflows/obs.yml @@ -94,6 +94,8 @@ jobs: name: OBS if: github.event.action != 'closed' runs-on: ubuntu-24.04-arm + # `main` and its merge queue write the Rust cache; see .github/actions/rust-cache. + environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/gh-readonly-queue/main/')) && 'cache-write' || '' }} timeout-minutes: 60 steps: @@ -111,7 +113,7 @@ jobs: extra-substituters = https://kixelated.cachix.org extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - # Read only: cache.yml warms the R2 cache from `main`. It holds dev-profile + # Pull requests read and `main` pushes write. The cache holds dev-profile # artifacts, which is why `just obs ci` builds moq-ffi in debug rather # than the preset's release. - name: Rust cache diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 0bf3231f878..d265d60093b 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -85,6 +85,8 @@ jobs: if: needs.scope.outputs.rs == 'true' || needs.scope.outputs.cpp == 'true' || needs.scope.outputs.obs == 'true' # OBS uses the Visual Studio 17 2022 CMake generator. runs-on: windows-2022 + # `main` and its merge queue write the Rust cache; see .github/actions/rust-cache. + environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/gh-readonly-queue/main/')) && 'cache-write' || '' }} # The suites run serially; the full macOS suite measured 43 min without a Rust cache. timeout-minutes: 90 steps: @@ -105,7 +107,8 @@ jobs: uses: taiki-e/install-action@ab6895351a88b908e96a4697860d4ffea5e57dbe # v2.87.27 with: tool: nextest@0.9.146 - # Read only: cache.yml warms these platforms from `main`. + # The merge queue and Nightly write these platforms; `release` pull + # requests read. - name: Rust cache uses: ./.github/actions/rust-cache with: @@ -137,6 +140,8 @@ jobs: needs: scope if: needs.scope.outputs.rs == 'true' || needs.scope.outputs.swift == 'true' || needs.scope.outputs.obs == 'true' || needs.scope.outputs.moq_sh == 'true' runs-on: macos-latest + # `main` and its merge queue write the Rust cache; see .github/actions/rust-cache. + environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/gh-readonly-queue/main/')) && 'cache-write' || '' }} timeout-minutes: 90 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/.github/workflows/release-rs.yml b/.github/workflows/release-rs.yml index 8b85f9f1bcd..c3288af3104 100644 --- a/.github/workflows/release-rs.yml +++ b/.github/workflows/release-rs.yml @@ -74,7 +74,7 @@ jobs: extra-substituters = https://kixelated.cachix.org extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - # Read only: cache.yml warms the R2 cache from `main`. Crates publish as + # Read only: `release` is not a writer. Crates publish as # source, so nothing this reads ends up in a release. # # The action's shim is what gets mbx in here at all. release-plz spawns diff --git a/.github/workflows/ts.yml b/.github/workflows/ts.yml index f58590a463e..a20554b95e2 100644 --- a/.github/workflows/ts.yml +++ b/.github/workflows/ts.yml @@ -57,6 +57,8 @@ jobs: ts: name: TS validation runs-on: ubuntu-latest + # `main` and its merge queue write the Rust cache; see .github/actions/rust-cache. + environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/gh-readonly-queue/main/')) && 'cache-write' || '' }} timeout-minutes: 60 steps: - name: Checkout diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 93401e60ab5..127c8d9bfa3 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -68,7 +68,7 @@ jobs: name: WASM if: github.event.action != 'closed' # ARM64 like check.yml; the harness builds the relay natively, which the - # check warm covers. + # merge queue's Check and Test publish. runs-on: ubuntu-24.04-arm timeout-minutes: 60 @@ -87,7 +87,7 @@ jobs: extra-substituters = https://kixelated.cachix.org extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - # Read only: cache.yml warms the R2 cache from `main`. + # Read only: this runs on pull requests alone. - name: Rust cache uses: ./.github/actions/rust-cache with: diff --git a/.github/workflows/x11.yml b/.github/workflows/x11.yml index 79483950d31..27d90f649f2 100644 --- a/.github/workflows/x11.yml +++ b/.github/workflows/x11.yml @@ -26,6 +26,8 @@ jobs: capture: name: SHM and GetImage runs-on: ubuntu-24.04-arm + # `main` and its merge queue write the Rust cache; see .github/actions/rust-cache. + environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/gh-readonly-queue/main/')) && 'cache-write' || '' }} timeout-minutes: 30 steps: - name: Checkout diff --git a/infra/README.md b/infra/README.md index 67cd13b429f..43456aec06a 100644 --- a/infra/README.md +++ b/infra/README.md @@ -109,13 +109,20 @@ regenerates the repository metadata, signs it, and uploads the diff. ## Bootstrapping the Rust build cache `.github/actions/rust-cache` points mbx at the private `mbx-moq-dev` bucket, -namespaced per runner OS and architecture. Only `cache.yml`, on a push to -`main`, writes. Everything else reads, and fork pull requests, which get no -secrets, build cold. The write key is what enforces that: it lives in a GitHub -Environment that only `main` can deploy to. mbx refusing to publish outside -a protected-branch push is a second guard, not the boundary. +namespaced per runner OS and architecture. Every job that runs on `main` or in +its merge queue (`gh-readonly-queue/main/*`) writes what it compiles: a queued +pull request is about to become `main`, so its code is trusted like `main`'s. +Pull request jobs only read, and fork pull requests, which get no secrets, +build cold. -All of this runs once, by a maintainer: +The write key is what enforces that: it lives in a GitHub Environment that +only those refs can deploy to, and each writer job names that Environment only +when it runs on one of them. mbx on its own trusts only a push to a protected +branch, which leaves out the queue and Nightly's schedule, so the action sets +`MBX_REMOTE_TRUST_WRITES` for writers and the Environment is the only boundary. + +All of this runs once, by a maintainer. Steps 1, 2, and 4 are done, and step 3 +is done for `main`. 1. **Create the bucket and its lifecycle rule** under your `wrangler login`: @@ -126,8 +133,8 @@ All of this runs once, by a maintainer: `lifecycle.json` deletes every object 30 days after upload and aborts multipart uploads left incomplete for a day. mbx writes each compilation once and never refreshes it, so a result still in use expires too; the - next `main` warm that misses it compiles and uploads it again. After - editing the rules, `just infra mbx lifecycle` applies them. + next writer that misses it compiles and uploads it again. After editing + the rules, `just infra mbx lifecycle` applies them. 2. **Create two R2 API tokens** in the dashboard (R2 -> Manage API tokens -> Create Account API token), both scoped to `mbx-moq-dev` only. Wrangler @@ -137,9 +144,9 @@ All of this runs once, by a maintainer: - `mbx-read`: **Object Read only**. - `mbx-write`: **Object Read & Write**. -3. **Create the `cache-write` Environment**, deployable from `main` only. A - protected-branches policy would admit `release` as well, so name `main` - instead: +3. **Create the `cache-write` Environment**, deployable from `main` and its + merge queue only. A protected-branches policy would admit `release` as + well, so name the branches instead: ```bash gh api -X PUT repos/moq-dev/moq/environments/cache-write --input - <<'EOF' @@ -147,10 +154,15 @@ All of this runs once, by a maintainer: EOF gh api -X POST repos/moq-dev/moq/environments/cache-write/deployment-branch-policies \ -f name=main -f type=branch + gh api -X POST repos/moq-dev/moq/environments/cache-write/deployment-branch-policies \ + -f name='gh-readonly-queue/main/*' -f type=branch ``` + Without the queue policy, every merge queue job that writes fails before + it starts, and the queue merges nothing. + 4. **Store the keys under the same two names at both levels.** An Environment - secret shadows a repository secret of the same name, so `cache.yml` gets the + secret shadows a repository secret of the same name, so writers get the write key and every other job the read key, all through one pair of names: ```bash @@ -163,9 +175,9 @@ All of this runs once, by a maintainer: gh secret set MBX_R2_SECRET_ACCESS_KEY --repo moq-dev/moq ``` -Without the repository secrets, readers warn and build cold. Without the -Environment, `cache.yml` fails rather than warm nothing, and so does a key the -bucket refuses, in any job. +Without the repository secrets, readers warn and build cold. A writer without +its key fails rather than publish nothing, and so does a key the bucket +refuses, in any job. ## Rotating the signing key diff --git a/quest/m0/ci/README.md b/quest/m0/ci/README.md index 78915b9524f..753449a413a 100644 --- a/quest/m0/ci/README.md +++ b/quest/m0/ci/README.md @@ -29,13 +29,6 @@ dry run on PRs (five macOS builds per run). On Linux the PR Check and Test jobs and the `cache.yml` warm dominate. A branch's PR Check runs a median 2 and a p90 5 times before it merges. -`cache.yml` has not published since 2026-10-11: its save step only runs when -the warm's `just ci check --all` and `just ci test --all` pass, and a -formatting slip and a flaky test on `main` blocked it. OBS on a `main` push -also saved into the same shared key space, so PRs restored its sliver of the -workspace. #5428 lets the warm save regardless and stops OBS saving; a -compile-only warm can follow if the warm's runtime matters. - Decisions (maintainer, 2026-10-13): - macOS and Windows run in the merge queue, not on every PR push. The fast @@ -48,6 +41,9 @@ Decisions (maintainer, 2026-10-13): signing key), so a pull request job cannot read them even from the same repository. Fork PRs get no secrets and run uncached. +- Decided 2026-10-19: the merge queue is trusted like `main`, since a queued + PR is about to land. Rust cache writers are the jobs on `main` and in its + queue, and no separate warm rebuilds what landed. - Self-hosted CI is dropped: hosted runners plus the R2 caches replace the spare-desktop runner, its cache server, and the cache release it waited on. diff --git a/quest/m0/ci/mbx-r2-verify.md b/quest/m0/ci/mbx-r2-verify.md index 70765e83d8d..1d831a0e397 100644 --- a/quest/m0/ci/mbx-r2-verify.md +++ b/quest/m0/ci/mbx-r2-verify.md @@ -2,20 +2,23 @@ ## Goal -Condition: a maintainer has run the `mbx-moq-dev` bootstrap in -`infra/README.md` (bucket, lifecycle rule, both R2 tokens, the `cache-write` -Environment and its secrets), and `cache.yml` has warmed every leg from `main` -since. Check it with `gh run list --workflow cache.yml --branch main`. +Condition: the `mbx-moq-dev` bootstrap in `infra/README.md` is complete, +including the `cache-write` Environment's `gh-readonly-queue/main/*` branch +policy, and the merge queue has merged Rust changes since. Check it with +`gh run list --workflow check.yml --event merge_group`. Then confirm the cache earns its keep, and record the numbers in the PR that closes this: -- Each warm's `Check the cache` step reports `effective read-write`, and a - pull request's reports `effective read-only`. +- Each merge queue and `main` job's `Check the cache` step reports + `effective read-write`, and a pull request's reports `effective read-only`. - Check, Test, and the macOS and Windows merge queue jobs show mbx remote hits for code the pull request did not touch. - Restore plus build time against the 150-210s Actions restore of the ~6 GB store it replaced, from the same diff before and after. +- Each object expires 30 days after upload, and the queue builds only what + its diff selects, so an expired crate stays cold until a queue or `main` + job builds it again. Count how often a pull request pays that rebuild. - Bucket size and request counts after a month, against the 30-day expiry in `infra/mbx/lifecycle.json`. Shorten or lengthen it from that. From 41639e00b22aa7ec3e0c8e11f64315a066f1f7db Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Mon, 19 Oct 2026 22:21:16 -0700 Subject: [PATCH 4/4] ci(rust-cache): fail on half an R2 credential pair A missing access key id or secret on its own was treated like a fork's empty credentials, so a broken secret built every reader cold without an error. Only both empty is the fork case now; one empty fails. Co-Authored-By: Claude Opus 5.5 --- .github/actions/rust-cache/action.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/actions/rust-cache/action.yml b/.github/actions/rust-cache/action.yml index 3f35f6794e5..6580c8d4b14 100644 --- a/.github/actions/rust-cache/action.yml +++ b/.github/actions/rust-cache/action.yml @@ -25,7 +25,8 @@ runs: # repository. Fork pull requests get no secrets at all and build cold. # # A writer without a key means the Environment is misconfigured, and - # building on would leave every reader cold with nothing to say why. + # building on would leave every reader cold with nothing to say why. Half + # a pair is a broken secret on any job, never a fork's empty one. - name: Cache credentials shell: bash env: @@ -33,7 +34,7 @@ runs: SECRET: ${{ inputs.secret-access-key }} WRITE: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/gh-readonly-queue/main/') }} run: | - if [ -z "$KEY_ID" ] || [ -z "$SECRET" ]; then + if [ -z "$KEY_ID" ] && [ -z "$SECRET" ]; then if [ "$WRITE" = "true" ]; then echo "::error::$GITHUB_REF writes the cache but the cache-write Environment supplied no R2 key" exit 1 @@ -41,6 +42,10 @@ runs: echo "::warning::No R2 cache credentials, as for a fork pull request; building cold" exit 0 fi + if [ -z "$KEY_ID" ] || [ -z "$SECRET" ]; then + echo "::error::only one of the R2 access key id and secret is set; check the MBX_R2_* secrets" + exit 1 + fi { echo "AWS_ACCESS_KEY_ID=$KEY_ID" echo "AWS_SECRET_ACCESS_KEY=$SECRET"