From db6a2e8f3f123d9ad3a060ee6c3de099256b8bf9 Mon Sep 17 00:00:00 2001 From: Taylor Mutch Date: Fri, 20 Nov 2026 15:30:16 -0800 Subject: [PATCH 01/10] ci: exercise branch checks on gke runners Signed-off-by: Taylor Mutch --- .agents/skills/watch-github-actions/SKILL.md | 10 +++ .github/actionlint.yml | 1 + .github/actions/setup-rust/action.yml | 13 ++++ .github/workflows/branch-checks.yml | 74 ++++++++++++++------ CI.md | 15 +++- 5 files changed, 90 insertions(+), 23 deletions(-) diff --git a/.agents/skills/watch-github-actions/SKILL.md b/.agents/skills/watch-github-actions/SKILL.md index 4b03fb5b32..68eca2ec88 100644 --- a/.agents/skills/watch-github-actions/SKILL.md +++ b/.agents/skills/watch-github-actions/SKILL.md @@ -131,6 +131,16 @@ gh run list --json databaseId,status,headBranch,url --jq '.[] | {id: .databaseId `Release Dev` finishes its active run and replaces pending runs when new commits arrive. Other callers retain E2E cancellation. Inspect job annotations for cancellation reasons. +## GKE runner trial + +Branch Checks Linux amd64 jobs from ai-openshell/openshell branches run on the +`openshell-ci-amd64` ARC scale set during the GKE trial. Fork, ARM, and macOS jobs +keep their hosted runners. Confirm the runner name in the job details before +attributing a result to GKE. For a job-container or PostgreSQL startup failure, +check the runner pod's Docker sidecar first. Rust jobs report shared memcached +sccache statistics; distinguish backend connectivity errors from compiler/test +failures. See `CI.md` for the trial scope and cache setup. + ## View Job Logs For Branch Checks `Reviewer Roster` failures, the log lists non-collaborators in diff --git a/.github/actionlint.yml b/.github/actionlint.yml index 31c5f55713..d36e985cea 100644 --- a/.github/actionlint.yml +++ b/.github/actionlint.yml @@ -3,6 +3,7 @@ self-hosted-runner: labels: + - openshell-ci-amd64 - ubuntu-26.04 - windows-arm64 diff --git a/.github/actions/setup-rust/action.yml b/.github/actions/setup-rust/action.yml index 10e76ed63c..d8ca8ac0a9 100644 --- a/.github/actions/setup-rust/action.yml +++ b/.github/actions/setup-rust/action.yml @@ -21,6 +21,19 @@ outputs: runs: using: composite steps: + - name: Configure shared sccache on GKE runners + if: ${{ runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + shell: nix develop -c bash -euo pipefail {0} + run: | + mise install --locked github:mozilla/sccache + sccache_bin=$(mise which sccache) + dirname "$sccache_bin" >> "$GITHUB_PATH" + { + echo "RUSTC_WRAPPER=$sccache_bin" + echo "SCCACHE_MEMCACHED_ENDPOINT=tcp://memcached.sccache:11211" + echo "SCCACHE_BASEDIRS=$GITHUB_WORKSPACE" + } >> "$GITHUB_ENV" + - name: Hash Nix development shell id: dev-shell shell: bash diff --git a/.github/workflows/branch-checks.yml b/.github/workflows/branch-checks.yml index 5505a1fa1b..1c50c2c215 100644 --- a/.github/workflows/branch-checks.yml +++ b/.github/workflows/branch-checks.yml @@ -22,7 +22,7 @@ concurrency: jobs: reviewer-roster: name: Reviewer Roster - runs-on: ubuntu-latest + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-latest' }} timeout-minutes: 5 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -59,7 +59,7 @@ jobs: ${{ !cancelled() && github.event_name == 'pull_request' && needs.compatibility-review.outputs.has_findings == 'true' && needs.compatibility-review.outputs.report_artifact != '' }} - runs-on: ubuntu-latest + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-latest' }} timeout-minutes: 5 continue-on-error: true permissions: @@ -98,7 +98,7 @@ jobs: protobuf-compatibility: name: Protobuf Compatibility - runs-on: ubuntu-24.04 + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} timeout-minutes: 15 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -116,7 +116,7 @@ jobs: monitoring-changes: name: Detect monitoring mixin changes - runs-on: ubuntu-latest + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-latest' }} timeout-minutes: 5 outputs: changed: ${{ steps.changes.outputs.changed }} @@ -153,7 +153,7 @@ jobs: name: Monitoring Mixin needs: monitoring-changes if: needs.monitoring-changes.outputs.changed == 'true' - runs-on: ubuntu-24.04 + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} timeout-minutes: 15 container: image: ghcr.io/ai-openshell/openshell/ci:82e753ba3ffdfb40c118e7cb416ced7f350381d5@sha256:d816f3b4b2de675928e2ecfd26ec6b937be35fe9986542c87d440bc3de5a29de @@ -174,7 +174,7 @@ jobs: mise-lockfile: name: mise Lockfile - runs-on: ubuntu-24.04 + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} timeout-minutes: 30 container: image: ghcr.io/ai-openshell/openshell/ci:82e753ba3ffdfb40c118e7cb416ced7f350381d5@sha256:d816f3b4b2de675928e2ecfd26ec6b937be35fe9986542c87d440bc3de5a29de @@ -197,7 +197,7 @@ jobs: license-headers: name: License Headers - runs-on: ubuntu-24.04 + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} timeout-minutes: 30 container: image: ghcr.io/ai-openshell/openshell/ci:82e753ba3ffdfb40c118e7cb416ced7f350381d5@sha256:d816f3b4b2de675928e2ecfd26ec6b937be35fe9986542c87d440bc3de5a29de @@ -215,7 +215,7 @@ jobs: cargo-deny: name: Cargo Deny - runs-on: ubuntu-24.04 + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} timeout-minutes: 30 defaults: run: @@ -243,7 +243,7 @@ jobs: rust-format: name: Rust format - runs-on: ubuntu-24.04 + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} timeout-minutes: 15 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -272,7 +272,7 @@ jobs: cargo-lockfiles: name: Cargo lockfiles - runs-on: ubuntu-24.04 + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} timeout-minutes: 15 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -294,7 +294,7 @@ jobs: fail-fast: false matrix: include: - - runner: ubuntu-24.04 + - runner: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} system: x86_64-linux - runner: ubuntu-24.04-arm system: aarch64-linux @@ -332,13 +332,17 @@ jobs: cargo clippy --locked --manifest-path tests/suites/features/Cargo.toml --workspace --all-targets -- -D warnings cargo clippy --locked --manifest-path tests/support/Cargo.toml --all-targets -- -D warnings + - name: Shared sccache statistics + if: ${{ always() && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + run: sccache --show-stats + rust-test: name: Rust test (${{ matrix.system }}) strategy: fail-fast: false matrix: include: - - runner: ubuntu-24.04 + - runner: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} system: x86_64-linux - runner: ubuntu-24.04-arm system: aarch64-linux @@ -421,11 +425,15 @@ jobs: cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/support/Cargo.toml tasks/scripts/check-conformance-program.sh + - name: Shared sccache statistics + if: ${{ always() && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + run: sccache --show-stats + rust-postgres-test: name: Rust PostgreSQL tests # Bare runner: the test script starts a disposable PostgreSQL container # with the host's Docker. - runs-on: ubuntu-24.04 + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} timeout-minutes: 30 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -449,13 +457,17 @@ jobs: OPENSHELL_TELEMETRY_ENABLED: "false" run: tasks/scripts/run-postgres-tests.sh --locked --profile ci + - name: Shared sccache statistics + if: ${{ always() && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + run: sccache --show-stats + rust-build-modes: name: Rust build modes (${{ matrix.system }}) strategy: fail-fast: false matrix: include: - - runner: ubuntu-24.04 + - runner: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} system: x86_64-linux - runner: ubuntu-24.04-arm system: aarch64-linux @@ -507,9 +519,13 @@ jobs: exit 1 fi + - name: Shared sccache statistics + if: ${{ always() && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + run: sccache --show-stats + rust-feature-alias: name: Rust feature alias - runs-on: ubuntu-24.04 + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} timeout-minutes: 30 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -530,9 +546,13 @@ jobs: tasks/scripts/verify-defaults-without-telemetry.sh git diff --exit-code HEAD -- ':(glob)**/Cargo.lock' + - name: Shared sccache statistics + if: ${{ always() && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + run: sccache --show-stats + rust-gateway-core-features: name: Rust gateway core features - runs-on: ubuntu-24.04 + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} timeout-minutes: 30 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -555,9 +575,13 @@ jobs: cargo nextest run --locked --profile ci -p openshell-gateway --all-targets --no-default-features --features compute-driver-kubernetes cargo nextest run --locked --profile ci -p openshell-gateway --all-targets --no-default-features --features compute-driver-podman + - name: Shared sccache statistics + if: ${{ always() && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + run: sccache --show-stats + rust-gateway-extended-features: name: Rust gateway extended features - runs-on: ubuntu-24.04 + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} timeout-minutes: 30 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -579,12 +603,18 @@ jobs: cargo nextest run --locked --profile ci -p openshell-gateway --all-targets --no-default-features --features compute-driver-mxc cargo nextest run --locked --profile ci -p openshell-gateway --all-targets --no-default-features --features compute-driver-docker,compute-driver-vm + - name: Shared sccache statistics + if: ${{ always() && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + run: sccache --show-stats + python: name: Python (${{ matrix.runner }}) strategy: fail-fast: false matrix: - runner: [ubuntu-24.04, ubuntu-24.04-arm] + runner: + - ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} + - ubuntu-24.04-arm runs-on: ${{ matrix.runner }} timeout-minutes: 30 container: @@ -635,7 +665,7 @@ jobs: # Merge queue runs skip this job; the PR already passed it. name: Python SDK Freeze if: github.event_name == 'pull_request' - runs-on: ubuntu-latest + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-latest' }} timeout-minutes: 5 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -662,7 +692,7 @@ jobs: markdown: name: Markdown - runs-on: ubuntu-24.04 + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} timeout-minutes: 30 container: image: ghcr.io/ai-openshell/openshell/ci:82e753ba3ffdfb40c118e7cb416ced7f350381d5@sha256:d816f3b4b2de675928e2ecfd26ec6b937be35fe9986542c87d440bc3de5a29de @@ -681,7 +711,7 @@ jobs: typescript-sdk-freeze: name: TypeScript SDK Freeze if: github.event_name == 'pull_request' - runs-on: ubuntu-latest + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-latest' }} timeout-minutes: 5 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -714,7 +744,7 @@ jobs: install-script: name: install.sh - runs-on: ubuntu-latest + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-latest' }} timeout-minutes: 10 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/CI.md b/CI.md index cab896eefd..77a41a6e25 100644 --- a/CI.md +++ b/CI.md @@ -6,7 +6,20 @@ For local test commands see [TESTING.md](TESTING.md). For PR conventions see [CO ## Overview -PR CI runs on standard GitHub-hosted runners. `Branch Checks` and `Helm Lint` trigger on `pull_request` and `merge_group`. Workflow runs from outside contributors wait for a maintainer to approve them in the Actions tab. +`Branch Checks` uses the `openshell-ci-amd64` GKE ARC scale set for Linux amd64 +jobs from branches in `ai-openshell/openshell`, manual runs, and merge groups. +Fork PRs use GitHub-hosted runners; ARM and macOS jobs keep their existing +runner labels. This is a branch trial and does not change main until merged. +`Branch Checks` and `Helm Lint` trigger on `pull_request` and `merge_group`. +Workflow runs from outside contributors wait for a maintainer to approve them +in the Actions tab. + +The GKE scale set maintains five idle runners and permits twenty total. Each +runner has an isolated Docker daemon for job containers and Docker-backed tests. +Rust jobs use the shared memcached sccache backend and report cache statistics; +the existing GitHub Rust target/registry cache remains enabled. Inspect the job's +runner name to confirm whether it ran on GKE. ARM, macOS, and fork jobs do not +use the cluster-local cache endpoint. `pull_request` runs from forks get a read-only token and no secrets, so they cannot post statuses. `Required CI Gates` runs from the base repository (`pull_request_target` and `workflow_run`), never checks out PR code, and posts the required `OpenShell / ...` statuses on the PR head SHA. E2E suites are opt-in because they are more expensive. From 0e060237d039b0c9873dd9af3780fc8ba20b4068 Mon Sep 17 00:00:00 2001 From: Taylor Mutch Date: Fri, 20 Nov 2026 15:34:58 -0800 Subject: [PATCH 02/10] ci: guard cache statistics until setup succeeds Signed-off-by: Taylor Mutch --- .agents/skills/watch-github-actions/SKILL.md | 4 +++- .github/workflows/branch-checks.yml | 14 +++++++------- CI.md | 2 ++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.agents/skills/watch-github-actions/SKILL.md b/.agents/skills/watch-github-actions/SKILL.md index 68eca2ec88..1538bf90a5 100644 --- a/.agents/skills/watch-github-actions/SKILL.md +++ b/.agents/skills/watch-github-actions/SKILL.md @@ -137,7 +137,9 @@ Branch Checks Linux amd64 jobs from ai-openshell/openshell branches run on the `openshell-ci-amd64` ARC scale set during the GKE trial. Fork, ARM, and macOS jobs keep their hosted runners. Confirm the runner name in the job details before attributing a result to GKE. For a job-container or PostgreSQL startup failure, -check the runner pod's Docker sidecar first. Rust jobs report shared memcached +check the runner pod's Docker sidecar first. A missing `gh` executable or +Cachix's `$USER must be set` error indicates incomplete runner bootstrap. +Rust jobs report shared memcached sccache statistics; distinguish backend connectivity errors from compiler/test failures. See `CI.md` for the trial scope and cache setup. diff --git a/.github/workflows/branch-checks.yml b/.github/workflows/branch-checks.yml index 1c50c2c215..f85b8568a8 100644 --- a/.github/workflows/branch-checks.yml +++ b/.github/workflows/branch-checks.yml @@ -333,7 +333,7 @@ jobs: cargo clippy --locked --manifest-path tests/support/Cargo.toml --all-targets -- -D warnings - name: Shared sccache statistics - if: ${{ always() && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} run: sccache --show-stats rust-test: @@ -426,7 +426,7 @@ jobs: tasks/scripts/check-conformance-program.sh - name: Shared sccache statistics - if: ${{ always() && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} run: sccache --show-stats rust-postgres-test: @@ -458,7 +458,7 @@ jobs: run: tasks/scripts/run-postgres-tests.sh --locked --profile ci - name: Shared sccache statistics - if: ${{ always() && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} run: sccache --show-stats rust-build-modes: @@ -520,7 +520,7 @@ jobs: fi - name: Shared sccache statistics - if: ${{ always() && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} run: sccache --show-stats rust-feature-alias: @@ -547,7 +547,7 @@ jobs: git diff --exit-code HEAD -- ':(glob)**/Cargo.lock' - name: Shared sccache statistics - if: ${{ always() && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} run: sccache --show-stats rust-gateway-core-features: @@ -576,7 +576,7 @@ jobs: cargo nextest run --locked --profile ci -p openshell-gateway --all-targets --no-default-features --features compute-driver-podman - name: Shared sccache statistics - if: ${{ always() && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} run: sccache --show-stats rust-gateway-extended-features: @@ -604,7 +604,7 @@ jobs: cargo nextest run --locked --profile ci -p openshell-gateway --all-targets --no-default-features --features compute-driver-docker,compute-driver-vm - name: Shared sccache statistics - if: ${{ always() && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} run: sccache --show-stats python: diff --git a/CI.md b/CI.md index 77a41a6e25..e81f01c314 100644 --- a/CI.md +++ b/CI.md @@ -16,6 +16,8 @@ in the Actions tab. The GKE scale set maintains five idle runners and permits twenty total. Each runner has an isolated Docker daemon for job containers and Docker-backed tests. +Runner bootstrap provides GitHub CLI, compression utilities, and the `USER` +environment variable expected by the existing checks and Cachix. Rust jobs use the shared memcached sccache backend and report cache statistics; the existing GitHub Rust target/registry cache remains enabled. Inspect the job's runner name to confirm whether it ran on GKE. ARM, macOS, and fork jobs do not From 94b9950ba047f1ca149fd690104ddfc6d9035a4d Mon Sep 17 00:00:00 2001 From: Taylor Mutch Date: Fri, 20 Nov 2026 16:19:03 -0800 Subject: [PATCH 03/10] ci: reuse the image-configured nix cache on gke runners Signed-off-by: Taylor Mutch --- .agents/skills/watch-github-actions/SKILL.md | 4 +++- .github/actions/setup-nix/action.yml | 8 ++++++++ CI.md | 4 +++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.agents/skills/watch-github-actions/SKILL.md b/.agents/skills/watch-github-actions/SKILL.md index 1538bf90a5..d7fd806fd6 100644 --- a/.agents/skills/watch-github-actions/SKILL.md +++ b/.agents/skills/watch-github-actions/SKILL.md @@ -139,7 +139,9 @@ keep their hosted runners. Confirm the runner name in the job details before attributing a result to GKE. For a job-container or PostgreSQL startup failure, check the runner pod's Docker sidecar first. A missing `gh` executable or Cachix's `$USER must be set` error indicates incomplete runner bootstrap. -Rust jobs report shared memcached +For a preloaded image, `setup-nix` verifies its global Cachix substituter and +skips adding it again. A cache-configuration permission failure indicates the +image/setup contract is out of sync. Rust jobs report shared memcached sccache statistics; distinguish backend connectivity errors from compiler/test failures. See `CI.md` for the trial scope and cache setup. diff --git a/.github/actions/setup-nix/action.yml b/.github/actions/setup-nix/action.yml index 0ae11edfe9..a321066770 100644 --- a/.github/actions/setup-nix/action.yml +++ b/.github/actions/setup-nix/action.yml @@ -32,9 +32,17 @@ runs: extra-conf: | http2 = false + - name: Verify GKE image cache configuration + if: ${{ startsWith(runner.name, 'openshell-ci-amd64-') }} + shell: bash + run: | + nix config show --json | jq -e '.substituters.value | index("https://openshell.cachix.org") != null' > /dev/null + - uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17 with: name: openshell + # The image configures the substituter globally before dropping to runner. + skipAddingSubstituter: ${{ startsWith(runner.name, 'openshell-ci-amd64-') }} authToken: ${{ inputs.cachix-auth-token }} skipPush: ${{ inputs.cachix-auth-token == '' }} diff --git a/CI.md b/CI.md index e81f01c314..5fbbaa46d2 100644 --- a/CI.md +++ b/CI.md @@ -17,7 +17,9 @@ in the Actions tab. The GKE scale set maintains five idle runners and permits twenty total. Each runner has an isolated Docker daemon for job containers and Docker-backed tests. Runner bootstrap provides GitHub CLI, compression utilities, and the `USER` -environment variable expected by the existing checks and Cachix. +environment variable expected by the existing checks and Cachix. The custom +image preloads Nix shells and configures the signed Cachix substituter globally; +setup verifies that cache and skips duplicate user-level cache configuration. Rust jobs use the shared memcached sccache backend and report cache statistics; the existing GitHub Rust target/registry cache remains enabled. Inspect the job's runner name to confirm whether it ran on GKE. ARM, macOS, and fork jobs do not From e986dce7b3b7af8c1e82bfeec3c2dd7f0837d1f8 Mon Sep 17 00:00:00 2001 From: Taylor Mutch Date: Fri, 20 Nov 2026 16:57:45 -0800 Subject: [PATCH 04/10] ci: trial workspace artifact caches for gke lint and tests Signed-off-by: Taylor Mutch --- .agents/skills/watch-github-actions/SKILL.md | 5 ++++- .github/actions/setup-rust/action.yml | 5 +++++ .github/workflows/branch-checks.yml | 10 +++++++--- CI.md | 8 +++++++- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.agents/skills/watch-github-actions/SKILL.md b/.agents/skills/watch-github-actions/SKILL.md index d7fd806fd6..79a91a99d8 100644 --- a/.agents/skills/watch-github-actions/SKILL.md +++ b/.agents/skills/watch-github-actions/SKILL.md @@ -143,7 +143,10 @@ For a preloaded image, `setup-nix` verifies its global Cachix substituter and skips adding it again. A cache-configuration permission failure indicates the image/setup contract is out of sync. Rust jobs report shared memcached sccache statistics; distinguish backend connectivity errors from compiler/test -failures. See `CI.md` for the trial scope and cache setup. +failures. The x86 GKE lint/test jobs also trial separate full Cargo artifact +caches. Confirm the restored key and cache size in setup-rust, and include the +post-job save time when comparing cold and warm runs. A hit does not guarantee +Cargo will reuse every artifact. See `CI.md` for the trial scope and cache setup. ## View Job Logs diff --git a/.github/actions/setup-rust/action.yml b/.github/actions/setup-rust/action.yml index d8ca8ac0a9..5617e3f4c8 100644 --- a/.github/actions/setup-rust/action.yml +++ b/.github/actions/setup-rust/action.yml @@ -12,6 +12,10 @@ inputs: description: Whether this job writes the Rust target cache required: false default: "false" + cache-workspace-crates: + description: Retain workspace build artifacts as well as dependencies + required: false + default: "false" outputs: cache-hit: @@ -49,4 +53,5 @@ runs: save-if: ${{ inputs.save-cache }} cache-on-failure: ${{ inputs.save-cache }} cache-bin: "false" + cache-workspace-crates: ${{ inputs.cache-workspace-crates }} cmd-format: nix develop -c {0} diff --git a/.github/workflows/branch-checks.yml b/.github/workflows/branch-checks.yml index f85b8568a8..7e64f05349 100644 --- a/.github/workflows/branch-checks.yml +++ b/.github/workflows/branch-checks.yml @@ -312,8 +312,10 @@ jobs: - uses: ./.github/actions/setup-rust with: - cache-key: rust-checks-v2 - save-cache: "false" + # Trial full artifacts only on GKE; retain hosted cache behavior. + cache-key: ${{ matrix.runner == 'openshell-ci-amd64' && 'gke-rust-lint-artifacts-v1' || 'rust-checks-v2' }} + save-cache: ${{ matrix.runner == 'openshell-ci-amd64' && 'true' || 'false' }} + cache-workspace-crates: ${{ matrix.runner == 'openshell-ci-amd64' && 'true' || 'false' }} - name: Lint shell: nix develop -c bash -euo pipefail {0} @@ -360,8 +362,10 @@ jobs: - uses: ./.github/actions/setup-rust with: - cache-key: rust-checks-v2 + # Trial full artifacts only on GKE; retain hosted cache behavior. + cache-key: ${{ matrix.runner == 'openshell-ci-amd64' && 'gke-rust-test-artifacts-v1' || 'rust-checks-v2' }} save-cache: "true" + cache-workspace-crates: ${{ matrix.runner == 'openshell-ci-amd64' && 'true' || 'false' }} - name: Verify crypto backend independence shell: nix develop -c bash -euo pipefail {0} diff --git a/CI.md b/CI.md index 5fbbaa46d2..510274bcbc 100644 --- a/CI.md +++ b/CI.md @@ -21,7 +21,13 @@ environment variable expected by the existing checks and Cachix. The custom image preloads Nix shells and configures the signed Cachix substituter globally; setup verifies that cache and skips duplicate user-level cache configuration. Rust jobs use the shared memcached sccache backend and report cache statistics; -the existing GitHub Rust target/registry cache remains enabled. Inspect the job's +the existing GitHub Rust target/registry cache remains enabled. The x86 GKE +lint and test jobs trial separate `gke-rust-*-artifacts-v1` cache namespaces, +retain workspace crates in the root target directory. Independent-workspace +targets continue using sccache without expanding the artifact cache trial. +Compare a populating run with a same-commit rerun, including restore/save time: +checkout timestamps and build-script invalidation can still trigger rebuilds. +These trial caches are PR-scoped until compatible caches are seeded on `main`. Inspect the job's runner name to confirm whether it ran on GKE. ARM, macOS, and fork jobs do not use the cluster-local cache endpoint. From 112082143e55cca1fa0be3e66b9d8f287198cb85 Mon Sep 17 00:00:00 2001 From: Taylor Mutch Date: Sat, 21 Nov 2026 08:50:02 -0800 Subject: [PATCH 05/10] ci: trial persistent cargo targets on dedicated gke runners Signed-off-by: Taylor Mutch --- .agents/skills/watch-github-actions/SKILL.md | 11 +++++++---- .github/actions/setup-rust/action.yml | 20 ++++++++++++++++++++ .github/workflows/branch-checks.yml | 14 +++++--------- CI.md | 19 ++++++++++++------- 4 files changed, 44 insertions(+), 20 deletions(-) diff --git a/.agents/skills/watch-github-actions/SKILL.md b/.agents/skills/watch-github-actions/SKILL.md index 79a91a99d8..c73ede5b62 100644 --- a/.agents/skills/watch-github-actions/SKILL.md +++ b/.agents/skills/watch-github-actions/SKILL.md @@ -143,10 +143,13 @@ For a preloaded image, `setup-nix` verifies its global Cachix substituter and skips adding it again. A cache-configuration permission failure indicates the image/setup contract is out of sync. Rust jobs report shared memcached sccache statistics; distinguish backend connectivity errors from compiler/test -failures. The x86 GKE lint/test jobs also trial separate full Cargo artifact -caches. Confirm the restored key and cache size in setup-rust, and include the -post-job save time when comparing cold and warm runs. A hit does not guarantee -Cargo will reuse every artifact. See `CI.md` for the trial scope and cache setup. +failures. The x86 GKE lint/test jobs use single-worker `openshell-ci-amd64-pd-*` +scale sets with separate exclusive persistent disks. Setup reports the target +size before building and skips GitHub Cargo cache restore/save. Compare empty +and warm runs on different runner pods; a PVC surviving pod replacement is the +persistence check. `Pending` pods can be waiting for exclusive disk attachment; +inspect PVC/PV events before treating this as a runner registration failure. +See `CI.md` for trial scope and cache setup. ## View Job Logs diff --git a/.github/actions/setup-rust/action.yml b/.github/actions/setup-rust/action.yml index 5617e3f4c8..abe075d0f3 100644 --- a/.github/actions/setup-rust/action.yml +++ b/.github/actions/setup-rust/action.yml @@ -45,7 +45,27 @@ runs: shell_drv=$(nix eval --raw --impure .#devShells --apply 'shells: shells.${builtins.currentSystem}.default.drvPath') echo "hash=$(nix hash file --type sha256 --base16 "$shell_drv")" >> "$GITHUB_OUTPUT" + - name: Configure persistent Cargo target directory + if: ${{ env.OPENSHELL_PERSISTENT_CACHE != '' }} + shell: bash + env: + NIX_SHELL_HASH: ${{ steps.dev-shell.outputs.hash }} + run: | + set -euo pipefail + test "$GITHUB_REPOSITORY" = ai-openshell/openshell + test "$OPENSHELL_PERSISTENT_CACHE" = /mnt/ci-cache + mountpoint -q "$OPENSHELL_PERSISTENT_CACHE" + cache_root="$OPENSHELL_PERSISTENT_CACHE/ai-openshell-openshell/$NIX_SHELL_HASH" + mkdir -p "$cache_root/target" + echo "CARGO_TARGET_DIR=$cache_root/target" >> "$GITHUB_ENV" + echo "Persistent cache lane: $OPENSHELL_CACHE_LANE" + echo "Runner pod: $RUNNER_NAME" + echo "Target directory: $cache_root/target" + du -sh "$cache_root/target" + df -h "$cache_root/target" + - name: Cache Rust target and registry + if: ${{ env.OPENSHELL_PERSISTENT_CACHE == '' }} id: cache uses: Swatinem/rust-cache@6a7bc3ebce750e0a16a430dd57485acfdb38b05f with: diff --git a/.github/workflows/branch-checks.yml b/.github/workflows/branch-checks.yml index 7e64f05349..2331cd8634 100644 --- a/.github/workflows/branch-checks.yml +++ b/.github/workflows/branch-checks.yml @@ -294,7 +294,7 @@ jobs: fail-fast: false matrix: include: - - runner: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} + - runner: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64-pd-lint' || 'ubuntu-24.04' }} system: x86_64-linux - runner: ubuntu-24.04-arm system: aarch64-linux @@ -312,10 +312,8 @@ jobs: - uses: ./.github/actions/setup-rust with: - # Trial full artifacts only on GKE; retain hosted cache behavior. - cache-key: ${{ matrix.runner == 'openshell-ci-amd64' && 'gke-rust-lint-artifacts-v1' || 'rust-checks-v2' }} - save-cache: ${{ matrix.runner == 'openshell-ci-amd64' && 'true' || 'false' }} - cache-workspace-crates: ${{ matrix.runner == 'openshell-ci-amd64' && 'true' || 'false' }} + cache-key: rust-checks-v2 + save-cache: "false" - name: Lint shell: nix develop -c bash -euo pipefail {0} @@ -344,7 +342,7 @@ jobs: fail-fast: false matrix: include: - - runner: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} + - runner: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64-pd-test' || 'ubuntu-24.04' }} system: x86_64-linux - runner: ubuntu-24.04-arm system: aarch64-linux @@ -362,10 +360,8 @@ jobs: - uses: ./.github/actions/setup-rust with: - # Trial full artifacts only on GKE; retain hosted cache behavior. - cache-key: ${{ matrix.runner == 'openshell-ci-amd64' && 'gke-rust-test-artifacts-v1' || 'rust-checks-v2' }} + cache-key: rust-checks-v2 save-cache: "true" - cache-workspace-crates: ${{ matrix.runner == 'openshell-ci-amd64' && 'true' || 'false' }} - name: Verify crypto backend independence shell: nix develop -c bash -euo pipefail {0} diff --git a/CI.md b/CI.md index 510274bcbc..099cbc8da8 100644 --- a/CI.md +++ b/CI.md @@ -21,13 +21,18 @@ environment variable expected by the existing checks and Cachix. The custom image preloads Nix shells and configures the signed Cachix substituter globally; setup verifies that cache and skips duplicate user-level cache configuration. Rust jobs use the shared memcached sccache backend and report cache statistics; -the existing GitHub Rust target/registry cache remains enabled. The x86 GKE -lint and test jobs trial separate `gke-rust-*-artifacts-v1` cache namespaces, -retain workspace crates in the root target directory. Independent-workspace -targets continue using sccache without expanding the artifact cache trial. -Compare a populating run with a same-commit rerun, including restore/save time: -checkout timestamps and build-script invalidation can still trigger rebuilds. -These trial caches are PR-scoped until compatible caches are seeded on `main`. Inspect the job's +the standard runner jobs retain the existing GitHub Rust target/registry cache. +The x86 lint/test jobs instead use `openshell-ci-amd64-pd-lint` and +`openshell-ci-amd64-pd-test`. Each trial scale set has one worker and an exclusive +200 GiB SSD persistent disk, mounted at `/mnt/ci-cache`. Setup verifies the mount +and selects a repository/Nix-shell-specific target directory shared by that +job's Cargo commands. It skips GitHub Cargo cache restore/save entirely. +Check the initial target size and runner pod name to distinguish an empty-disk +run from a warm run on a replacement pod. Checkout and credentials remain +ephemeral; only Cargo build outputs persist. Cargo still validates artifacts, +and fresh checkout timestamps can trigger workspace rebuilds. These two lanes +serialize concurrent jobs during the trial; the ordinary scale set stays 5–20. +Inspect the job's runner name to confirm whether it ran on GKE. ARM, macOS, and fork jobs do not use the cluster-local cache endpoint. From 4c77341d4defe98760ae6a435b4fb43194532c63 Mon Sep 17 00:00:00 2001 From: Taylor Mutch Date: Sat, 21 Nov 2026 08:53:35 -0800 Subject: [PATCH 06/10] fix(ci): detect persistent cache from runner environment Signed-off-by: Taylor Mutch --- .github/actions/setup-rust/action.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-rust/action.yml b/.github/actions/setup-rust/action.yml index abe075d0f3..d6bacd80b4 100644 --- a/.github/actions/setup-rust/action.yml +++ b/.github/actions/setup-rust/action.yml @@ -46,12 +46,17 @@ runs: echo "hash=$(nix hash file --type sha256 --base16 "$shell_drv")" >> "$GITHUB_OUTPUT" - name: Configure persistent Cargo target directory - if: ${{ env.OPENSHELL_PERSISTENT_CACHE != '' }} + id: persistent-cache shell: bash env: NIX_SHELL_HASH: ${{ steps.dev-shell.outputs.hash }} run: | set -euo pipefail + # Pod environment is visible to the shell, not the workflow env context. + if [[ -z "${OPENSHELL_PERSISTENT_CACHE:-}" ]]; then + exit 0 + fi + echo "enabled=true" >> "$GITHUB_OUTPUT" test "$GITHUB_REPOSITORY" = ai-openshell/openshell test "$OPENSHELL_PERSISTENT_CACHE" = /mnt/ci-cache mountpoint -q "$OPENSHELL_PERSISTENT_CACHE" @@ -65,7 +70,7 @@ runs: df -h "$cache_root/target" - name: Cache Rust target and registry - if: ${{ env.OPENSHELL_PERSISTENT_CACHE == '' }} + if: ${{ steps.persistent-cache.outputs.enabled != 'true' }} id: cache uses: Swatinem/rust-cache@6a7bc3ebce750e0a16a430dd57485acfdb38b05f with: From c208e58c14e7e1c74b96e9ae56e851dc68942d38 Mon Sep 17 00:00:00 2001 From: Taylor Mutch Date: Sun, 22 Nov 2026 10:14:06 -0800 Subject: [PATCH 07/10] ci: trial native arm runners for linux lint and tests Signed-off-by: Taylor Mutch --- .agents/skills/watch-github-actions/SKILL.md | 9 +++++---- .github/actionlint.yml | 4 ++++ .github/actions/setup-nix/action.yml | 4 ++-- .github/actions/setup-rust/action.yml | 2 +- .github/workflows/branch-checks.yml | 18 +++++++++--------- CI.md | 17 +++++++++++++---- 6 files changed, 34 insertions(+), 20 deletions(-) diff --git a/.agents/skills/watch-github-actions/SKILL.md b/.agents/skills/watch-github-actions/SKILL.md index c73ede5b62..41c1eb5c93 100644 --- a/.agents/skills/watch-github-actions/SKILL.md +++ b/.agents/skills/watch-github-actions/SKILL.md @@ -134,8 +134,9 @@ gh run list --json databaseId,status,headBranch,url --jq '.[] | {id: .databaseId ## GKE runner trial Branch Checks Linux amd64 jobs from ai-openshell/openshell branches run on the -`openshell-ci-amd64` ARC scale set during the GKE trial. Fork, ARM, and macOS jobs -keep their hosted runners. Confirm the runner name in the job details before +`openshell-ci-amd64` ARC scale set during the GKE trial. ARM Linux lint/tests +use `openshell-ci-arm64-pd-*` on native ARM Ubuntu nodes with ARM64 images. +Fork PRs, other ARM jobs, and macOS retain hosted runners. Confirm the runner name in the job details before attributing a result to GKE. For a job-container or PostgreSQL startup failure, check the runner pod's Docker sidecar first. A missing `gh` executable or Cachix's `$USER must be set` error indicates incomplete runner bootstrap. @@ -143,8 +144,8 @@ For a preloaded image, `setup-nix` verifies its global Cachix substituter and skips adding it again. A cache-configuration permission failure indicates the image/setup contract is out of sync. Rust jobs report shared memcached sccache statistics; distinguish backend connectivity errors from compiler/test -failures. The x86 GKE lint/test jobs use single-worker `openshell-ci-amd64-pd-*` -scale sets with separate exclusive persistent disks. Setup reports the target +failures. The x86 and ARM GKE lint/test jobs use single-worker +`openshell-ci-amd64-pd-*` and `openshell-ci-arm64-pd-*` scale sets with separate exclusive persistent disks. Setup reports the target size before building and skips GitHub Cargo cache restore/save. Compare empty and warm runs on different runner pods; a PVC surviving pod replacement is the persistence check. `Pending` pods can be waiting for exclusive disk attachment; diff --git a/.github/actionlint.yml b/.github/actionlint.yml index d36e985cea..e7557f457f 100644 --- a/.github/actionlint.yml +++ b/.github/actionlint.yml @@ -4,6 +4,10 @@ self-hosted-runner: labels: - openshell-ci-amd64 + - openshell-ci-amd64-pd-lint + - openshell-ci-amd64-pd-test + - openshell-ci-arm64-pd-lint + - openshell-ci-arm64-pd-test - ubuntu-26.04 - windows-arm64 diff --git a/.github/actions/setup-nix/action.yml b/.github/actions/setup-nix/action.yml index a321066770..431ef22037 100644 --- a/.github/actions/setup-nix/action.yml +++ b/.github/actions/setup-nix/action.yml @@ -33,7 +33,7 @@ runs: http2 = false - name: Verify GKE image cache configuration - if: ${{ startsWith(runner.name, 'openshell-ci-amd64-') }} + if: ${{ (startsWith(runner.name, 'openshell-ci-amd64-') || startsWith(runner.name, 'openshell-ci-arm64-')) }} shell: bash run: | nix config show --json | jq -e '.substituters.value | index("https://openshell.cachix.org") != null' > /dev/null @@ -42,7 +42,7 @@ runs: with: name: openshell # The image configures the substituter globally before dropping to runner. - skipAddingSubstituter: ${{ startsWith(runner.name, 'openshell-ci-amd64-') }} + skipAddingSubstituter: ${{ (startsWith(runner.name, 'openshell-ci-amd64-') || startsWith(runner.name, 'openshell-ci-arm64-')) }} authToken: ${{ inputs.cachix-auth-token }} skipPush: ${{ inputs.cachix-auth-token == '' }} diff --git a/.github/actions/setup-rust/action.yml b/.github/actions/setup-rust/action.yml index d6bacd80b4..b8fa7f856a 100644 --- a/.github/actions/setup-rust/action.yml +++ b/.github/actions/setup-rust/action.yml @@ -26,7 +26,7 @@ runs: using: composite steps: - name: Configure shared sccache on GKE runners - if: ${{ runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + if: ${{ runner.environment == 'self-hosted' && (startsWith(runner.name, 'openshell-ci-amd64-') || startsWith(runner.name, 'openshell-ci-arm64-')) }} shell: nix develop -c bash -euo pipefail {0} run: | mise install --locked github:mozilla/sccache diff --git a/.github/workflows/branch-checks.yml b/.github/workflows/branch-checks.yml index 2331cd8634..8da10c6f0c 100644 --- a/.github/workflows/branch-checks.yml +++ b/.github/workflows/branch-checks.yml @@ -296,7 +296,7 @@ jobs: include: - runner: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64-pd-lint' || 'ubuntu-24.04' }} system: x86_64-linux - - runner: ubuntu-24.04-arm + - runner: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-arm64-pd-lint' || 'ubuntu-24.04-arm' }} system: aarch64-linux - runner: macos-15-xlarge system: aarch64-darwin @@ -333,7 +333,7 @@ jobs: cargo clippy --locked --manifest-path tests/support/Cargo.toml --all-targets -- -D warnings - name: Shared sccache statistics - if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && (startsWith(runner.name, 'openshell-ci-amd64-') || startsWith(runner.name, 'openshell-ci-arm64-')) }} run: sccache --show-stats rust-test: @@ -344,7 +344,7 @@ jobs: include: - runner: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64-pd-test' || 'ubuntu-24.04' }} system: x86_64-linux - - runner: ubuntu-24.04-arm + - runner: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-arm64-pd-test' || 'ubuntu-24.04-arm' }} system: aarch64-linux - runner: macos-15-xlarge system: aarch64-darwin @@ -426,7 +426,7 @@ jobs: tasks/scripts/check-conformance-program.sh - name: Shared sccache statistics - if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && (startsWith(runner.name, 'openshell-ci-amd64-') || startsWith(runner.name, 'openshell-ci-arm64-')) }} run: sccache --show-stats rust-postgres-test: @@ -458,7 +458,7 @@ jobs: run: tasks/scripts/run-postgres-tests.sh --locked --profile ci - name: Shared sccache statistics - if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && (startsWith(runner.name, 'openshell-ci-amd64-') || startsWith(runner.name, 'openshell-ci-arm64-')) }} run: sccache --show-stats rust-build-modes: @@ -520,7 +520,7 @@ jobs: fi - name: Shared sccache statistics - if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && (startsWith(runner.name, 'openshell-ci-amd64-') || startsWith(runner.name, 'openshell-ci-arm64-')) }} run: sccache --show-stats rust-feature-alias: @@ -547,7 +547,7 @@ jobs: git diff --exit-code HEAD -- ':(glob)**/Cargo.lock' - name: Shared sccache statistics - if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && (startsWith(runner.name, 'openshell-ci-amd64-') || startsWith(runner.name, 'openshell-ci-arm64-')) }} run: sccache --show-stats rust-gateway-core-features: @@ -576,7 +576,7 @@ jobs: cargo nextest run --locked --profile ci -p openshell-gateway --all-targets --no-default-features --features compute-driver-podman - name: Shared sccache statistics - if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && (startsWith(runner.name, 'openshell-ci-amd64-') || startsWith(runner.name, 'openshell-ci-arm64-')) }} run: sccache --show-stats rust-gateway-extended-features: @@ -604,7 +604,7 @@ jobs: cargo nextest run --locked --profile ci -p openshell-gateway --all-targets --no-default-features --features compute-driver-docker,compute-driver-vm - name: Shared sccache statistics - if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && startsWith(runner.name, 'openshell-ci-amd64-') }} + if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && (startsWith(runner.name, 'openshell-ci-amd64-') || startsWith(runner.name, 'openshell-ci-arm64-')) }} run: sccache --show-stats python: diff --git a/CI.md b/CI.md index 099cbc8da8..0b263b848f 100644 --- a/CI.md +++ b/CI.md @@ -8,8 +8,9 @@ For local test commands see [TESTING.md](TESTING.md). For PR conventions see [CO `Branch Checks` uses the `openshell-ci-amd64` GKE ARC scale set for Linux amd64 jobs from branches in `ai-openshell/openshell`, manual runs, and merge groups. -Fork PRs use GitHub-hosted runners; ARM and macOS jobs keep their existing -runner labels. This is a branch trial and does not change main until merged. +Fork PRs use GitHub-hosted runners. ARM Linux lint/tests use the dedicated +`openshell-ci-arm64-pd-lint` and `openshell-ci-arm64-pd-test` trial scale sets; +other ARM jobs and macOS keep their hosted labels. This is a branch trial and does not change main until merged. `Branch Checks` and `Helm Lint` trigger on `pull_request` and `merge_group`. Workflow runs from outside contributors wait for a maintainer to approve them in the Actions tab. @@ -33,8 +34,16 @@ ephemeral; only Cargo build outputs persist. Cargo still validates artifacts, and fresh checkout timestamps can trigger workspace rebuilds. These two lanes serialize concurrent jobs during the trial; the ordinary scale set stays 5–20. Inspect the job's -runner name to confirm whether it ran on GKE. ARM, macOS, and fork jobs do not -use the cluster-local cache endpoint. +runner name to confirm whether it ran on GKE. Hosted ARM, macOS, and fork jobs +do not use the cluster-local cache endpoint. + +The ARM trial uses native `t2a-standard-16` Ubuntu nodes (minimum two, maximum +four), an ARM64 runner image with baked Nix shells, and separate 200 GiB SSDs +for lint/tests. Each ARM lane has one ready worker, reserves 12 CPUs for the +runner plus one for Docker, and uses the same exclusive persistent-cache setup +as x86. BuildKit is native ARM too. Compare an empty-disk run with a same-commit +warm run on replacement pods; report queue/startup separately. Full ARM test +coverage is retained, and hosted ARM labels remain the fork fallback. `pull_request` runs from forks get a read-only token and no secrets, so they cannot post statuses. `Required CI Gates` runs from the base repository (`pull_request_target` and `workflow_run`), never checks out PR code, and posts the required `OpenShell / ...` statuses on the PR head SHA. E2E suites are opt-in because they are more expensive. From 69a058c36e576d7cfa55de9c063234dc14b3f62b Mon Sep 17 00:00:00 2001 From: Taylor Mutch Date: Sun, 22 Nov 2026 10:45:06 -0800 Subject: [PATCH 08/10] ci: balance arm crypto checks across parallel runner lanes Signed-off-by: Taylor Mutch --- .agents/skills/watch-github-actions/SKILL.md | 3 ++ .github/workflows/branch-checks.yml | 56 +++++++++++++++++++- CI.md | 5 +- 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/.agents/skills/watch-github-actions/SKILL.md b/.agents/skills/watch-github-actions/SKILL.md index 41c1eb5c93..f7c3d168ef 100644 --- a/.agents/skills/watch-github-actions/SKILL.md +++ b/.agents/skills/watch-github-actions/SKILL.md @@ -150,6 +150,9 @@ size before building and skips GitHub Cargo cache restore/save. Compare empty and warm runs on different runner pods; a PVC surviving pod replacement is the persistence check. `Pending` pods can be waiting for exclusive disk attachment; inspect PVC/PV events before treating this as a runner registration failure. +On native ARM the crypto backend/OpenSSL verification steps run in the lint +job, in parallel with workspace tests; inspect that job for crypto failures. +Hosted/fork and x86 test jobs keep their existing crypto steps. See `CI.md` for trial scope and cache setup. ## View Job Logs diff --git a/.github/workflows/branch-checks.yml b/.github/workflows/branch-checks.yml index 8da10c6f0c..50e9e9df2e 100644 --- a/.github/workflows/branch-checks.yml +++ b/.github/workflows/branch-checks.yml @@ -332,6 +332,58 @@ jobs: cargo clippy --locked --manifest-path tests/suites/features/Cargo.toml --workspace --all-targets -- -D warnings cargo clippy --locked --manifest-path tests/support/Cargo.toml --all-targets -- -D warnings + # Balance ARM crypto checks against the parallel workspace test job. + - name: Verify crypto backend independence + if: matrix.runner == 'openshell-ci-arm64-pd-lint' + shell: nix develop -c bash -euo pipefail {0} + run: | + cargo tree --locked -p openshell-crypto --no-default-features --edges normal,build,dev --target all --prefix none > /tmp/openshell-crypto-dependencies.txt + if grep -Eq '^(ring|aws-lc-rs|aws-lc-sys|aws-lc-fips-sys) v' /tmp/openshell-crypto-dependencies.txt; then + echo "ERROR: backend-free crypto build includes Ring or AWS-LC" >&2 + cat /tmp/openshell-crypto-dependencies.txt >&2 + exit 1 + fi + cargo test --locked -p openshell-crypto --no-default-features --test independent_backend + + - name: Verify OpenSSL backend + if: matrix.runner == 'openshell-ci-arm64-pd-lint' + shell: nix develop .#crypto -c bash -euo pipefail {0} + env: + OPENSSL_NO_VENDOR: "1" + OPENSSL_STATIC: "0" + run: | + cargo tree --locked -p openshell-crypto --no-default-features --features openssl --edges normal,build,dev --target all --prefix none > /tmp/openshell-openssl-dependencies.txt + if grep -Eq '^(ring|aws-lc-rs|aws-lc-sys|aws-lc-fips-sys|openssl-src) v' /tmp/openshell-openssl-dependencies.txt; then + echo "ERROR: OpenSSL-only crypto build includes another backend or vendored OpenSSL" >&2 + cat /tmp/openshell-openssl-dependencies.txt >&2 + exit 1 + fi + cargo clippy --locked -p openshell-crypto --no-default-features --features openssl --all-targets -- -D warnings + cargo test --locked -p openshell-crypto --no-default-features --features openssl + for feature in tls-tonic tls-kube tls-sqlx; do + cargo check --locked -p openshell-crypto --no-default-features --features "openssl,$feature" + done + cargo clippy --locked -p openshell-crypto --features openssl --all-targets -- -D warnings + cargo test --locked -p openshell-crypto --features openssl + + - name: Verify dynamic OpenSSL linkage on Linux + if: runner.os == 'Linux' && matrix.runner == 'openshell-ci-arm64-pd-lint' + shell: nix develop .#crypto -c bash -euo pipefail {0} + env: + OPENSSL_NO_VENDOR: "1" + OPENSSL_STATIC: "0" + run: | + cargo test --locked -p openshell-crypto --no-default-features --features openssl --test openssl_tls --no-run --message-format=json > "$RUNNER_TEMP/openssl-artifacts.jsonl" + executable=$(uv run --no-project python -c 'import json, sys; artifacts = [json.loads(line) for line in sys.stdin]; paths = [a["executable"] for a in artifacts if a.get("reason") == "compiler-artifact" and a.get("target", {}).get("name") == "openssl_tls" and a.get("executable")]; assert len(paths) == 1, paths; print(paths[0])' < "$RUNNER_TEMP/openssl-artifacts.jsonl") + ldd "$executable" > "$RUNNER_TEMP/openssl-linkage.txt" + cat "$RUNNER_TEMP/openssl-linkage.txt" + for library in libssl libcrypto; do + if ! grep -Eq "^[[:space:]]*$library\\.so[^[:space:]]* => /" "$RUNNER_TEMP/openssl-linkage.txt"; then + echo "ERROR: $library did not resolve to a dynamic library" >&2 + exit 1 + fi + done + - name: Shared sccache statistics if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && (startsWith(runner.name, 'openshell-ci-amd64-') || startsWith(runner.name, 'openshell-ci-arm64-')) }} run: sccache --show-stats @@ -364,6 +416,7 @@ jobs: save-cache: "true" - name: Verify crypto backend independence + if: matrix.runner != 'openshell-ci-arm64-pd-test' shell: nix develop -c bash -euo pipefail {0} run: | cargo tree --locked -p openshell-crypto --no-default-features --edges normal,build,dev --target all --prefix none > /tmp/openshell-crypto-dependencies.txt @@ -375,6 +428,7 @@ jobs: cargo test --locked -p openshell-crypto --no-default-features --test independent_backend - name: Verify OpenSSL backend + if: matrix.runner != 'openshell-ci-arm64-pd-test' shell: nix develop .#crypto -c bash -euo pipefail {0} env: OPENSSL_NO_VENDOR: "1" @@ -395,7 +449,7 @@ jobs: cargo test --locked -p openshell-crypto --features openssl - name: Verify dynamic OpenSSL linkage on Linux - if: runner.os == 'Linux' + if: runner.os == 'Linux' && matrix.runner != 'openshell-ci-arm64-pd-test' shell: nix develop .#crypto -c bash -euo pipefail {0} env: OPENSSL_NO_VENDOR: "1" diff --git a/CI.md b/CI.md index 0b263b848f..5778061d4a 100644 --- a/CI.md +++ b/CI.md @@ -43,7 +43,10 @@ for lint/tests. Each ARM lane has one ready worker, reserves 12 CPUs for the runner plus one for Docker, and uses the same exclusive persistent-cache setup as x86. BuildKit is native ARM too. Compare an empty-disk run with a same-commit warm run on replacement pods; report queue/startup separately. Full ARM test -coverage is retained, and hosted ARM labels remain the fork fallback. +coverage is retained, and hosted ARM labels remain the fork fallback. On native +ARM, crypto backend independence, OpenSSL backend, and dynamic-linkage checks run +after lint while workspace tests run in parallel on the test lane. Other runner +configurations retain those checks in the test job. `pull_request` runs from forks get a read-only token and no secrets, so they cannot post statuses. `Required CI Gates` runs from the base repository (`pull_request_target` and `workflow_run`), never checks out PR code, and posts the required `OpenShell / ...` statuses on the PR head SHA. E2E suites are opt-in because they are more expensive. From 8aa6cfcc5c1193b05a71eff7efd77cff4ac4e20b Mon Sep 17 00:00:00 2001 From: Taylor Mutch Date: Sun, 22 Nov 2026 17:49:53 -0800 Subject: [PATCH 09/10] ci: parallelize gateway core feature checks Signed-off-by: Taylor Mutch --- .agents/skills/watch-github-actions/SKILL.md | 5 +++ .github/actionlint.yml | 2 ++ .github/workflows/branch-checks.yml | 36 +++++++++++++++----- CI.md | 11 ++++++ 4 files changed, 46 insertions(+), 8 deletions(-) diff --git a/.agents/skills/watch-github-actions/SKILL.md b/.agents/skills/watch-github-actions/SKILL.md index f7c3d168ef..c8c48c88e4 100644 --- a/.agents/skills/watch-github-actions/SKILL.md +++ b/.agents/skills/watch-github-actions/SKILL.md @@ -153,6 +153,11 @@ inspect PVC/PV events before treating this as a runner registration failure. On native ARM the crypto backend/OpenSSL verification steps run in the lint job, in parallel with workspace tests; inspect that job for crypto failures. Hosted/fork and x86 test jobs keep their existing crypto steps. +Gateway core features use parallel `base-kubernetes` and `docker-podman` matrix +jobs on `openshell-ci-amd64-pd-gateway-a/b`, with separate exclusive caches and +eight reserved runner CPUs. Inspect both jobs and all four named feature steps; +measure the later completion rather than summing durations. Fork jobs retain +hosted Ubuntu. A failed lane must fail the Branch Checks workflow gate. See `CI.md` for trial scope and cache setup. ## View Job Logs diff --git a/.github/actionlint.yml b/.github/actionlint.yml index e7557f457f..a432d307a1 100644 --- a/.github/actionlint.yml +++ b/.github/actionlint.yml @@ -6,6 +6,8 @@ self-hosted-runner: - openshell-ci-amd64 - openshell-ci-amd64-pd-lint - openshell-ci-amd64-pd-test + - openshell-ci-amd64-pd-gateway-a + - openshell-ci-amd64-pd-gateway-b - openshell-ci-arm64-pd-lint - openshell-ci-arm64-pd-test - ubuntu-26.04 diff --git a/.github/workflows/branch-checks.yml b/.github/workflows/branch-checks.yml index 50e9e9df2e..b6ad98ce16 100644 --- a/.github/workflows/branch-checks.yml +++ b/.github/workflows/branch-checks.yml @@ -605,8 +605,16 @@ jobs: run: sccache --show-stats rust-gateway-core-features: - name: Rust gateway core features - runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'openshell-ci-amd64' || 'ubuntu-24.04' }} + name: Rust gateway core features (${{ matrix.lane }}) + strategy: + fail-fast: false + matrix: + include: + - lane: base-kubernetes + runner: openshell-ci-amd64-pd-gateway-a + - lane: docker-podman + runner: openshell-ci-amd64-pd-gateway-b + runs-on: ${{ github.repository == 'ai-openshell/openshell' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && matrix.runner || 'ubuntu-24.04' }} timeout-minutes: 30 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -621,13 +629,25 @@ jobs: cache-key: rust-checks-v2 save-cache: "false" - - name: Verify core gateway compute-driver feature sets + - name: Test gateway without optional drivers + if: matrix.lane == 'base-kubernetes' shell: nix develop -c bash -euo pipefail {0} - run: | - cargo nextest run --locked --profile ci -p openshell-gateway --all-targets --no-default-features - cargo nextest run --locked --profile ci -p openshell-gateway --all-targets --no-default-features --features compute-driver-docker - cargo nextest run --locked --profile ci -p openshell-gateway --all-targets --no-default-features --features compute-driver-kubernetes - cargo nextest run --locked --profile ci -p openshell-gateway --all-targets --no-default-features --features compute-driver-podman + run: cargo nextest run --locked --profile ci -p openshell-gateway --all-targets --no-default-features + + - name: Test Kubernetes-only gateway + if: matrix.lane == 'base-kubernetes' + shell: nix develop -c bash -euo pipefail {0} + run: cargo nextest run --locked --profile ci -p openshell-gateway --all-targets --no-default-features --features compute-driver-kubernetes + + - name: Test Docker-only gateway + if: matrix.lane == 'docker-podman' + shell: nix develop -c bash -euo pipefail {0} + run: cargo nextest run --locked --profile ci -p openshell-gateway --all-targets --no-default-features --features compute-driver-docker + + - name: Test Podman-only gateway + if: matrix.lane == 'docker-podman' + shell: nix develop -c bash -euo pipefail {0} + run: cargo nextest run --locked --profile ci -p openshell-gateway --all-targets --no-default-features --features compute-driver-podman - name: Shared sccache statistics if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && (startsWith(runner.name, 'openshell-ci-amd64-') || startsWith(runner.name, 'openshell-ci-arm64-')) }} diff --git a/CI.md b/CI.md index 5778061d4a..6d92a2eeb4 100644 --- a/CI.md +++ b/CI.md @@ -48,6 +48,17 @@ ARM, crypto backend independence, OpenSSL backend, and dynamic-linkage checks ru after lint while workspace tests run in parallel on the test lane. Other runner configurations retain those checks in the test job. +Gateway core-feature checks run in two parallel matrix lanes: no-driver plus +Kubernetes in `base-kubernetes`, and Docker plus Podman in `docker-podman`. +Trusted jobs use `openshell-ci-amd64-pd-gateway-a` and +`openshell-ci-amd64-pd-gateway-b`, each with an exclusive 200 GiB SSD, eight +reserved runner CPUs, and shared memcached sccache. Fork jobs use hosted Ubuntu. +All four commands keep `--all-targets --no-default-features`; each driver is +checked independently. The matrix keeps running both lanes after a failure, +and the existing Branch Checks workflow gate requires both to succeed. +Compare the later lane completion, including queue time, against the old +sequential job; adding lane durations measures CPU cost rather than latency. + `pull_request` runs from forks get a read-only token and no secrets, so they cannot post statuses. `Required CI Gates` runs from the base repository (`pull_request_target` and `workflow_run`), never checks out PR code, and posts the required `OpenShell / ...` statuses on the PR head SHA. E2E suites are opt-in because they are more expensive. Merge queue validation is a second integration gate for `main`. After a PR has passed the required PR-head statuses, a maintainer adds it to the merge queue. GitHub creates a temporary merge-group branch that combines the latest `main`, the queued PR, and any earlier queued PRs. The same required `OpenShell / ...` status contexts are then published against the merge-group SHA before GitHub merges it. From 0c28fce88f059a65195026079660de3ec911554c Mon Sep 17 00:00:00 2001 From: Taylor Mutch Date: Sun, 22 Nov 2026 21:04:59 -0800 Subject: [PATCH 10/10] ci: compare combined and parallel linux rust checks Signed-off-by: Taylor Mutch --- .agents/skills/watch-github-actions/SKILL.md | 5 + .github/actionlint.yml | 2 + .github/workflows/branch-checks.yml | 114 +++++++++++++++++++ CI.md | 12 ++ 4 files changed, 133 insertions(+) diff --git a/.agents/skills/watch-github-actions/SKILL.md b/.agents/skills/watch-github-actions/SKILL.md index c8c48c88e4..a6a2a1d029 100644 --- a/.agents/skills/watch-github-actions/SKILL.md +++ b/.agents/skills/watch-github-actions/SKILL.md @@ -158,6 +158,11 @@ jobs on `openshell-ci-amd64-pd-gateway-a/b`, with separate exclusive caches and eight reserved runner CPUs. Inspect both jobs and all four named feature steps; measure the later completion rather than summing durations. Fork jobs retain hosted Ubuntu. A failed lane must fail the Branch Checks workflow gate. +The opt-in `compare_linux_combined` manual input adds Linux combined lint, +crypto, and test jobs beside the regular controls. Compare each architecture's +later control completion against its combined job, and runner minutes against +the control sum. Confirm cold versus warm target sizes; no Clippy architecture +coverage is dropped in this experiment. Ordinary PR runs skip the comparison. See `CI.md` for trial scope and cache setup. ## View Job Logs diff --git a/.github/actionlint.yml b/.github/actionlint.yml index a432d307a1..1f252bc640 100644 --- a/.github/actionlint.yml +++ b/.github/actionlint.yml @@ -6,10 +6,12 @@ self-hosted-runner: - openshell-ci-amd64 - openshell-ci-amd64-pd-lint - openshell-ci-amd64-pd-test + - openshell-ci-amd64-pd-combined - openshell-ci-amd64-pd-gateway-a - openshell-ci-amd64-pd-gateway-b - openshell-ci-arm64-pd-lint - openshell-ci-arm64-pd-test + - openshell-ci-arm64-pd-combined - ubuntu-26.04 - windows-arm64 diff --git a/.github/workflows/branch-checks.yml b/.github/workflows/branch-checks.yml index b6ad98ce16..a4a4561319 100644 --- a/.github/workflows/branch-checks.yml +++ b/.github/workflows/branch-checks.yml @@ -5,6 +5,12 @@ on: types: [checks_requested] pull_request: workflow_dispatch: + inputs: + compare_linux_combined: + description: Run Linux combined lint/test jobs alongside the parallel controls + type: boolean + required: false + default: false env: CARGO_TERM_COLOR: always @@ -483,6 +489,114 @@ jobs: if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && (startsWith(runner.name, 'openshell-ci-amd64-') || startsWith(runner.name, 'openshell-ci-arm64-')) }} run: sccache --show-stats + rust-linux-combined-trial: + name: Linux combined lint and tests (${{ matrix.system }}) + if: github.event_name == 'workflow_dispatch' && inputs.compare_linux_combined && github.repository == 'ai-openshell/openshell' + strategy: + fail-fast: false + matrix: + include: + - system: x86_64-linux + runner: openshell-ci-amd64-pd-combined + - system: aarch64-linux + runner: openshell-ci-arm64-pd-combined + runs-on: ${{ matrix.runner }} + timeout-minutes: 45 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - uses: ./.github/actions/setup-nix + with: + prepare-shell: "true" + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} + + - uses: ./.github/actions/setup-rust + with: + cache-key: rust-checks-v2 + save-cache: "false" + + - name: Lint + shell: nix develop -c bash -euo pipefail {0} + run: | + cargo clippy --locked --workspace --all-targets -- -D warnings + cargo clippy --locked --manifest-path e2e/rust/Cargo.toml --all-targets -- -D warnings + cargo clippy --locked --manifest-path examples/governance-interceptor/Cargo.toml --all-targets -- -D warnings + cargo clippy --locked --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --all-targets -- -D warnings + cargo clippy --locked --manifest-path examples/isolation-backend-v8/Cargo.toml --all-targets -- -D warnings + cargo clippy --locked --manifest-path tests/testkit/Cargo.toml --all-targets -- -D warnings + cargo clippy --locked --manifest-path tests/tmachine/Cargo.toml --all-targets -- -D warnings + cargo clippy --locked --manifest-path tests/runner/Cargo.toml --all-targets -- -D warnings + cargo clippy --locked --manifest-path tests/suites/conformance/Cargo.toml --workspace --all-targets -- -D warnings + cargo clippy --locked --manifest-path tests/suites/continuity/Cargo.toml --workspace --all-targets -- -D warnings + cargo clippy --locked --manifest-path tests/suites/drivers/podman/Cargo.toml --workspace --all-targets -- -D warnings + cargo clippy --locked --manifest-path tests/suites/features/Cargo.toml --workspace --all-targets -- -D warnings + cargo clippy --locked --manifest-path tests/support/Cargo.toml --all-targets -- -D warnings + + - name: Verify crypto backend independence + shell: nix develop -c bash -euo pipefail {0} + run: | + cargo tree --locked -p openshell-crypto --no-default-features --edges normal,build,dev --target all --prefix none > /tmp/openshell-crypto-dependencies.txt + if grep -Eq '^(ring|aws-lc-rs|aws-lc-sys|aws-lc-fips-sys) v' /tmp/openshell-crypto-dependencies.txt; then + echo "ERROR: backend-free crypto build includes Ring or AWS-LC" >&2 + cat /tmp/openshell-crypto-dependencies.txt >&2 + exit 1 + fi + cargo test --locked -p openshell-crypto --no-default-features --test independent_backend + + - name: Verify OpenSSL backend + shell: nix develop .#crypto -c bash -euo pipefail {0} + env: + OPENSSL_NO_VENDOR: "1" + OPENSSL_STATIC: "0" + run: | + cargo tree --locked -p openshell-crypto --no-default-features --features openssl --edges normal,build,dev --target all --prefix none > /tmp/openshell-openssl-dependencies.txt + if grep -Eq '^(ring|aws-lc-rs|aws-lc-sys|aws-lc-fips-sys|openssl-src) v' /tmp/openshell-openssl-dependencies.txt; then + echo "ERROR: OpenSSL-only crypto build includes another backend or vendored OpenSSL" >&2 + cat /tmp/openshell-openssl-dependencies.txt >&2 + exit 1 + fi + cargo clippy --locked -p openshell-crypto --no-default-features --features openssl --all-targets -- -D warnings + cargo test --locked -p openshell-crypto --no-default-features --features openssl + for feature in tls-tonic tls-kube tls-sqlx; do + cargo check --locked -p openshell-crypto --no-default-features --features "openssl,$feature" + done + cargo clippy --locked -p openshell-crypto --features openssl --all-targets -- -D warnings + cargo test --locked -p openshell-crypto --features openssl + + - name: Verify dynamic OpenSSL linkage on Linux + shell: nix develop .#crypto -c bash -euo pipefail {0} + env: + OPENSSL_NO_VENDOR: "1" + OPENSSL_STATIC: "0" + run: | + cargo test --locked -p openshell-crypto --no-default-features --features openssl --test openssl_tls --no-run --message-format=json > "$RUNNER_TEMP/openssl-artifacts.jsonl" + executable=$(uv run --no-project python -c 'import json, sys; artifacts = [json.loads(line) for line in sys.stdin]; paths = [a["executable"] for a in artifacts if a.get("reason") == "compiler-artifact" and a.get("target", {}).get("name") == "openssl_tls" and a.get("executable")]; assert len(paths) == 1, paths; print(paths[0])' < "$RUNNER_TEMP/openssl-artifacts.jsonl") + ldd "$executable" > "$RUNNER_TEMP/openssl-linkage.txt" + cat "$RUNNER_TEMP/openssl-linkage.txt" + for library in libssl libcrypto; do + if ! grep -Eq "^[[:space:]]*$library\\.so[^[:space:]]* => /" "$RUNNER_TEMP/openssl-linkage.txt"; then + echo "ERROR: $library did not resolve to a dynamic library" >&2 + exit 1 + fi + done + + - name: Test + shell: nix develop -c bash -euo pipefail {0} + env: + OPENSHELL_TELEMETRY_ENABLED: "false" + run: | + cargo nextest run --locked --profile ci --workspace --features openshell-server/test-support + cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml + cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/testkit/Cargo.toml + cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/tmachine/Cargo.toml + cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/runner/Cargo.toml + cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/support/Cargo.toml + tasks/scripts/check-conformance-program.sh + + - name: Shared sccache statistics + if: ${{ always() && env.RUSTC_WRAPPER != '' && runner.environment == 'self-hosted' && (startsWith(runner.name, 'openshell-ci-amd64-') || startsWith(runner.name, 'openshell-ci-arm64-')) }} + run: sccache --show-stats + rust-postgres-test: name: Rust PostgreSQL tests # Bare runner: the test script starts a disposable PostgreSQL container diff --git a/CI.md b/CI.md index 6d92a2eeb4..3fcb6a9275 100644 --- a/CI.md +++ b/CI.md @@ -59,6 +59,18 @@ and the existing Branch Checks workflow gate requires both to succeed. Compare the later lane completion, including queue time, against the old sequential job; adding lane durations measures CPU cost rather than latency. +Manual Branch Checks runs can enable `compare_linux_combined` to add one +combined lint/crypto/test job on each Linux architecture alongside the normal +parallel controls. No macOS combined job is added. All Clippy, crypto, workspace, +and independent-workspace commands are retained. Combined jobs use their own +exclusive SSDs and the same image, CPU limits, and memory settings as their +architecture's controls. During this infra trial AMD64 lint/test/combined +workers each reserve eight runner CPUs; ARM64 workers each reserve twelve. +Compare warmed runs on the same commit: parallel completion is the later +lint/test completion; combined completion is one job. Report total runner +minutes separately. The input defaults to false so ordinary PR checks do not +run duplicate suites. + `pull_request` runs from forks get a read-only token and no secrets, so they cannot post statuses. `Required CI Gates` runs from the base repository (`pull_request_target` and `workflow_run`), never checks out PR code, and posts the required `OpenShell / ...` statuses on the PR head SHA. E2E suites are opt-in because they are more expensive. Merge queue validation is a second integration gate for `main`. After a PR has passed the required PR-head statuses, a maintainer adds it to the merge queue. GitHub creates a temporary merge-group branch that combines the latest `main`, the queued PR, and any earlier queued PRs. The same required `OpenShell / ...` status contexts are then published against the merge-group SHA before GitHub merges it.