From 7d5b2e4fb0621f78dab6685f609d9f8cc6026207 Mon Sep 17 00:00:00 2001 From: Simon Scatton <44714756+SDAChess@users.noreply.github.com> Date: Thu, 17 Sep 2026 12:09:42 +0000 Subject: [PATCH 1/4] ci: consolidate release binary builds (#3405) Signed-off-by: Simon Scatton --- .github/actions/build-rust-binary/action.yml | 21 +-- .github/workflows/branch-e2e.yml | 189 ++++++++----------- .github/workflows/build-binaries.yml | 154 ++++++++++----- .github/workflows/build-cli-binaries.yml | 47 ----- .github/workflows/build-gateway-binaries.yml | 47 ----- .github/workflows/build-runtime-binaries.yml | 62 ------ .github/workflows/build-vm-driver.yml | 45 +---- .github/workflows/conformance.yml | 80 +++++--- .github/workflows/release-dev.yml | 104 ++++------ .github/workflows/release-tag.yml | 133 +++++-------- 10 files changed, 333 insertions(+), 549 deletions(-) delete mode 100644 .github/workflows/build-cli-binaries.yml delete mode 100644 .github/workflows/build-gateway-binaries.yml delete mode 100644 .github/workflows/build-runtime-binaries.yml diff --git a/.github/actions/build-rust-binary/action.yml b/.github/actions/build-rust-binary/action.yml index 53bcfce2d1..099d6acf2f 100644 --- a/.github/actions/build-rust-binary/action.yml +++ b/.github/actions/build-rust-binary/action.yml @@ -17,7 +17,7 @@ inputs: cargo-version: description: Cargo package version embedded in the binary required: true - image-tag: + supervisor-image-tag: description: Default supervisor image tag embedded in the binary required: false default: "" @@ -29,11 +29,6 @@ inputs: description: Additional flags passed to cargo build required: false default: "" - interpreter: - description: Expected ELF program interpreter, "none" for static, or "skip" - required: false - default: skip - runs: using: composite steps: @@ -63,7 +58,7 @@ runs: shell: nix develop -c bash -euo pipefail {0} env: GIT_DIR: /nonexistent - OPENSHELL_IMAGE_TAG: ${{ inputs.image-tag }} + OPENSHELL_IMAGE_TAG: ${{ inputs.supervisor-image-tag }} INPUTS_PACKAGE: ${{ inputs.package }} INPUTS_BINARY: ${{ inputs.binary }} INPUTS_TRIPLE: ${{ inputs.triple }} @@ -75,24 +70,12 @@ runs: env: INPUTS_BINARY: ${{ inputs.binary }} INPUTS_TRIPLE: ${{ inputs.triple }} - INPUTS_INTERPRETER: ${{ inputs.interpreter }} run: | binary="target/${INPUTS_TRIPLE}/release/${INPUTS_BINARY}" # Confirm the binary runs and reports the expected name. "$binary" --version | grep -q "^${INPUTS_BINARY} " # Confirm Syft can decode the embedded cargo-auditable metadata. SYFT_CHECK_FOR_APP_UPDATE=false syft "file:${binary}" -o cyclonedx-json | grep 'pkg:cargo/' > /dev/null - if [ "$INPUTS_INTERPRETER" != skip ]; then - actual_interpreter="$(readelf -l "$binary" | sed -n 's/.*Requesting program interpreter: \(.*\)]/\1/p')" - expected_interpreter="$INPUTS_INTERPRETER" - if [ "$expected_interpreter" = none ]; then - expected_interpreter="" - fi - if [ "$actual_interpreter" != "$expected_interpreter" ]; then - echo "error: expected interpreter '${expected_interpreter:-}', got '${actual_interpreter:-}'" >&2 - exit 1 - fi - fi - name: Upload ${{ inputs.binary }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 diff --git a/.github/workflows/branch-e2e.yml b/.github/workflows/branch-e2e.yml index 59d7e9174a..1eab8b9309 100644 --- a/.github/workflows/branch-e2e.yml +++ b/.github/workflows/branch-e2e.yml @@ -30,6 +30,8 @@ jobs: run_any_e2e: ${{ steps.labels.outputs.run_any_e2e }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - id: gate uses: ./.github/actions/pr-gate - id: labels @@ -90,6 +92,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 + persist-credentials: false - name: Compute version id: version @@ -97,56 +100,18 @@ jobs: cargo="$(python3 tasks/scripts/release.py get-version --cargo)" echo "cargo=$cargo" >> "$GITHUB_OUTPUT" - build-cli: + build-binaries: needs: version permissions: contents: read - uses: ./.github/workflows/build-cli-binaries.yml - with: - cargo-version: ${{ needs.version.outputs.cargo }} - secrets: inherit - - build-conformance: - needs: [pr_metadata, version] - if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_any_e2e == 'true' - permissions: - contents: read - strategy: - matrix: - include: - - triple: x86_64-unknown-linux-musl - runner: linux-amd64-cpu8 - - triple: aarch64-unknown-linux-musl - runner: linux-arm64-cpu8 uses: ./.github/workflows/build-binaries.yml with: - package: openshell-conformance-cli - binary: openshell-conformance - artifact-name: openshell-conformance-${{ matrix.triple }} - triple: ${{ matrix.triple }} - runner: ${{ matrix.runner }} cargo-version: ${{ needs.version.outputs.cargo }} - secrets: inherit - - build-runtimes: - needs: version - permissions: - contents: read - uses: ./.github/workflows/build-runtime-binaries.yml - with: - cargo-version: ${{ needs.version.outputs.cargo }} - secrets: inherit - - build-gateway: - needs: version - permissions: - contents: read - uses: ./.github/workflows/build-gateway-binaries.yml - with: - cargo-version: ${{ needs.version.outputs.cargo }} - secrets: inherit + secrets: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} build-gateway-plain: + name: openshell-gateway driver-free (${{ matrix.triple }}) needs: [pr_metadata, version] if: needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: @@ -158,71 +123,76 @@ jobs: runner: linux-amd64-cpu8 - triple: aarch64-unknown-linux-gnu runner: linux-arm64-cpu8 - uses: ./.github/workflows/build-binaries.yml - with: - package: openshell-gateway - binary: openshell-gateway - artifact-name: openshell-gateway-plain-${{ matrix.triple }} - triple: ${{ matrix.triple }} - runner: ${{ matrix.runner }} - cargo-version: ${{ needs.version.outputs.cargo }} - extra-cargo-flags: --no-default-features - secrets: inherit - - build-driver-docker: - needs: [pr_metadata, version] - if: needs.pr_metadata.outputs.run_core_e2e == 'true' - permissions: - contents: read - uses: ./.github/workflows/build-binaries.yml - with: - package: openshell-driver-docker - binary: openshell-driver-docker - triple: aarch64-unknown-linux-gnu - runner: linux-arm64-cpu8 - cargo-version: ${{ needs.version.outputs.cargo }} - secrets: inherit - - build-driver-podman: - needs: [pr_metadata, version] - if: needs.pr_metadata.outputs.run_core_e2e == 'true' - permissions: - contents: read - uses: ./.github/workflows/build-binaries.yml - with: - package: openshell-driver-podman - binary: openshell-driver-podman - triple: x86_64-unknown-linux-gnu - runner: linux-amd64-cpu8 - cargo-version: ${{ needs.version.outputs.cargo }} - secrets: inherit - - build-driver-kubernetes: + runs-on: ${{ matrix.runner }} + timeout-minutes: 60 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + ref: ${{ github.sha }} + - uses: ./.github/actions/setup-nix + with: + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} + - uses: ./.github/actions/build-rust-binary + with: + package: openshell-gateway + binary: openshell-gateway + artifact-name: openshell-gateway-plain-${{ matrix.triple }} + triple: ${{ matrix.triple }} + cargo-version: ${{ needs.version.outputs.cargo }} + extra-cargo-flags: --no-default-features + + build-external-drivers: + name: ${{ matrix.binary }} (${{ matrix.triple }}) needs: [pr_metadata, version] if: needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: contents: read - uses: ./.github/workflows/build-binaries.yml - with: - package: openshell-driver-kubernetes - binary: openshell-driver-kubernetes - triple: x86_64-unknown-linux-gnu - runner: linux-amd64-cpu8 - cargo-version: ${{ needs.version.outputs.cargo }} - secrets: inherit + strategy: + matrix: + include: + - package: openshell-driver-docker + binary: openshell-driver-docker + triple: aarch64-unknown-linux-gnu + runner: linux-arm64-cpu8 + - package: openshell-driver-podman + binary: openshell-driver-podman + triple: x86_64-unknown-linux-gnu + runner: linux-amd64-cpu8 + - package: openshell-driver-kubernetes + binary: openshell-driver-kubernetes + triple: x86_64-unknown-linux-gnu + runner: linux-amd64-cpu8 + runs-on: ${{ matrix.runner }} + timeout-minutes: 60 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + ref: ${{ github.sha }} + - uses: ./.github/actions/setup-nix + with: + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} + - uses: ./.github/actions/build-rust-binary + with: + package: ${{ matrix.package }} + binary: ${{ matrix.binary }} + triple: ${{ matrix.triple }} + cargo-version: ${{ needs.version.outputs.cargo }} build-vm-driver: - needs: [pr_metadata, version, build-runtimes] + needs: [pr_metadata, version, build-binaries] if: needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: contents: read uses: ./.github/workflows/build-vm-driver.yml with: cargo-version: ${{ needs.version.outputs.cargo }} - secrets: inherit + secrets: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} build-gateway-image: - needs: [pr_metadata, build-gateway] + needs: [pr_metadata, build-binaries] if: >- needs.pr_metadata.outputs.should_run == 'true' && (needs.pr_metadata.outputs.run_core_e2e == 'true' || @@ -236,10 +206,9 @@ jobs: component: gateway binary: openshell-gateway target-suffix: unknown-linux-gnu - secrets: inherit build-sandbox-image: - needs: [pr_metadata, build-runtimes] + needs: [pr_metadata, build-binaries] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_any_e2e == 'true' permissions: contents: read @@ -249,10 +218,9 @@ jobs: component: sandbox binary: openshell-sandbox target-suffix: unknown-linux-musl - secrets: inherit build-supervisor-image: - needs: [pr_metadata, build-runtimes] + needs: [pr_metadata, build-binaries] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_any_e2e == 'true' permissions: contents: read @@ -262,10 +230,9 @@ jobs: component: supervisor binary: openshell-supervisor target-suffix: unknown-linux-gnu - secrets: inherit docker-e2e: - needs: [pr_metadata, build-cli, build-conformance, build-gateway, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-sandbox-image, build-supervisor-image] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: actions: read @@ -278,7 +245,7 @@ jobs: conformance-artifact-prefix: openshell-conformance podman-e2e: - needs: [pr_metadata, build-cli, build-conformance, build-gateway, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-sandbox-image, build-supervisor-image] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: actions: read @@ -290,7 +257,7 @@ jobs: conformance-artifact-prefix: openshell-conformance vm-e2e: - needs: [pr_metadata, build-cli, build-conformance, build-gateway, build-vm-driver] + needs: [pr_metadata, build-binaries, build-vm-driver] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: actions: read @@ -301,7 +268,7 @@ jobs: conformance-artifact-prefix: openshell-conformance docker-external-driver-e2e: - needs: [pr_metadata, build-cli, build-conformance, build-gateway-plain, build-driver-docker, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-gateway-plain, build-external-drivers, build-sandbox-image, build-supervisor-image] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: actions: read @@ -318,7 +285,7 @@ jobs: [{"suite":"external-driver","cmd":"mise run --no-deps --skip-deps e2e:docker:external-driver","apt_packages":"openssh-client","python_proto":false,"mcp":false}] podman-external-driver-e2e: - needs: [pr_metadata, build-cli, build-conformance, build-gateway-plain, build-driver-podman, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-gateway-plain, build-external-drivers, build-sandbox-image, build-supervisor-image] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: actions: read @@ -334,7 +301,7 @@ jobs: [{"suite":"external-driver","runner":"ubuntu-26.04","podman_major":"5","podman_package_version":"5.7.0+ds2-3build1","conmon_package_version":"2.1.13+ds1-2","cmd":"mise run --no-deps --skip-deps e2e:podman:external-driver"}] vm-external-driver-e2e: - needs: [pr_metadata, build-cli, build-conformance, build-gateway-plain, build-vm-driver] + needs: [pr_metadata, build-binaries, build-gateway-plain, build-vm-driver] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: actions: read @@ -348,7 +315,7 @@ jobs: conformance-artifact-prefix: openshell-conformance gpu-e2e: - needs: [pr_metadata, build-cli, build-conformance, build-gateway, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-sandbox-image, build-supervisor-image] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_gpu_e2e == 'true' permissions: actions: read @@ -360,7 +327,7 @@ jobs: conformance-artifact-prefix: openshell-conformance kubernetes-e2e: - needs: [pr_metadata, build-cli, build-conformance, build-gateway-image, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-gateway-image, build-sandbox-image, build-supervisor-image] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' strategy: fail-fast: false @@ -382,7 +349,7 @@ jobs: conformance-artifact-prefix: openshell-conformance kubernetes-workspace-managed-e2e: - needs: [pr_metadata, build-cli, build-conformance, build-gateway-image, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-gateway-image, build-sandbox-image, build-supervisor-image] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: actions: read @@ -396,7 +363,7 @@ jobs: conformance-artifact-prefix: openshell-conformance kubernetes-external-driver-e2e: - needs: [pr_metadata, build-cli, build-conformance, build-gateway-plain, build-driver-kubernetes, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-gateway-plain, build-external-drivers, build-sandbox-image, build-supervisor-image] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: actions: read @@ -413,7 +380,7 @@ jobs: conformance-artifact-prefix: openshell-conformance kubernetes-workspace-operator-e2e: - needs: [pr_metadata, build-cli, build-conformance, build-gateway-image, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-gateway-image, build-sandbox-image, build-supervisor-image] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: actions: read @@ -427,7 +394,7 @@ jobs: conformance-artifact-prefix: openshell-conformance kubernetes-ha-e2e: - needs: [pr_metadata, build-cli, build-conformance, build-gateway-image, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-gateway-image, build-sandbox-image, build-supervisor-image] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_kubernetes_ha_e2e == 'true' permissions: actions: read @@ -442,7 +409,7 @@ jobs: conformance-artifact-prefix: openshell-conformance kubernetes-credential-drivers-e2e: - needs: [pr_metadata, build-cli, build-conformance, build-gateway-image, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-gateway-image, build-sandbox-image, build-supervisor-image] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_kubernetes_credential_drivers_e2e == 'true' permissions: actions: read diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 5c51f1dedf..d9772a9d9e 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -1,43 +1,18 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -name: Build Binary +name: Build Binaries on: workflow_call: inputs: - package: - required: true - type: string - binary: - required: true - type: string - triple: - required: true - type: string - runner: - required: true - type: string cargo-version: required: true type: string - image-tag: - required: false - type: string - default: "" - artifact-name: - required: false - type: string - default: "" - extra-cargo-flags: + supervisor-image-tag: required: false type: string default: "" - interpreter: - description: Expected ELF program interpreter, "none" for static, or "skip" - required: false - type: string - default: skip checkout-ref: required: false type: string @@ -49,27 +24,122 @@ on: permissions: contents: read +env: + EXTRA_CARGO_FLAGS: "" + jobs: - build: - name: ${{ inputs.binary }} (${{ inputs.triple }}) - runs-on: ${{ inputs.runner }} + cli: + name: openshell (${{ matrix.triple }}) + env: + PACKAGE: openshell-cli + BINARY: openshell + strategy: + matrix: + include: + - triple: x86_64-unknown-linux-musl + runner: linux-amd64-cpu8 + - triple: aarch64-unknown-linux-musl + runner: linux-arm64-cpu8 + - triple: aarch64-apple-darwin + runner: macos-15-xlarge + runs-on: ${{ matrix.runner }} timeout-minutes: 60 - steps: + steps: &build_steps - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - ref: ${{ inputs['checkout-ref'] || github.sha }} - + persist-credentials: false + ref: ${{ inputs.checkout-ref || github.sha }} - uses: ./.github/actions/setup-nix with: cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - - uses: ./.github/actions/build-rust-binary with: - package: ${{ inputs.package }} - binary: ${{ inputs.binary }} - triple: ${{ inputs.triple }} - cargo-version: ${{ inputs['cargo-version'] }} - image-tag: ${{ inputs['image-tag'] }} - artifact-name: ${{ inputs['artifact-name'] }} - extra-cargo-flags: ${{ inputs['extra-cargo-flags'] }} - interpreter: ${{ inputs.interpreter }} + package: ${{ env.PACKAGE }} + binary: ${{ env.BINARY }} + triple: ${{ matrix.triple }} + cargo-version: ${{ inputs.cargo-version }} + supervisor-image-tag: ${{ inputs.supervisor-image-tag }} + extra-cargo-flags: ${{ env.EXTRA_CARGO_FLAGS }} + + conformance: + name: openshell-conformance (${{ matrix.triple }}) + env: + PACKAGE: openshell-conformance-cli + BINARY: openshell-conformance + strategy: + matrix: + include: + - triple: x86_64-unknown-linux-musl + runner: linux-amd64-cpu8 + - triple: aarch64-unknown-linux-musl + runner: linux-arm64-cpu8 + runs-on: ${{ matrix.runner }} + timeout-minutes: 60 + steps: *build_steps + + gateway: + name: openshell-gateway (${{ matrix.triple }}) + env: + PACKAGE: openshell-gateway + BINARY: openshell-gateway + strategy: + matrix: + include: + - triple: x86_64-unknown-linux-gnu + runner: linux-amd64-cpu8 + - triple: aarch64-unknown-linux-gnu + runner: linux-arm64-cpu8 + - triple: aarch64-apple-darwin + runner: macos-15-xlarge + runs-on: ${{ matrix.runner }} + timeout-minutes: 60 + steps: *build_steps + + runtimes: + name: ${{ matrix.binary }} (${{ matrix.triple }}) + env: + PACKAGE: ${{ matrix.package }} + BINARY: ${{ matrix.binary }} + strategy: + matrix: + include: + - package: openshell-sandbox + binary: openshell-sandbox + triple: x86_64-unknown-linux-musl + runner: linux-amd64-cpu8 + - package: openshell-sandbox + binary: openshell-sandbox + triple: aarch64-unknown-linux-musl + runner: linux-arm64-cpu8 + - package: openshell-supervisor + binary: openshell-supervisor + triple: x86_64-unknown-linux-gnu + runner: linux-amd64-cpu8 + - package: openshell-supervisor + binary: openshell-supervisor + triple: aarch64-unknown-linux-gnu + runner: linux-arm64-cpu8 + - package: openshell-supervisor + binary: openshell-supervisor + triple: aarch64-apple-darwin + runner: macos-15-xlarge + runs-on: ${{ matrix.runner }} + timeout-minutes: 60 + steps: *build_steps + + vm-init: + name: openshell-vm-init (${{ matrix.triple }}) + env: + PACKAGE: openshell-driver-vm + BINARY: openshell-vm-init + EXTRA_CARGO_FLAGS: --no-default-features + strategy: + matrix: + include: + - triple: x86_64-unknown-linux-musl + runner: linux-amd64-cpu8 + - triple: aarch64-unknown-linux-musl + runner: linux-arm64-cpu8 + runs-on: ${{ matrix.runner }} + timeout-minutes: 60 + steps: *build_steps diff --git a/.github/workflows/build-cli-binaries.yml b/.github/workflows/build-cli-binaries.yml deleted file mode 100644 index 95fd3e3914..0000000000 --- a/.github/workflows/build-cli-binaries.yml +++ /dev/null @@ -1,47 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -name: Build CLI Binaries - -on: - workflow_call: - inputs: - cargo-version: - required: true - type: string - image-tag: - required: false - type: string - default: "" - checkout-ref: - required: false - type: string - default: "" - secrets: - CACHIX_AUTH_TOKEN: - required: true - -permissions: - contents: read - -jobs: - build: - strategy: - matrix: - include: - - triple: x86_64-unknown-linux-musl - runner: linux-amd64-cpu8 - - triple: aarch64-unknown-linux-musl - runner: linux-arm64-cpu8 - - triple: aarch64-apple-darwin - runner: macos-15-xlarge - uses: ./.github/workflows/build-binaries.yml - with: - package: openshell-cli - binary: openshell - triple: ${{ matrix.triple }} - runner: ${{ matrix.runner }} - cargo-version: ${{ inputs.cargo-version }} - image-tag: ${{ inputs.image-tag }} - checkout-ref: ${{ inputs.checkout-ref }} - secrets: inherit diff --git a/.github/workflows/build-gateway-binaries.yml b/.github/workflows/build-gateway-binaries.yml deleted file mode 100644 index c53aeac0d1..0000000000 --- a/.github/workflows/build-gateway-binaries.yml +++ /dev/null @@ -1,47 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -name: Build Gateway Binaries - -on: - workflow_call: - inputs: - cargo-version: - required: true - type: string - image-tag: - required: false - type: string - default: "" - checkout-ref: - required: false - type: string - default: "" - secrets: - CACHIX_AUTH_TOKEN: - required: true - -permissions: - contents: read - -jobs: - build: - strategy: - matrix: - include: - - triple: x86_64-unknown-linux-gnu - runner: linux-amd64-cpu8 - - triple: aarch64-unknown-linux-gnu - runner: linux-arm64-cpu8 - - triple: aarch64-apple-darwin - runner: macos-15-xlarge - uses: ./.github/workflows/build-binaries.yml - with: - package: openshell-gateway - binary: openshell-gateway - triple: ${{ matrix.triple }} - runner: ${{ matrix.runner }} - cargo-version: ${{ inputs.cargo-version }} - image-tag: ${{ inputs.image-tag }} - checkout-ref: ${{ inputs.checkout-ref }} - secrets: inherit diff --git a/.github/workflows/build-runtime-binaries.yml b/.github/workflows/build-runtime-binaries.yml deleted file mode 100644 index a9fd011c69..0000000000 --- a/.github/workflows/build-runtime-binaries.yml +++ /dev/null @@ -1,62 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -name: Build Runtime Binaries - -on: - workflow_call: - inputs: - cargo-version: - required: true - type: string - image-tag: - required: false - type: string - default: "" - checkout-ref: - required: false - type: string - default: "" - secrets: - CACHIX_AUTH_TOKEN: - required: true - -permissions: - contents: read - -jobs: - build: - strategy: - matrix: - include: - - triple: x86_64-unknown-linux-musl - runner: linux-amd64-cpu8 - package: openshell-sandbox - binary: openshell-sandbox - interpreter: none - - triple: x86_64-unknown-linux-gnu - runner: linux-amd64-cpu8 - package: openshell-supervisor - binary: openshell-supervisor - interpreter: /lib64/ld-linux-x86-64.so.2 - - triple: aarch64-unknown-linux-musl - runner: linux-arm64-cpu8 - package: openshell-sandbox - binary: openshell-sandbox - interpreter: none - - triple: aarch64-unknown-linux-gnu - runner: linux-arm64-cpu8 - package: openshell-supervisor - binary: openshell-supervisor - interpreter: /lib/ld-linux-aarch64.so.1 - uses: ./.github/workflows/build-binaries.yml - with: - package: ${{ matrix.package }} - binary: ${{ matrix.binary }} - triple: ${{ matrix.triple }} - runner: ${{ matrix.runner }} - cargo-version: ${{ inputs.cargo-version }} - image-tag: ${{ inputs.image-tag }} - interpreter: ${{ matrix.interpreter }} - checkout-ref: ${{ inputs.checkout-ref }} - secrets: inherit diff --git a/.github/workflows/build-vm-driver.yml b/.github/workflows/build-vm-driver.yml index 2760efa977..c20706cdb2 100644 --- a/.github/workflows/build-vm-driver.yml +++ b/.github/workflows/build-vm-driver.yml @@ -9,7 +9,7 @@ on: cargo-version: required: true type: string - image-tag: + supervisor-image-tag: required: false type: string default: "" @@ -25,48 +25,8 @@ permissions: contents: read jobs: - host-supervisor-macos: - name: native host supervisor (aarch64-apple-darwin) - permissions: - contents: read - uses: ./.github/workflows/build-binaries.yml - with: - package: openshell-supervisor - binary: openshell-supervisor - triple: aarch64-apple-darwin - runner: macos-15-xlarge - cargo-version: ${{ inputs.cargo-version }} - image-tag: ${{ inputs.image-tag }} - checkout-ref: ${{ inputs.checkout-ref }} - secrets: inherit - - guest-init: - name: guest init (${{ matrix.triple }}) - strategy: - matrix: - include: - - arch: x86_64 - triple: x86_64-unknown-linux-musl - runner: linux-amd64-cpu8 - - arch: aarch64 - triple: aarch64-unknown-linux-musl - runner: linux-arm64-cpu8 - uses: ./.github/workflows/build-binaries.yml - with: - package: openshell-driver-vm - binary: openshell-vm-init - triple: ${{ matrix.triple }} - runner: ${{ matrix.runner }} - cargo-version: ${{ inputs.cargo-version }} - image-tag: ${{ inputs.image-tag }} - extra-cargo-flags: --no-default-features - interpreter: none - checkout-ref: ${{ inputs.checkout-ref }} - secrets: inherit - build: name: openshell-driver-vm (${{ matrix.triple }}) - needs: [guest-init, host-supervisor-macos] strategy: matrix: include: @@ -87,6 +47,7 @@ jobs: steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: + persist-credentials: false ref: ${{ inputs['checkout-ref'] || github.sha }} - uses: ./.github/actions/setup-nix @@ -144,4 +105,4 @@ jobs: binary: openshell-driver-vm triple: ${{ matrix.triple }} cargo-version: ${{ inputs['cargo-version'] }} - image-tag: ${{ inputs['image-tag'] }} + supervisor-image-tag: ${{ inputs['supervisor-image-tag'] }} diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index ff944ad58c..a349d8bc23 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -23,6 +23,8 @@ jobs: should_run: ${{ steps.gate.outputs.should_run }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - id: gate uses: ./.github/actions/pr-gate @@ -41,6 +43,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 + persist-credentials: false - name: Compute versions id: version @@ -56,46 +59,67 @@ jobs: build-cli: needs: version + runs-on: linux-amd64-cpu8 + timeout-minutes: 60 permissions: contents: read - uses: ./.github/workflows/build-binaries.yml - with: - package: openshell-cli - binary: openshell - triple: x86_64-unknown-linux-musl - runner: linux-amd64-cpu8 - cargo-version: ${{ needs.version.outputs.cargo }} - checkout-ref: ${{ github.sha }} - secrets: inherit + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + ref: ${{ github.sha }} + - uses: ./.github/actions/setup-nix + with: + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} + - uses: ./.github/actions/build-rust-binary + with: + package: openshell-cli + binary: openshell + triple: x86_64-unknown-linux-musl + cargo-version: ${{ needs.version.outputs.cargo }} build-conformance: needs: version + runs-on: linux-amd64-cpu8 + timeout-minutes: 60 permissions: contents: read - uses: ./.github/workflows/build-binaries.yml - with: - package: openshell-conformance-cli - binary: openshell-conformance - triple: x86_64-unknown-linux-musl - runner: linux-amd64-cpu8 - cargo-version: ${{ needs.version.outputs.cargo }} - checkout-ref: ${{ github.sha }} - secrets: inherit + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + ref: ${{ github.sha }} + - uses: ./.github/actions/setup-nix + with: + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} + - uses: ./.github/actions/build-rust-binary + with: + package: openshell-conformance-cli + binary: openshell-conformance + triple: x86_64-unknown-linux-musl + cargo-version: ${{ needs.version.outputs.cargo }} build-gateway: needs: version + runs-on: linux-amd64-cpu8 + timeout-minutes: 60 permissions: contents: read - uses: ./.github/workflows/build-binaries.yml - with: - package: openshell-gateway - binary: openshell-gateway - triple: x86_64-unknown-linux-gnu - runner: linux-amd64-cpu8 - cargo-version: ${{ needs.version.outputs.cargo }} - image-tag: dev - checkout-ref: ${{ github.sha }} - secrets: inherit + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + ref: ${{ github.sha }} + - uses: ./.github/actions/setup-nix + with: + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} + - uses: ./.github/actions/build-rust-binary + with: + package: openshell-gateway + binary: openshell-gateway + triple: x86_64-unknown-linux-gnu + cargo-version: ${{ needs.version.outputs.cargo }} + supervisor-image-tag: dev build-rpm: needs: [version, build-cli, build-gateway] diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml index bc40bb6df1..900040a803 100644 --- a/.github/workflows/release-dev.yml +++ b/.github/workflows/release-dev.yml @@ -6,8 +6,8 @@ on: workflow_dispatch: permissions: - contents: write - packages: write + contents: read + packages: read defaults: run: @@ -37,6 +37,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 + persist-credentials: false - name: Mark workspace safe for git run: git config --global --add safe.directory "$GITHUB_WORKSPACE" @@ -58,76 +59,39 @@ jobs: echo "rpm_release=$(uv run python tasks/scripts/release.py get-version --dev --rpm-release)" } >> "$GITHUB_OUTPUT" - build-cli: + build-binaries: needs: compute-versions permissions: contents: read - uses: ./.github/workflows/build-cli-binaries.yml - with: - cargo-version: ${{ needs.compute-versions.outputs.cargo_version }} - image-tag: dev - secrets: inherit - - build-conformance: - needs: compute-versions - permissions: - contents: read - strategy: - matrix: - include: - - triple: x86_64-unknown-linux-musl - runner: linux-amd64-cpu8 - - triple: aarch64-unknown-linux-musl - runner: linux-arm64-cpu8 uses: ./.github/workflows/build-binaries.yml - with: - package: openshell-conformance-cli - binary: openshell-conformance - artifact-name: openshell-conformance-${{ matrix.triple }} - triple: ${{ matrix.triple }} - runner: ${{ matrix.runner }} - cargo-version: ${{ needs.compute-versions.outputs.cargo_version }} - secrets: inherit - - build-gateway: - needs: compute-versions - permissions: - contents: read - uses: ./.github/workflows/build-gateway-binaries.yml - with: - cargo-version: ${{ needs.compute-versions.outputs.cargo_version }} - image-tag: dev - secrets: inherit - - build-runtimes: - needs: compute-versions - permissions: - contents: read - uses: ./.github/workflows/build-runtime-binaries.yml with: cargo-version: ${{ needs.compute-versions.outputs.cargo_version }} - image-tag: dev - secrets: inherit + supervisor-image-tag: dev + checkout-ref: ${{ github.sha }} + secrets: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} build-vm-driver: - needs: [compute-versions, build-runtimes] + needs: [compute-versions, build-binaries] permissions: contents: read uses: ./.github/workflows/build-vm-driver.yml with: cargo-version: ${{ needs.compute-versions.outputs.cargo_version }} - image-tag: dev - secrets: inherit + supervisor-image-tag: dev + checkout-ref: ${{ github.sha }} + secrets: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} package-binaries: - needs: [build-cli, build-gateway, build-runtimes, build-vm-driver] + needs: [build-binaries, build-vm-driver] permissions: actions: read contents: read uses: ./.github/workflows/package-release-binaries.yml build-gateway-image: - needs: build-gateway + needs: build-binaries permissions: contents: read packages: write @@ -136,10 +100,10 @@ jobs: component: gateway binary: openshell-gateway target-suffix: unknown-linux-gnu - secrets: inherit + checkout-ref: ${{ github.sha }} build-sandbox-image: - needs: build-runtimes + needs: build-binaries permissions: contents: read packages: write @@ -148,10 +112,10 @@ jobs: component: sandbox binary: openshell-sandbox target-suffix: unknown-linux-musl - secrets: inherit + checkout-ref: ${{ github.sha }} build-supervisor-image: - needs: build-runtimes + needs: build-binaries permissions: contents: read packages: write @@ -160,10 +124,10 @@ jobs: component: supervisor binary: openshell-supervisor target-suffix: unknown-linux-gnu - secrets: inherit + checkout-ref: ${{ github.sha }} docker-e2e: - needs: [build-cli, build-conformance, build-gateway, build-sandbox-image, build-supervisor-image] + needs: [build-binaries, build-sandbox-image, build-supervisor-image] permissions: actions: read contents: read @@ -171,11 +135,12 @@ jobs: uses: ./.github/workflows/e2e-docker-test.yml with: image-tag: ${{ github.sha }} + checkout-ref: ${{ github.sha }} runner: linux-arm64-cpu8 conformance-artifact-prefix: openshell-conformance podman-e2e: - needs: [build-cli, build-conformance, build-gateway, build-sandbox-image, build-supervisor-image] + needs: [build-binaries, build-sandbox-image, build-supervisor-image] permissions: actions: read contents: read @@ -183,16 +148,18 @@ jobs: uses: ./.github/workflows/e2e-podman-test.yml with: image-tag: ${{ github.sha }} + checkout-ref: ${{ github.sha }} conformance-artifact-prefix: openshell-conformance vm-e2e: - needs: [build-cli, build-conformance, build-gateway, build-vm-driver] + needs: [build-binaries, build-vm-driver] permissions: actions: read contents: read packages: read uses: ./.github/workflows/e2e-vm-test.yml with: + checkout-ref: ${{ github.sha }} conformance-artifact-prefix: openshell-conformance tag-ghcr-dev: @@ -200,6 +167,8 @@ jobs: needs: [build-gateway-image, build-sandbox-image, build-supervisor-image, release-dev] runs-on: linux-amd64-cpu8 timeout-minutes: 10 + permissions: + packages: write steps: - name: Log in to GHCR run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin @@ -233,6 +202,8 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 + persist-credentials: false + ref: ${{ github.sha }} - name: Mark workspace safe for git run: git config --global --add safe.directory "$GITHUB_WORKSPACE" @@ -256,16 +227,15 @@ jobs: build-deb: name: Build Debian Packages - needs: [compute-versions, build-cli, build-gateway, build-vm-driver] + needs: [compute-versions, build-binaries, build-vm-driver] uses: ./.github/workflows/deb-package.yml with: deb-version: ${{ needs.compute-versions.outputs.deb_version }} checkout-ref: ${{ github.sha }} - secrets: inherit build-snap: name: Build Snap - needs: [compute-versions, build-cli, build-gateway, build-runtimes] + needs: [compute-versions, build-binaries] uses: ./.github/workflows/snap-package.yml with: checkout-ref: ${{ github.sha }} @@ -276,14 +246,13 @@ jobs: build-rpm: name: Build RPM Packages - needs: [compute-versions, build-cli, build-gateway] + needs: [compute-versions, build-binaries] uses: ./.github/workflows/rpm-package.yml with: checkout-ref: ${{ github.sha }} rpm-version: ${{ needs.compute-versions.outputs.rpm_version }} rpm-release: ${{ needs.compute-versions.outputs.rpm_release }} cargo-version: ${{ needs.compute-versions.outputs.cargo_version }} - secrets: inherit smoke-linux-dev-artifacts: name: Smoke Linux Dev Artifacts (${{ matrix.name }}) @@ -431,6 +400,8 @@ jobs: wheel_filenames: ${{ steps.wheel_filenames.outputs.wheel_filenames }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Download all CLI artifacts uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 @@ -686,6 +657,8 @@ jobs: packages: write steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: ./.github/actions/release-helm-oci with: @@ -708,7 +681,8 @@ jobs: display_name: Dev availability: beta publish: true - secrets: inherit + secrets: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} trigger-wheel-publish: name: Trigger Wheel Publish diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml index dd41b53942..b746326671 100644 --- a/.github/workflows/release-tag.yml +++ b/.github/workflows/release-tag.yml @@ -12,8 +12,8 @@ on: type: string permissions: - contents: write - packages: write + contents: read + packages: read # Resolve the tag once: prefer the workflow_dispatch input, fall back to the # push-event ref. Every job references this via env.RELEASE_TAG. @@ -52,8 +52,9 @@ jobs: steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - ref: ${{ inputs.tag || github.ref }} fetch-depth: 0 + persist-credentials: false + ref: ${{ inputs.tag || github.ref }} - name: Mark workspace safe for git run: git config --global --add safe.directory "$GITHUB_WORKSPACE" @@ -85,81 +86,39 @@ jobs: echo "source_sha=$(git rev-parse HEAD)" } >> "$GITHUB_OUTPUT" - build-cli: + build-binaries: needs: compute-versions permissions: contents: read - uses: ./.github/workflows/build-cli-binaries.yml - with: - cargo-version: ${{ needs.compute-versions.outputs.cargo_version }} - image-tag: ${{ needs.compute-versions.outputs.semver }} - checkout-ref: ${{ inputs.tag || github.ref }} - secrets: inherit - - build-conformance: - needs: compute-versions - permissions: - contents: read - strategy: - matrix: - include: - - triple: x86_64-unknown-linux-musl - runner: linux-amd64-cpu8 - - triple: aarch64-unknown-linux-musl - runner: linux-arm64-cpu8 uses: ./.github/workflows/build-binaries.yml - with: - package: openshell-conformance-cli - binary: openshell-conformance - artifact-name: openshell-conformance-${{ matrix.triple }} - triple: ${{ matrix.triple }} - runner: ${{ matrix.runner }} - cargo-version: ${{ needs.compute-versions.outputs.cargo_version }} - checkout-ref: ${{ inputs.tag || github.ref }} - secrets: inherit - - build-gateway: - needs: compute-versions - permissions: - contents: read - uses: ./.github/workflows/build-gateway-binaries.yml with: cargo-version: ${{ needs.compute-versions.outputs.cargo_version }} - image-tag: ${{ needs.compute-versions.outputs.semver }} - checkout-ref: ${{ inputs.tag || github.ref }} - secrets: inherit - - build-runtimes: - needs: compute-versions - permissions: - contents: read - uses: ./.github/workflows/build-runtime-binaries.yml - with: - cargo-version: ${{ needs.compute-versions.outputs.cargo_version }} - image-tag: ${{ needs.compute-versions.outputs.semver }} - checkout-ref: ${{ inputs.tag || github.ref }} - secrets: inherit + supervisor-image-tag: ${{ needs.compute-versions.outputs.semver }} + checkout-ref: ${{ needs.compute-versions.outputs.source_sha }} + secrets: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} build-vm-driver: - needs: [compute-versions, build-runtimes] + needs: [compute-versions, build-binaries] permissions: contents: read uses: ./.github/workflows/build-vm-driver.yml with: cargo-version: ${{ needs.compute-versions.outputs.cargo_version }} - image-tag: ${{ needs.compute-versions.outputs.semver }} - checkout-ref: ${{ inputs.tag || github.ref }} - secrets: inherit + supervisor-image-tag: ${{ needs.compute-versions.outputs.semver }} + checkout-ref: ${{ needs.compute-versions.outputs.source_sha }} + secrets: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} package-binaries: - needs: [build-cli, build-gateway, build-runtimes, build-vm-driver] + needs: [build-binaries, build-vm-driver] permissions: actions: read contents: read uses: ./.github/workflows/package-release-binaries.yml build-gateway-image: - needs: [compute-versions, build-gateway] + needs: [compute-versions, build-binaries] permissions: contents: read packages: write @@ -169,11 +128,10 @@ jobs: binary: openshell-gateway target-suffix: unknown-linux-gnu image-tag: ${{ needs.compute-versions.outputs.source_sha }} - checkout-ref: ${{ inputs.tag || github.ref }} - secrets: inherit + checkout-ref: ${{ needs.compute-versions.outputs.source_sha }} build-sandbox-image: - needs: [compute-versions, build-runtimes] + needs: [compute-versions, build-binaries] permissions: contents: read packages: write @@ -183,11 +141,10 @@ jobs: binary: openshell-sandbox target-suffix: unknown-linux-musl image-tag: ${{ needs.compute-versions.outputs.source_sha }} - checkout-ref: ${{ inputs.tag || github.ref }} - secrets: inherit + checkout-ref: ${{ needs.compute-versions.outputs.source_sha }} build-supervisor-image: - needs: [compute-versions, build-runtimes] + needs: [compute-versions, build-binaries] permissions: contents: read packages: write @@ -197,11 +154,10 @@ jobs: binary: openshell-supervisor target-suffix: unknown-linux-gnu image-tag: ${{ needs.compute-versions.outputs.source_sha }} - checkout-ref: ${{ inputs.tag || github.ref }} - secrets: inherit + checkout-ref: ${{ needs.compute-versions.outputs.source_sha }} docker-e2e: - needs: [compute-versions, build-cli, build-conformance, build-gateway, build-sandbox-image, build-supervisor-image] + needs: [compute-versions, build-binaries, build-sandbox-image, build-supervisor-image] permissions: actions: read contents: read @@ -209,12 +165,12 @@ jobs: uses: ./.github/workflows/e2e-docker-test.yml with: image-tag: ${{ needs.compute-versions.outputs.source_sha }} - checkout-ref: ${{ inputs.tag || github.ref }} + checkout-ref: ${{ needs.compute-versions.outputs.source_sha }} runner: linux-arm64-cpu8 conformance-artifact-prefix: openshell-conformance podman-e2e: - needs: [compute-versions, build-cli, build-conformance, build-gateway, build-sandbox-image, build-supervisor-image] + needs: [compute-versions, build-binaries, build-sandbox-image, build-supervisor-image] permissions: actions: read contents: read @@ -222,18 +178,18 @@ jobs: uses: ./.github/workflows/e2e-podman-test.yml with: image-tag: ${{ needs.compute-versions.outputs.source_sha }} - checkout-ref: ${{ inputs.tag || github.ref }} + checkout-ref: ${{ needs.compute-versions.outputs.source_sha }} conformance-artifact-prefix: openshell-conformance vm-e2e: - needs: [compute-versions, build-cli, build-conformance, build-gateway, build-vm-driver] + needs: [compute-versions, build-binaries, build-vm-driver] permissions: actions: read contents: read packages: read uses: ./.github/workflows/e2e-vm-test.yml with: - checkout-ref: ${{ inputs.tag || github.ref }} + checkout-ref: ${{ needs.compute-versions.outputs.source_sha }} conformance-artifact-prefix: openshell-conformance tag-ghcr-release: @@ -241,6 +197,8 @@ jobs: needs: [compute-versions, build-gateway-image, build-sandbox-image, build-supervisor-image, release] runs-on: linux-amd64-cpu8 timeout-minutes: 10 + permissions: + packages: write steps: - name: Log in to GHCR run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin @@ -248,11 +206,11 @@ jobs: - name: Tag images with release version env: IS_PRERELEASE: ${{ needs.compute-versions.outputs.is_prerelease }} + SOURCE_TAG: ${{ needs.compute-versions.outputs.source_sha }} + VERSION: ${{ needs.compute-versions.outputs.semver }} run: | set -euo pipefail REGISTRY="ghcr.io/nvidia/openshell" - VERSION="${{ needs.compute-versions.outputs.semver }}" - SOURCE_TAG="${{ needs.compute-versions.outputs.source_sha }}" for component in gateway sandbox supervisor; do echo "Tagging ${REGISTRY}/${component}:${SOURCE_TAG} as ${VERSION}..." docker buildx imagetools create \ @@ -284,8 +242,9 @@ jobs: steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - ref: ${{ inputs.tag || github.ref }} fetch-depth: 0 + persist-credentials: false + ref: ${{ needs.compute-versions.outputs.source_sha }} - name: Mark workspace safe for git run: git config --global --add safe.directory "$GITHUB_WORKSPACE" @@ -308,19 +267,18 @@ jobs: build-deb: name: Build Debian Packages - needs: [compute-versions, build-cli, build-gateway, build-vm-driver] + needs: [compute-versions, build-binaries, build-vm-driver] uses: ./.github/workflows/deb-package.yml with: deb-version: ${{ needs.compute-versions.outputs.deb_version }} - checkout-ref: ${{ inputs.tag || github.ref }} - secrets: inherit + checkout-ref: ${{ needs.compute-versions.outputs.source_sha }} build-snap: name: Build Snap - needs: [compute-versions, build-cli, build-gateway, build-runtimes] + needs: [compute-versions, build-binaries] uses: ./.github/workflows/snap-package.yml with: - checkout-ref: ${{ inputs.tag || github.ref }} + checkout-ref: ${{ needs.compute-versions.outputs.source_sha }} upload-channel: ${{ needs.compute-versions.outputs.is_prerelease == 'true' && 'latest/edge' || 'latest/stable' }} github-environment: ${{ needs.compute-versions.outputs.is_prerelease == 'true' && 'latest/edge' || 'latest/stable' }} publish: ${{ needs.compute-versions.outputs.is_prerelease != 'true' }} @@ -329,14 +287,13 @@ jobs: build-rpm: name: Build RPM Packages - needs: [compute-versions, build-cli, build-gateway] + needs: [compute-versions, build-binaries] uses: ./.github/workflows/rpm-package.yml with: - checkout-ref: ${{ inputs.tag || github.ref }} + checkout-ref: ${{ needs.compute-versions.outputs.source_sha }} rpm-version: ${{ needs.compute-versions.outputs.rpm_version }} rpm-release: ${{ needs.compute-versions.outputs.rpm_release }} cargo-version: ${{ needs.compute-versions.outputs.cargo_version }} - secrets: inherit smoke-linux-release-artifacts: name: Smoke Linux Release Artifacts (${{ matrix.name }}) @@ -510,7 +467,8 @@ jobs: steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - ref: ${{ inputs.tag || github.ref }} + persist-credentials: false + ref: ${{ needs.compute-versions.outputs.source_sha }} - name: Download all CLI artifacts uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 @@ -722,7 +680,8 @@ jobs: release_version: ${{ needs.compute-versions.outputs.semver }} display_name: Latest (v${{ needs.compute-versions.outputs.semver }}) publish: true - secrets: inherit + secrets: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} publish-sdk-typescript: name: Publish TypeScript SDK @@ -741,7 +700,8 @@ jobs: steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - ref: ${{ inputs.tag || github.ref }} + persist-credentials: false + ref: ${{ needs.compute-versions.outputs.source_sha }} - name: Mark workspace safe for git run: git config --global --add safe.directory "$GITHUB_WORKSPACE" @@ -775,7 +735,8 @@ jobs: steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - ref: ${{ inputs.tag || github.ref }} + persist-credentials: false + ref: ${{ needs.compute-versions.outputs.source_sha }} - uses: ./.github/actions/release-helm-oci with: From 6d496f540a1a2e5c49687cddd68d56dc82cd5ebb Mon Sep 17 00:00:00 2001 From: Shiju Date: Thu, 17 Sep 2026 12:45:32 +0000 Subject: [PATCH 2/4] fix(supervisor-network): validate and normalize OPA matchers (#3373) * fix(supervisor-network): normalize OPA query and MCP matchers Lower nonempty raw query and MCP parameter strings to explicit glob matchers while preserving empty scalar query deny behavior. Cover cross-format configuration and authorization parity, gateway reload retention and repair, and supervisor local-file startup. Align the mocked parity harness with the Debian supervisor image and sandbox-boundary manifest fields introduced by RFC 0012. Signed-off-by: Shiju * fix(supervisor-network): reject null MCP matcher maps Require explicit MCP params values to be maps before tool-alias normalization. Cover YAML and JSON startup validation, rejected reload retention, and valid omitted, empty, and explicit matcher maps. Document the map contract for allow and deny rules. Signed-off-by: Shiju --------- Signed-off-by: Shiju --- architecture/security-policy.md | 4 + .../src/l7/mod.rs | 4 +- .../openshell-supervisor-network/src/opa.rs | 626 ++++++++++++++++++ crates/openshell-supervisor/src/lib.rs | 239 +++++++ docs/reference/policy-schema.mdx | 4 +- 5 files changed, 875 insertions(+), 2 deletions(-) diff --git a/architecture/security-policy.md b/architecture/security-policy.md index 5507f42709..4b9dd61334 100644 --- a/architecture/security-policy.md +++ b/architecture/security-policy.md @@ -218,6 +218,10 @@ same effective configuration path. The OPA loader checks the object and list shapes of raw policy data before injecting runtime fields, normalizing values, or expanding access presets. It rejects the first malformed container with a fixed structural error that excludes authored keys and values. This check preserves valid versionless OPA data and runtime-only fields. A rejected OPA engine reload leaves that engine's installed policy, generation, and decisions unchanged; the supervisor separately applies its configured runtime rejection mode. +After validating L7 rules, the OPA loader converts nonempty string query and MCP parameter matchers into explicit `glob` objects, including MCP `tool` aliases and deny rules. Matchers representable in both YAML and protobuf therefore expose the same representation to endpoint configuration consumers. Already lowered `glob` and `any` matchers retain their values across reloads; normalization preserves runtime endpoint provenance. Empty scalar query matchers remain an OPA-only form because Rego gives them different behavior from empty `glob` objects. + +An explicitly supplied MCP rule `params` value must be a map in both allow and deny rules. Omit the field when using only the `tool` alias; `params: null` is rejected before alias lowering. A rejected raw policy reload preserves the active evaluator and its generation. + The supervisor validates complete effective policy generations before activation. Overlapping endpoint selectors may contribute request allow and deny rules only when their connection and request-processing metadata agree; diff --git a/crates/openshell-supervisor-network/src/l7/mod.rs b/crates/openshell-supervisor-network/src/l7/mod.rs index 2085b46681..e51422dbc6 100644 --- a/crates/openshell-supervisor-network/src/l7/mod.rs +++ b/crates/openshell-supervisor-network/src/l7/mod.rs @@ -1019,9 +1019,11 @@ fn validate_mcp_params_field( has_tool: bool, mcp_strict_tool_names: bool, ) { - let Some(params) = rule.get("params").filter(|v| !v.is_null()) else { + let Some(params) = rule.get("params") else { return; }; + // Explicit params must be a map: tool alias lowering inserts params.name + // into it, so accepting null would discard the tool selector. let Some(params_obj) = params.as_object() else { errors.push(format!("{loc}.params: expected map of matchers")); return; diff --git a/crates/openshell-supervisor-network/src/opa.rs b/crates/openshell-supervisor-network/src/opa.rs index ccb9e76d2d..a2237d5e4e 100644 --- a/crates/openshell-supervisor-network/src/opa.rs +++ b/crates/openshell-supervisor-network/src/opa.rs @@ -1923,6 +1923,31 @@ fn normalize_l7_rule_aliases( ); } } + + // MCP tool aliases must move into params before matcher normalization so + // both authored forms produce the same endpoint configuration as protobuf. + normalize_l7_matcher_map(rule, "query"); + normalize_l7_matcher_map(rule, "params"); +} + +/// Normalize nonempty matcher leaves to the protobuf runtime representation. +/// +/// OPA data also accepts explicit `glob` and `any` objects. Keeping those intact +/// makes normalization idempotent for already lowered data and protobuf reloads. +fn normalize_l7_matcher_map(rule: &mut serde_json::Map, field: &str) { + let Some(matchers) = rule + .get_mut(field) + .and_then(serde_json::Value::as_object_mut) + else { + return; + }; + for matcher in matchers.values_mut() { + // Rego permits an empty scalar to match an empty query value, whereas + // an empty glob object never matches. Preserve this OPA-only form. + if matcher.as_str().is_some_and(|glob| !glob.is_empty()) { + *matcher = serde_json::json!({ "glob": matcher.take() }); + } + } } /// Normalize a path by resolving `.` and `..` components without touching @@ -3367,6 +3392,607 @@ mod tests { ); } + fn assert_endpoint_config_parity( + yaml_config: &serde_json::Value, + proto_config: &serde_json::Value, + canonical_policy: &ProtoSandboxPolicy, + endpoint: &NetworkEndpoint, + ) { + assert!(yaml_config.get("endpoint_id").is_none()); + assert!(yaml_config.get("policy_hash").is_none()); + let mut expected = yaml_config.clone(); + if is_mcp_protocol(&endpoint.protocol) { + // Gateway MCP observations carry canonical endpoint/policy identity. + // Derive only that metadata independently; compare every remaining + // configuration field without filtering actual runtime output. + expected["endpoint_id"] = openshell_core::endpoint_status::endpoint_id(endpoint).into(); + expected["policy_hash"] = deterministic_policy_hash(canonical_policy).into(); + assert_eq!(proto_config["endpoint_id"], expected["endpoint_id"]); + assert_eq!(proto_config["policy_hash"], expected["policy_hash"]); + } else { + assert!(proto_config.get("endpoint_id").is_none()); + assert!(proto_config.get("policy_hash").is_none()); + } + assert_eq!( + &expected, proto_config, + "{}: endpoint configuration must match apart from verified gateway identity", + endpoint.protocol + ); + } + + #[test] + fn yaml_and_proto_loads_have_protocol_config_and_authorization_parity() { + let data = r#" +version: 1 +network_policies: + parity: + name: parity + endpoints: + - host: rest.parity.test + port: 443 + path: /items/** + protocol: rest + enforcement: enforce + allow_encoded_slash: true + rules: + - allow: { method: GET, path: /items/** } + - host: graphql.parity.test + port: 443 + path: /graphql + protocol: graphql + enforcement: enforce + graphql_max_body_bytes: 65536 + rules: + - allow: + operation_type: query + operation_name: GetWidget + fields: [id, name] + - host: websocket.parity.test + port: 443 + path: /graphql + protocol: websocket + enforcement: enforce + websocket_credential_rewrite: true + rules: + - allow: { method: GET, path: /graphql } + - allow: + operation_type: subscription + fields: [messageAdded] + - host: jsonrpc.parity.test + port: 443 + path: /rpc + protocol: json-rpc + enforcement: enforce + json_rpc: { max_body_bytes: 32768 } + rules: + - allow: { method: status.get } + - host: mcp.parity.test + port: 443 + path: /mcp + protocol: mcp + enforcement: enforce + mcp: + max_body_bytes: 16384 + strict_tool_names: false + rules: + - allow: + method: tools/call + tool: read_status + binaries: + - { path: /usr/bin/curl } +"#; + let proto = openshell_policy::parse_sandbox_policy(data) + .expect("protocol parity fixture must parse into the typed schema"); + let proto = openshell_policy::validate_and_canonicalize_sandbox_policy(proto) + .expect("protocol parity fixture must canonicalize"); + let yaml_engine = OpaEngine::from_strings(TEST_POLICY, data).expect("engine from YAML"); + let proto_engine = OpaEngine::from_proto(&proto).expect("engine from protobuf"); + + let cases = [ + ( + "REST", + "rest.parity.test", + l7_input("rest.parity.test", 443, "GET", "/items/one"), + l7_input("rest.parity.test", 443, "DELETE", "/items/one"), + ), + ( + "GraphQL", + "graphql.parity.test", + l7_graphql_input( + "graphql.parity.test", + serde_json::json!([{ + "operation_type": "query", + "operation_name": "GetWidget", + "fields": ["id"], + "persisted_query": false + }]), + ), + l7_graphql_input( + "graphql.parity.test", + serde_json::json!([{ + "operation_type": "mutation", + "operation_name": "DeleteWidget", + "fields": ["id"], + "persisted_query": false + }]), + ), + ), + ( + "WebSocket", + "websocket.parity.test", + l7_websocket_graphql_input( + "websocket.parity.test", + serde_json::json!([{ + "operation_type": "subscription", + "fields": ["messageAdded"], + "persisted_query": false + }]), + ), + l7_websocket_graphql_input( + "websocket.parity.test", + serde_json::json!([{ + "operation_type": "subscription", + "fields": ["adminAuditLog"], + "persisted_query": false + }]), + ), + ), + ( + "JSON-RPC", + "jsonrpc.parity.test", + l7_jsonrpc_input("jsonrpc.parity.test", 443, "/rpc", "status.get"), + l7_jsonrpc_input("jsonrpc.parity.test", 443, "/rpc", "status.delete"), + ), + ( + "MCP", + "mcp.parity.test", + l7_jsonrpc_input_with_params( + "mcp.parity.test", + 443, + "/mcp", + "tools/call", + serde_json::json!({ "name": "read_status" }), + ), + l7_jsonrpc_input_with_params( + "mcp.parity.test", + 443, + "/mcp", + "tools/call", + serde_json::json!({ "name": "delete_status" }), + ), + ), + ]; + + for (protocol, host, allowed, denied) in cases { + let network_input = NetworkInput { + host: host.to_string(), + port: 443, + binary_path: PathBuf::from("/usr/bin/curl"), + binary_sha256: "unused".to_string(), + ancestors: vec![], + cmdline_paths: vec![], + }; + let yaml_config = yaml_engine + .query_endpoint_config(&network_input) + .expect("query YAML endpoint config") + .unwrap_or_else(|| panic!("{protocol}: expected YAML endpoint config")); + let proto_config = proto_engine + .query_endpoint_config(&network_input) + .expect("query protobuf endpoint config") + .unwrap_or_else(|| panic!("{protocol}: expected protobuf endpoint config")); + let yaml_config: serde_json::Value = serde_json::from_str( + &yaml_config + .to_json_str() + .expect("YAML endpoint config must serialize"), + ) + .expect("YAML endpoint config must be JSON"); + let proto_config: serde_json::Value = serde_json::from_str( + &proto_config + .to_json_str() + .expect("protobuf endpoint config must serialize"), + ) + .expect("protobuf endpoint config must be JSON"); + + let endpoint = proto.network_policies["parity"] + .endpoints + .iter() + .find(|endpoint| endpoint.host == host) + .expect("fixture contains the exact endpoint"); + assert_endpoint_config_parity(&yaml_config, &proto_config, &proto, endpoint); + assert_eq!( + yaml_config.get("mcp_versions").is_some(), + protocol == "MCP", + "{protocol}: only MCP endpoints carry revision state" + ); + assert!( + eval_l7(&yaml_engine, &allowed) && eval_l7(&proto_engine, &allowed), + "{protocol}: equivalent allowed request must pass both ingress formats" + ); + assert!( + !eval_l7(&yaml_engine, &denied) && !eval_l7(&proto_engine, &denied), + "{protocol}: equivalent denied request must fail both ingress formats" + ); + } + } + + #[test] + fn yaml_and_proto_matchers_retain_decisions_and_provenance_across_reload() { + // Exercise allow and deny matchers through both public loaders. The + // denied request also matches the allow rule, proving deny precedence. + for (protocol, selector, allowed, denied) in [ + ( + "rest", + "query", + serde_json::json!({"name": ["read_status"]}), + serde_json::json!({"name": ["read_secret"]}), + ), + ( + "mcp", + "params", + serde_json::json!({"name": "read_status"}), + serde_json::json!({"name": "read_secret"}), + ), + ] { + let method = if protocol == "mcp" { + "tools/call" + } else { + "GET" + }; + let path = if protocol == "rest" { "path: /**" } else { "" }; + let deny_matcher = if protocol == "rest" { + "\"read_sec*\"" + } else { + "{any: [read_secret, read_private]}" + }; + let source = format!( + r#" +version: 1 +network_policies: + matchers: + name: matchers + endpoints: + - host: matchers.parity.test + port: 443 + protocol: {protocol} + enforcement: enforce + rules: + - allow: + method: {method} + {path} + {selector}: {{name: "read_*"}} + deny_rules: + - method: {method} + {path} + {selector}: {{name: {deny_matcher}}} + binaries: + - {{path: /usr/bin/curl}} +"# + ); + let mut proto = + openshell_policy::parse_sandbox_policy(&source).expect("authored policy"); + let endpoint = &mut proto + .network_policies + .get_mut("matchers") + .unwrap() + .endpoints[0]; + endpoint.provider_credentialed = true; + endpoint.advisor_proposed = true; + let proto = openshell_policy::validate_and_canonicalize_sandbox_policy(proto) + .expect("runtime provenance fixture must canonicalize"); + let mut data: serde_json::Value = serde_yml::from_str(&source).unwrap(); + let endpoint = &mut data["network_policies"]["matchers"]["endpoints"][0]; + endpoint["provider_credentialed"] = true.into(); + endpoint["advisor_proposed"] = true.into(); + // Versionless data and runtime provenance are accepted OPA inputs. + data.as_object_mut().unwrap().remove("version"); + let yaml_engine = OpaEngine::from_strings(TEST_POLICY, &data.to_string()).unwrap(); + let proto_engine = OpaEngine::from_proto(&proto).unwrap(); + let input = NetworkInput { + host: "matchers.parity.test".into(), + port: 443, + binary_path: "/usr/bin/curl".into(), + binary_sha256: String::new(), + ancestors: vec![], + cmdline_paths: vec![], + }; + let request = |value| { + if protocol == "mcp" { + l7_jsonrpc_input_with_params(&input.host, 443, "/", method, value) + } else { + l7_input_with_query(&input.host, 443, method, "/", value) + } + }; + let allowed = request(allowed); + let denied = request(denied); + let normalized = preprocess_yaml_data(&data.to_string(), true, None).unwrap(); + assert_eq!( + normalized, + preprocess_yaml_data(&normalized, true, None).unwrap() + ); + + for phase in ["startup", "reload"] { + if phase == "reload" { + yaml_engine.reload(TEST_POLICY, &normalized).unwrap(); + proto_engine.reload_from_proto(&proto).unwrap(); + } + let yaml_config = yaml_engine.query_endpoint_config(&input).unwrap().unwrap(); + let proto_config = proto_engine.query_endpoint_config(&input).unwrap().unwrap(); + assert_endpoint_config_parity( + &serde_json::from_str(&yaml_config.to_json_str().unwrap()).unwrap(), + &serde_json::from_str(&proto_config.to_json_str().unwrap()).unwrap(), + &proto, + &proto.network_policies["matchers"].endpoints[0], + ); + for engine in [&yaml_engine, &proto_engine] { + let snapshot = engine.authorize_egress(&input).unwrap(); + assert_eq!(snapshot.generation, u64::from(phase == "reload")); + assert_eq!( + yaml_config["provider_credentialed"], + regorus::Value::Bool(true) + ); + assert_eq!(yaml_config["advisor_proposed"], regorus::Value::Bool(true)); + assert!(eval_l7(engine, &allowed), "{protocol} {phase}: allow"); + assert!( + !eval_l7(engine, &denied), + "{protocol} {phase}: deny takes precedence" + ); + } + } + } + } + + #[test] + fn yaml_and_proto_sql_and_l4_policies_have_config_and_decision_parity() { + // SQL policy classification is audit-only. Check its rule decisions + // here without claiming that the proxy enforces SQL commands. + for (protocol, fields) in [ + ( + "sql", + "enforcement: audit\n rules: [{allow: {command: SELECT}}]", + ), + ("tcp", ""), + ("", ""), + ] { + let source = format!( + r#" +version: 1 +network_policies: + parity: + name: parity + endpoints: + - host: sql-l4.parity.test + port: 443 + protocol: "{protocol}" + {fields} + binaries: + - {{path: /usr/bin/curl}} +"# + ); + let proto = openshell_policy::parse_sandbox_policy(&source).unwrap(); + let yaml_engine = OpaEngine::from_strings(TEST_POLICY, &source).unwrap(); + let proto_engine = OpaEngine::from_proto(&proto).unwrap(); + let mut input = NetworkInput { + host: "sql-l4.parity.test".into(), + port: 443, + binary_path: "/usr/bin/curl".into(), + binary_sha256: String::new(), + ancestors: vec![], + cmdline_paths: vec![], + }; + assert_eq!( + yaml_engine.query_endpoint_config(&input).unwrap(), + proto_engine.query_endpoint_config(&input).unwrap() + ); + for engine in [&yaml_engine, &proto_engine] { + assert!(matches!( + engine.evaluate_network_action(&input).unwrap(), + NetworkAction::Allow { .. } + )); + if protocol == "sql" { + let config = engine.query_endpoint_config(&input).unwrap().unwrap(); + assert_eq!(config["enforcement"], regorus::Value::from("audit")); + let mut request = l7_input(&input.host, 443, "", "/"); + request["request"]["command"] = "SELECT".into(); + assert!(eval_l7(engine, &request)); + request["request"]["command"] = "DELETE".into(); + assert!(!eval_l7(engine, &request)); + } + } + input.host = "unlisted.parity.test".into(); + for engine in [&yaml_engine, &proto_engine] { + assert!(matches!( + engine.evaluate_network_action(&input).unwrap(), + NetworkAction::Deny { .. } + )); + } + } + } + + #[test] + fn raw_mcp_params_maps_preserve_denials_and_reject_malformed_reload() { + let valid = serde_json::json!({ + "network_policies": { + "tools": { + "endpoints": [{ + "host": "mcp.params.test", + "port": 443, + "protocol": "mcp", + "enforcement": "enforce", + "rules": [{"allow": {"method": "tools/call", "tool": "read_*"}}], + "deny_rules": [{"method": "tools/call", "tool": "read_secret"}] + }], + "binaries": [{"path": "/usr/bin/curl"}] + } + } + }); + let request = |name: &str| { + l7_jsonrpc_input_with_params( + "mcp.params.test", + 443, + "/mcp", + "tools/call", + serde_json::json!({"name": name}), + ) + }; + let allowed = request("read_status"); + let denied = request("read_secret"); + + for yaml in [true, false] { + let encode = |data: &serde_json::Value| { + if yaml { + serde_yml::to_string(data).expect("serialize YAML policy") + } else { + data.to_string() + } + }; + let engine = OpaEngine::from_strings(TEST_POLICY, &encode(&valid)) + .expect("omitted params must preserve tool aliases"); + assert!(eval_l7(&engine, &allowed)); + assert!(!eval_l7(&engine, &denied)); + let generation = engine.current_generation(); + + // Every raw rule shape must reject before normalization can remove + // an alias. Failed reloads must leave both allow and deny intact. + for (rule_pointer, flat_allow, diagnostic) in [ + ( + "/rules/0/allow", + false, + "rules[0].allow.params: expected map of matchers", + ), + ( + "/rules/0", + true, + "rules[0].allow.params: expected map of matchers", + ), + ( + "/deny_rules/0", + false, + "deny_rules[0].params: expected map of matchers", + ), + ] { + for params in [ + serde_json::Value::Null, + serde_json::json!([]), + serde_json::json!("invalid"), + serde_json::json!(false), + serde_json::json!(42), + ] { + let mut candidate = valid.clone(); + let endpoint = &mut candidate["network_policies"]["tools"]["endpoints"][0]; + if flat_allow { + endpoint["rules"][0] = endpoint["rules"][0]["allow"].take(); + } + endpoint + .pointer_mut(rule_pointer) + .expect("fixture rule exists")["params"] = params; + // The validator identifies the malformed field internally; + // public load errors must redact authored policy details. + let (errors, _) = crate::l7::validate_l7_policies(&candidate); + assert!( + errors.iter().any(|error| error.contains(diagnostic)), + "{errors:?}" + ); + let source = encode(&candidate); + let error = OpaEngine::from_strings(TEST_POLICY, &source) + .err() + .expect("non-map params must reject at startup"); + // A malformed rule may produce multiple safe categories. + assert!( + error + .to_string() + .contains("invalid L7 policy configuration"), + "{error}" + ); + assert_safe_load_error(&error, &[diagnostic, "mcp.params.test", "read_secret"]); + let error = engine + .reload(TEST_POLICY, &source) + .expect_err("non-map params must reject on reload"); + assert!( + error + .to_string() + .contains("invalid L7 policy configuration"), + "{error}" + ); + assert_safe_load_error(&error, &[diagnostic, "mcp.params.test", "read_secret"]); + assert_eq!(engine.current_generation(), generation); + assert!(eval_l7(&engine, &allowed)); + assert!(!eval_l7(&engine, &denied)); + } + } + + // Empty maps accept alias insertion; explicit name maps retain the + // same selector without an alias. Neither form may erase a deny. + for explicit_name in [false, true] { + let mut candidate = valid.clone(); + let endpoint = &mut candidate["network_policies"]["tools"]["endpoints"][0]; + for pointer in ["/rules/0/allow", "/deny_rules/0"] { + let rule = endpoint.pointer_mut(pointer).expect("fixture rule exists"); + rule["params"] = if explicit_name { + let tool = rule.as_object_mut().expect("rule map").remove("tool"); + serde_json::json!({"name": tool.expect("fixture tool selector")}) + } else { + serde_json::json!({}) + }; + } + let source = encode(&candidate); + let control = OpaEngine::from_strings(TEST_POLICY, &source) + .expect("valid matcher map must load"); + assert!(eval_l7(&control, &allowed)); + assert!(!eval_l7(&control, &denied)); + let previous_generation = engine.current_generation(); + engine + .reload(TEST_POLICY, &source) + .expect("valid matcher map must reload after rejection"); + assert_eq!(engine.current_generation(), previous_generation + 1); + assert!(eval_l7(&engine, &allowed)); + assert!(!eval_l7(&engine, &denied)); + } + } + } + + #[test] + fn yaml_empty_query_matcher_retains_deny_semantics_across_reload() { + // Empty scalar matchers are OPA-only: an empty protobuf glob has no + // presence and is rejected. Rego strings can still match empty input. + let source = r#" +network_policies: + empty_query: + name: empty_query + endpoints: + - host: empty.parity.test + port: 443 + protocol: rest + enforcement: enforce + access: full + deny_rules: + - method: GET + path: /** + query: {name: ""} + binaries: + - {path: /usr/bin/curl} +"#; + let engine = OpaEngine::from_strings(TEST_POLICY, source).unwrap(); + for phase in ["startup", "reload"] { + if phase == "reload" { + engine.reload(TEST_POLICY, source).unwrap(); + } + for (value, allowed) in [("", false), ("present", true)] { + let request = l7_input_with_query( + "empty.parity.test", + 443, + "GET", + "/", + serde_json::json!({"name": [value]}), + ); + assert_eq!( + eval_l7(&engine, &request), + allowed, + "{phase}: name={value:?}" + ); + } + } + } + const POLICY_DNS_SNAPSHOT_DATA: &str = r#" network_policies: dns_transport: diff --git a/crates/openshell-supervisor/src/lib.rs b/crates/openshell-supervisor/src/lib.rs index 92c9b011fa..e05da07067 100644 --- a/crates/openshell-supervisor/src/lib.rs +++ b/crates/openshell-supervisor/src/lib.rs @@ -5280,6 +5280,245 @@ network_policies: handle.abort(); } + fn proto_provenance_policy_fixture() -> openshell_core::proto::SandboxPolicy { + let mut policy = proto_tcp_policy_fixture(); + policy.landlock = proto_policy_fixture().landlock; + let endpoint = &mut policy.network_policies.get_mut("redis").unwrap().endpoints[0]; + endpoint.host = "allowed.example.com".into(); + endpoint.port = 443; + endpoint.ports = vec![443]; + endpoint.protocol.clear(); + // Typed validation must retain gateway provenance so OPA can apply + // credential guards and distinguish advisor-proposed endpoints. + endpoint.provider_credentialed = true; + endpoint.advisor_proposed = true; + policy + } + + fn assert_gateway_policy_authorization( + engine: &OpaEngine, + allowed_host: &str, + generation: u64, + ) { + use openshell_supervisor_network::opa::{NetworkAction, NetworkInput}; + + assert_eq!(engine.current_generation(), generation); + for host in ["allowed.example.com", "repaired.example.com"] { + let input = NetworkInput { + host: host.into(), + port: 443, + binary_path: "/usr/bin/redis-cli".into(), + binary_sha256: String::new(), + ancestors: vec![], + cmdline_paths: vec![], + }; + let authorization = engine.authorize_egress(&input).expect("authorize endpoint"); + assert_eq!(authorization.generation, generation); + assert_eq!( + matches!(authorization.action, NetworkAction::Allow { .. }), + host == allowed_host, + "unexpected authorization for {host}" + ); + if host == allowed_host { + assert!(!authorization.exact_declared_endpoint_host); + let guards = engine + .query_endpoint_credential_guards(&input) + .expect("query credential provenance"); + assert_eq!(guards.len(), 1); + assert!( + openshell_supervisor_network::l7::parse_endpoint_credential_guard(&guards[0]) + .provider_credentialed + ); + } + } + } + + async fn assert_gateway_reload_rejects_and_repairs(registry_changed: bool) { + let policy = proto_provenance_policy_fixture(); + let engine = OpaEngine::from_proto(&policy).expect("build initial gateway policy"); + install_builtin_middleware_registry(&engine) + .await + .expect("install initial registry"); + let generation = engine.current_generation(); + assert_gateway_policy_authorization(&engine, "allowed.example.com", generation); + + let connections = Arc::new(AtomicUsize::new(0)); + let connections_for_connector = connections.clone(); + let connector: MiddlewareConnector = Arc::new(move |services, authentication| { + connections_for_connector.fetch_add(1, Ordering::Relaxed); + Box::pin(async move { connect_middleware_registry(&services, &authentication).await }) + }); + let authentication = MiddlewareAuthentication::default(); + let middleware = || MiddlewareReloadContext { + desired_services: &[], + authentication: &authentication, + registry_changed, + connector: &connector, + }; + let mut candidate = policy; + candidate.landlock.as_mut().unwrap().compatibility = "unsupported".into(); + candidate + .network_policies + .get_mut("redis") + .unwrap() + .endpoints[0] + .host = "repaired.example.com".into(); + let failure = reload_gateway_policy_runtime( + &engine, + Some(&candidate), + 0, + middleware(), + TransparentTcpReloadState::default(), + ) + .await + .expect_err("invalid protobuf scalar must reject the complete candidate"); + assert!(matches!( + failure, + GatewayRuntimeReloadError::PolicyValidation(_) + )); + let disposition = apply_gateway_runtime_reload_failure( + &engine, + failure, + PolicyValidationFailureMode::RetainLastValid, + true, + 2, + ) + .expect("retain accepted runtime"); + assert!(matches!( + disposition, + GatewayRuntimeFailureDisposition::PolicyRejected { disposition, .. } + if disposition.previous_policy_active && disposition.active_generation == generation + )); + assert!(engine.fail_closed_reason().is_none()); + assert_gateway_policy_authorization(&engine, "allowed.example.com", generation); + + // Repair only the rejected scalar: the endpoint change must now install + // with both runtime provenance flags and one new generation. + candidate.landlock.as_mut().unwrap().compatibility = "best_effort".into(); + reload_gateway_policy_runtime( + &engine, + Some(&candidate), + 0, + middleware(), + TransparentTcpReloadState::default(), + ) + .await + .expect("install repaired gateway policy"); + assert_gateway_policy_authorization(&engine, "repaired.example.com", generation + 1); + assert_eq!( + connections.load(Ordering::Relaxed), + if registry_changed { 2 } else { 0 } + ); + } + + #[tokio::test] + async fn gateway_policy_only_reload_rejects_candidate_retains_policy_and_accepts_repair() { + assert_gateway_reload_rejects_and_repairs(false).await; + } + + #[tokio::test] + async fn gateway_policy_and_registry_reload_rejects_candidate_retains_policy_and_accepts_repair() + { + assert_gateway_reload_rejects_and_repairs(true).await; + } + + #[tokio::test] + async fn local_file_startup_normalizes_matchers_and_rejects_malformed_policy() { + use openshell_supervisor_network::opa::NetworkInput; + + let files = tempfile::tempdir().expect("policy directory"); + let rules_path = files.path().join("policy.rego"); + let data_path = files.path().join("policy.yaml"); + std::fs::write( + &rules_path, + include_str!("../../openshell-supervisor-network/data/sandbox-policy.rego"), + ) + .expect("write policy rules"); + std::fs::write( + &data_path, + r#" +network_policies: + startup: + endpoints: + - host: startup.example.com + port: 443 + protocol: rest + enforcement: enforce + rules: + - allow: { method: GET, path: "/**", query: { scope: "public-*" } } + binaries: + - { path: /usr/bin/curl } +"#, + ) + .expect("write raw policy"); + let credentials = openshell_extension_core::ExtensionCredentialStore::new(); + let startup = || { + load_policy( + None, + None, + None, + Some(rules_path.to_string_lossy().into_owned()), + Some(data_path.to_string_lossy().into_owned()), + &credentials, + LocalPolicyIdentity::Required, + ) + }; + let (_, engine, proto, registry, origin, proposals, extension_authentication_enabled) = + startup().await.expect("load valid local policy"); + assert!(proto.is_none()); + assert!(matches!(origin, LoadedPolicyOrigin::LocalOverride)); + assert!(matches!(registry, MiddlewareRegistryStatus::Synchronized)); + assert!(!proposals && !extension_authentication_enabled); + let engine = engine.expect("local startup installs OPA"); + assert!(engine.binary_identity_required()); + // Installing the built-in registry creates the first active generation. + assert_eq!(engine.current_generation(), 1); + + let mut input = NetworkInput { + host: "startup.example.com".into(), + port: 443, + binary_path: "/usr/bin/curl".into(), + binary_sha256: String::new(), + ancestors: vec![], + cmdline_paths: vec![], + }; + assert!( + engine + .evaluate_network(&input) + .expect("allowed binary") + .allowed + ); + let endpoint = engine + .query_endpoint_config(&input) + .expect("query startup endpoint") + .expect("startup endpoint must exist"); + let endpoint: serde_json::Value = + serde_json::from_str(&endpoint.to_json_str().expect("serialize endpoint")) + .expect("endpoint JSON"); + assert_eq!( + endpoint["rules"][0]["allow"]["query"]["scope"], + serde_json::json!({ "glob": "public-*" }), + ); + input.binary_path = "/usr/bin/unlisted".into(); + assert!( + !engine + .evaluate_network(&input) + .expect("unlisted binary") + .allowed + ); + + // A malformed new startup must fail before returning an active evaluator. + std::fs::write(&data_path, "network_policies: []\n").expect("write malformed policy"); + let Err(error) = startup().await else { + panic!("malformed startup must reject"); + }; + assert!( + error + .to_string() + .contains("network_policies must be an object") + ); + } + #[tokio::test] async fn failed_external_startup_registry_build_preserves_installed_builtins() { let engine = OpaEngine::from_proto(&proto_policy_fixture()).expect("build OPA engine"); diff --git a/docs/reference/policy-schema.mdx b/docs/reference/policy-schema.mdx index 10e596d29b..3e4c051d1c 100644 --- a/docs/reference/policy-schema.mdx +++ b/docs/reference/policy-schema.mdx @@ -36,6 +36,8 @@ The YAML root and each present top-level section listed as an object or map must Static fields are set at sandbox creation time. Changing them requires destroying and recreating the sandbox. Dynamic fields can be updated on a running sandbox with `openshell policy update` for incremental merges or `openshell policy set` for full replacement, and take effect without restarting. +For query parameters and MCP tool names, the OPA loader normalizes nonempty string matchers to explicit `glob` objects after validation. For example, `query: { status: "active*" }` becomes `query: { status: { glob: "active*" } }` in runtime endpoint data. The same normalization applies to allow and deny rules and to MCP `tool` aliases. Matchers supported by both YAML and protobuf use the same runtime representation; `any` matchers retain their listed values. Raw OPA data also accepts empty scalar query matchers, which match empty query values and remain unchanged during loading. An empty protobuf glob cannot represent that OPA-only matcher. + ## Parsing and representation OpenShell uses one canonical authored-policy representation for YAML and JSON. @@ -399,7 +401,7 @@ Use `rules` for MCP allow rules and `deny_rules` for MCP deny rules. Deny rules |---|---|---|---| | `method` | string | No | MCP method name, such as `initialize`, `tools/list`, `tools/call`, or an unknown extension method. Globs are accepted only for the `tools/` method family, such as `tools/*`. Required unless `mcp.allow_all_known_mcp_methods` is `true`; when that option is true, omitted method uses the endpoint method profile. Do not use `method: "*"` for MCP; omit `method` only when using the allow-all MCP method profile. | | `tool` | string or matcher | No | Convenience matcher for `tools/call` `params.name`. Supports a glob string or `{ any: [...] }`. Requires `method: tools/call` unless `mcp.allow_all_known_mcp_methods` is `true`; validation fails otherwise. Omit to match every tool. | -| `params` | map | No | MCP currently accepts only `params.name` as a lower-level tool-name matcher. Requires `method: tools/call` unless `mcp.allow_all_known_mcp_methods` is `true`; validation fails otherwise. Tool argument matching is not supported yet; allowed tools accept all argument payloads by default. | +| `params` | map | No | MCP currently accepts only `params.name` as a lower-level tool-name matcher. Omit this field when using only `tool`; an explicit `params: null` is invalid in allow and deny rules. Requires `method: tools/call` unless `mcp.allow_all_known_mcp_methods` is `true`; validation fails otherwise. Tool argument matching is not supported yet; allowed tools accept all argument payloads by default. | An MCP client first sends `initialize`. After the server returns a successful response, the client sends `notifications/initialized`. After initialization completes and the server advertises the `tools` capability, the client can call an advertised tool. The response does not need an allow rule because these rules inspect messages sent from the client to the server. This example adds both client initialization messages to the existing tool rules. It omits `tools/list` because it assumes the client already knows the tool names; add that method when the client performs discovery. From 44afc321ca9164bf8a64e05e18e384eae6e01aaa Mon Sep 17 00:00:00 2001 From: Simon Scatton <44714756+SDAChess@users.noreply.github.com> Date: Thu, 17 Sep 2026 13:46:22 +0000 Subject: [PATCH 3/4] fix(ci): restore release tag push authentication (#3410) Signed-off-by: Simon Scatton --- .github/workflows/release-dev.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml index 900040a803..ad8e56d67e 100644 --- a/.github/workflows/release-dev.yml +++ b/.github/workflows/release-dev.yml @@ -400,8 +400,6 @@ jobs: wheel_filenames: ${{ steps.wheel_filenames.outputs.wheel_filenames }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - name: Download all CLI artifacts uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 From fc03bffead64f09c1f756a8eea6391ada999cf7a Mon Sep 17 00:00:00 2001 From: Simon Scatton <44714756+SDAChess@users.noreply.github.com> Date: Thu, 17 Sep 2026 13:46:31 +0000 Subject: [PATCH 4/4] ci: consolidate multi-platform image builds (#3408) * ci: remove release smoke tests Signed-off-by: Simon Scatton * ci: consolidate image builds Signed-off-by: Simon Scatton --------- Signed-off-by: Simon Scatton --- .github/actions/build-docker-image/action.yml | 73 ++++--- .github/actions/release-helm-oci/action.yml | 2 +- .github/workflows/branch-e2e.yml | 58 ++---- .github/workflows/build-images.yml | 60 ++++++ .github/workflows/docker-build.yml | 94 --------- .github/workflows/release-dev.yml | 168 +-------------- .github/workflows/release-tag.yml | 195 +----------------- CI.md | 3 +- 8 files changed, 133 insertions(+), 520 deletions(-) create mode 100644 .github/workflows/build-images.yml delete mode 100644 .github/workflows/docker-build.yml diff --git a/.github/actions/build-docker-image/action.yml b/.github/actions/build-docker-image/action.yml index 08557fbfd4..b3b19f2447 100644 --- a/.github/actions/build-docker-image/action.yml +++ b/.github/actions/build-docker-image/action.yml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 name: Build Docker Image -description: Build and push one architecture of an OpenShell image +description: Build, push, and export a multi-platform OpenShell image inputs: component: @@ -11,14 +11,8 @@ inputs: binary: description: Binary staged in the Docker build context required: true - triple: - description: Binary artifact target triple - required: true - arch: - description: Docker architecture name - required: true - platform: - description: Docker platform + target-suffix: + description: Binary artifact target suffix required: true image-tag: description: Docker image tag @@ -35,41 +29,64 @@ runs: buildkitd-config: /etc/buildkit/buildkitd.toml - name: Log in to GHCR - shell: bash - run: echo "${INPUTS_GITHUB_TOKEN}" | docker login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin - env: - INPUTS_GITHUB_TOKEN: ${{ inputs.github-token }} + uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ inputs.github-token }} + + - name: Download amd64 ${{ inputs.binary }} + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: ${{ inputs.binary }}-x86_64-${{ inputs.target-suffix }} + path: artifact/amd64 - - name: Download ${{ inputs.binary }} + - name: Download arm64 ${{ inputs.binary }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - name: ${{ inputs.binary }}-${{ inputs.triple }} - path: artifact + name: ${{ inputs.binary }}-aarch64-${{ inputs.target-suffix }} + path: artifact/arm64 - name: Stage ${{ inputs.binary }} shell: bash - run: install -Dm0755 artifact/${INPUTS_BINARY} deploy/docker/.build/prebuilt-binaries/${INPUTS_ARCH}/${INPUTS_BINARY} env: - INPUTS_BINARY: ${{ inputs.binary }} - INPUTS_ARCH: ${{ inputs.arch }} + BINARY: ${{ inputs.binary }} + run: | + install -Dm0755 artifact/amd64/${BINARY} deploy/docker/.build/prebuilt-binaries/amd64/${BINARY} + install -Dm0755 artifact/arm64/${BINARY} deploy/docker/.build/prebuilt-binaries/arm64/${BINARY} - name: Build ${{ inputs.component }} image shell: bash env: + COMPONENT: ${{ inputs.component }} IMAGE_TAG: ${{ inputs.image-tag }} - INPUTS_PLATFORM: ${{ inputs.platform }} - INPUTS_COMPONENT: ${{ inputs.component }} - INPUTS_ARCH: ${{ inputs.arch }} run: | + install -d artifacts/images docker buildx build \ --builder openshell \ - --platform ${INPUTS_PLATFORM} \ - --file deploy/docker/Dockerfile.${INPUTS_COMPONENT} \ - --target ${INPUTS_COMPONENT} \ - --tag ghcr.io/nvidia/openshell/${INPUTS_COMPONENT}:${IMAGE_TAG}-${INPUTS_ARCH} \ - --cache-from type=gha,scope=${INPUTS_COMPONENT}-${INPUTS_ARCH} \ - --cache-to type=gha,mode=max,scope=${INPUTS_COMPONENT}-${INPUTS_ARCH} \ + --platform linux/amd64,linux/arm64 \ + --file deploy/docker/Dockerfile.${COMPONENT} \ + --target ${COMPONENT} \ + --tag ghcr.io/nvidia/openshell/${COMPONENT}:${IMAGE_TAG} \ + --cache-from type=gha,scope=${COMPONENT} \ + --cache-to type=gha,mode=max,scope=${COMPONENT} \ --provenance=mode=min \ --attest type=sbom \ --output type=image,push=true,oci-mediatypes=true,oci-artifact=true \ + --output type=oci,dest=artifacts/images/${COMPONENT}.tar \ . + + - name: Verify SBOM attestation + shell: bash + env: + IMAGE_REF: ghcr.io/nvidia/openshell/${{ inputs.component }}:${{ inputs.image-tag }} + run: tasks/scripts/verify-image-sbom.sh "${IMAGE_REF}" --require-cargo + + - name: Upload ${{ inputs.component }} image + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: image-${{ inputs.component }} + path: artifacts + compression-level: 0 + retention-days: 5 + if-no-files-found: error diff --git a/.github/actions/release-helm-oci/action.yml b/.github/actions/release-helm-oci/action.yml index 46649e0cb0..2d1a1b86b2 100644 --- a/.github/actions/release-helm-oci/action.yml +++ b/.github/actions/release-helm-oci/action.yml @@ -26,7 +26,7 @@ inputs: as 0.0.0-dev. with appVersion set to the same SHA, enabling exact version pinning alongside the floating 0.0.0-dev tag. Both chart version and appVersion use the full SHA so the chart tag matches the image tag - pushed by docker-build.yml. + pushed by build-images.yml. required: false default: "" diff --git a/.github/workflows/branch-e2e.yml b/.github/workflows/branch-e2e.yml index 1eab8b9309..642af52da4 100644 --- a/.github/workflows/branch-e2e.yml +++ b/.github/workflows/branch-e2e.yml @@ -191,48 +191,16 @@ jobs: secrets: CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} - build-gateway-image: - needs: [pr_metadata, build-binaries] - if: >- - needs.pr_metadata.outputs.should_run == 'true' && - (needs.pr_metadata.outputs.run_core_e2e == 'true' || - needs.pr_metadata.outputs.run_kubernetes_ha_e2e == 'true' || - needs.pr_metadata.outputs.run_kubernetes_credential_drivers_e2e == 'true') - permissions: - contents: read - packages: write - uses: ./.github/workflows/docker-build.yml - with: - component: gateway - binary: openshell-gateway - target-suffix: unknown-linux-gnu - - build-sandbox-image: - needs: [pr_metadata, build-binaries] - if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_any_e2e == 'true' - permissions: - contents: read - packages: write - uses: ./.github/workflows/docker-build.yml - with: - component: sandbox - binary: openshell-sandbox - target-suffix: unknown-linux-musl - - build-supervisor-image: + build-images: needs: [pr_metadata, build-binaries] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_any_e2e == 'true' permissions: contents: read packages: write - uses: ./.github/workflows/docker-build.yml - with: - component: supervisor - binary: openshell-supervisor - target-suffix: unknown-linux-gnu + uses: ./.github/workflows/build-images.yml docker-e2e: - needs: [pr_metadata, build-binaries, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-images] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: actions: read @@ -245,7 +213,7 @@ jobs: conformance-artifact-prefix: openshell-conformance podman-e2e: - needs: [pr_metadata, build-binaries, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-images] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: actions: read @@ -268,7 +236,7 @@ jobs: conformance-artifact-prefix: openshell-conformance docker-external-driver-e2e: - needs: [pr_metadata, build-binaries, build-gateway-plain, build-external-drivers, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-gateway-plain, build-external-drivers, build-images] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: actions: read @@ -285,7 +253,7 @@ jobs: [{"suite":"external-driver","cmd":"mise run --no-deps --skip-deps e2e:docker:external-driver","apt_packages":"openssh-client","python_proto":false,"mcp":false}] podman-external-driver-e2e: - needs: [pr_metadata, build-binaries, build-gateway-plain, build-external-drivers, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-gateway-plain, build-external-drivers, build-images] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: actions: read @@ -315,7 +283,7 @@ jobs: conformance-artifact-prefix: openshell-conformance gpu-e2e: - needs: [pr_metadata, build-binaries, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-images] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_gpu_e2e == 'true' permissions: actions: read @@ -327,7 +295,7 @@ jobs: conformance-artifact-prefix: openshell-conformance kubernetes-e2e: - needs: [pr_metadata, build-binaries, build-gateway-image, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-images] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' strategy: fail-fast: false @@ -349,7 +317,7 @@ jobs: conformance-artifact-prefix: openshell-conformance kubernetes-workspace-managed-e2e: - needs: [pr_metadata, build-binaries, build-gateway-image, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-images] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: actions: read @@ -363,7 +331,7 @@ jobs: conformance-artifact-prefix: openshell-conformance kubernetes-external-driver-e2e: - needs: [pr_metadata, build-binaries, build-gateway-plain, build-external-drivers, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-gateway-plain, build-external-drivers, build-images] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: actions: read @@ -380,7 +348,7 @@ jobs: conformance-artifact-prefix: openshell-conformance kubernetes-workspace-operator-e2e: - needs: [pr_metadata, build-binaries, build-gateway-image, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-images] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' permissions: actions: read @@ -394,7 +362,7 @@ jobs: conformance-artifact-prefix: openshell-conformance kubernetes-ha-e2e: - needs: [pr_metadata, build-binaries, build-gateway-image, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-images] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_kubernetes_ha_e2e == 'true' permissions: actions: read @@ -409,7 +377,7 @@ jobs: conformance-artifact-prefix: openshell-conformance kubernetes-credential-drivers-e2e: - needs: [pr_metadata, build-binaries, build-gateway-image, build-sandbox-image, build-supervisor-image] + needs: [pr_metadata, build-binaries, build-images] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_kubernetes_credential_drivers_e2e == 'true' permissions: actions: read diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml new file mode 100644 index 0000000000..1aa513d578 --- /dev/null +++ b/.github/workflows/build-images.yml @@ -0,0 +1,60 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +name: Build Images + +on: + workflow_call: + inputs: + checkout-ref: + required: false + type: string + default: "" + image-tag: + required: false + type: string + default: "" + +permissions: + contents: read + packages: write + +jobs: + gateway: + env: + COMPONENT: gateway + BINARY: openshell-gateway + TARGET_SUFFIX: unknown-linux-gnu + runs-on: linux-amd64-cpu8 + timeout-minutes: 20 + steps: &build_steps + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: ${{ inputs.checkout-ref || github.sha }} + persist-credentials: false + + - uses: ./.github/actions/build-docker-image + with: + component: ${{ env.COMPONENT }} + binary: ${{ env.BINARY }} + target-suffix: ${{ env.TARGET_SUFFIX }} + image-tag: ${{ inputs.image-tag || github.sha }} + github-token: ${{ secrets.GITHUB_TOKEN }} + + sandbox: + env: + COMPONENT: sandbox + BINARY: openshell-sandbox + TARGET_SUFFIX: unknown-linux-musl + runs-on: linux-amd64-cpu8 + timeout-minutes: 20 + steps: *build_steps + + supervisor: + env: + COMPONENT: supervisor + BINARY: openshell-supervisor + TARGET_SUFFIX: unknown-linux-gnu + runs-on: linux-amd64-cpu8 + timeout-minutes: 20 + steps: *build_steps diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml deleted file mode 100644 index d27ba1e984..0000000000 --- a/.github/workflows/docker-build.yml +++ /dev/null @@ -1,94 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -name: Docker Build - -on: - workflow_call: - inputs: - component: - required: true - type: string - binary: - required: true - type: string - target-suffix: - required: true - type: string - image-tag: - required: false - type: string - default: "" - checkout-ref: - required: false - type: string - default: "" - -permissions: - contents: read - packages: write - -jobs: - build: - name: ${{ inputs.component }} (${{ matrix.platform }}) - strategy: - fail-fast: false - matrix: - include: - - arch: amd64 - rust_arch: x86_64 - platform: linux/amd64 - runner: linux-amd64-cpu8 - - arch: arm64 - rust_arch: aarch64 - platform: linux/arm64 - runner: linux-arm64-cpu8 - runs-on: ${{ matrix.runner }} - timeout-minutes: 20 - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - ref: ${{ inputs['checkout-ref'] || github.sha }} - - - uses: ./.github/actions/build-docker-image - with: - component: ${{ inputs.component }} - binary: ${{ inputs.binary }} - triple: ${{ matrix.rust_arch }}-${{ inputs['target-suffix'] }} - arch: ${{ matrix.arch }} - platform: ${{ matrix.platform }} - image-tag: ${{ inputs.image-tag || github.sha }} - github-token: ${{ secrets.GITHUB_TOKEN }} - - manifest: - name: ${{ inputs.component }} manifest - needs: build - runs-on: linux-amd64-cpu8 - timeout-minutes: 10 - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - ref: ${{ inputs['checkout-ref'] || github.sha }} - - - name: Log in to GHCR - shell: bash - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin - - - name: Create manifest - shell: bash - env: - IMAGE_TAG: ${{ inputs.image-tag || github.sha }} - INPUTS_COMPONENT: ${{ inputs.component }} - run: | - image=ghcr.io/nvidia/openshell/${INPUTS_COMPONENT} - docker buildx imagetools create \ - --prefer-index=false \ - --tag "$image:${IMAGE_TAG}" \ - "$image:${IMAGE_TAG}-amd64" \ - "$image:${IMAGE_TAG}-arm64" - - - name: Verify merged manifest SBOM attestation - shell: bash - env: - IMAGE_REF: ghcr.io/nvidia/openshell/${{ inputs.component }}:${{ inputs.image-tag || github.sha }} - run: tasks/scripts/verify-image-sbom.sh "${IMAGE_REF}" --require-cargo diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml index ad8e56d67e..1af053d091 100644 --- a/.github/workflows/release-dev.yml +++ b/.github/workflows/release-dev.yml @@ -90,44 +90,17 @@ jobs: contents: read uses: ./.github/workflows/package-release-binaries.yml - build-gateway-image: + build-images: needs: build-binaries permissions: contents: read packages: write - uses: ./.github/workflows/docker-build.yml + uses: ./.github/workflows/build-images.yml with: - component: gateway - binary: openshell-gateway - target-suffix: unknown-linux-gnu - checkout-ref: ${{ github.sha }} - - build-sandbox-image: - needs: build-binaries - permissions: - contents: read - packages: write - uses: ./.github/workflows/docker-build.yml - with: - component: sandbox - binary: openshell-sandbox - target-suffix: unknown-linux-musl - checkout-ref: ${{ github.sha }} - - build-supervisor-image: - needs: build-binaries - permissions: - contents: read - packages: write - uses: ./.github/workflows/docker-build.yml - with: - component: supervisor - binary: openshell-supervisor - target-suffix: unknown-linux-gnu checkout-ref: ${{ github.sha }} docker-e2e: - needs: [build-binaries, build-sandbox-image, build-supervisor-image] + needs: [build-binaries, build-images] permissions: actions: read contents: read @@ -140,7 +113,7 @@ jobs: conformance-artifact-prefix: openshell-conformance podman-e2e: - needs: [build-binaries, build-sandbox-image, build-supervisor-image] + needs: [build-binaries, build-images] permissions: actions: read contents: read @@ -164,7 +137,7 @@ jobs: tag-ghcr-dev: name: Tag GHCR Images as Dev - needs: [build-gateway-image, build-sandbox-image, build-supervisor-image, release-dev] + needs: [build-images, release-dev] runs-on: linux-amd64-cpu8 timeout-minutes: 10 permissions: @@ -254,141 +227,12 @@ jobs: rpm-release: ${{ needs.compute-versions.outputs.rpm_release }} cargo-version: ${{ needs.compute-versions.outputs.cargo_version }} - smoke-linux-dev-artifacts: - name: Smoke Linux Dev Artifacts (${{ matrix.name }}) - needs: [package-binaries, build-deb, build-rpm, build-python-wheel] - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - include: - - name: ubuntu-20.04-binaries-amd64 - runner: linux-amd64-cpu8 - image: ubuntu:20.04 - kind: binary - artifact_arch: amd64 - target: x86_64-unknown-linux-gnu - sandbox_target: x86_64-unknown-linux-musl - - name: ubuntu-20.04-binaries-arm64 - runner: linux-arm64-cpu8 - image: ubuntu:20.04 - kind: binary - artifact_arch: arm64 - target: aarch64-unknown-linux-gnu - sandbox_target: aarch64-unknown-linux-musl - - name: ubuntu-22.04-deb-amd64 - runner: linux-amd64-cpu8 - image: ubuntu:22.04 - kind: deb - artifact_arch: amd64 - rpm_arch: x86_64 - - name: ubuntu-22.04-deb-arm64 - runner: linux-arm64-cpu8 - image: ubuntu:22.04 - kind: deb - artifact_arch: arm64 - rpm_arch: aarch64 - - name: fedora-rpm-amd64 - runner: linux-amd64-cpu8 - image: fedora:latest - kind: rpm - artifact_arch: amd64 - rpm_arch: x86_64 - - name: fedora-rpm-arm64 - runner: linux-arm64-cpu8 - image: fedora:latest - kind: rpm - artifact_arch: arm64 - rpm_arch: aarch64 - - name: python-wheel - runner: linux-amd64-cpu8 - image: python:3.12-slim - kind: wheel - runs-on: ${{ matrix.runner }} - container: - image: ${{ matrix.image }} - steps: - - name: Download sandbox binary artifact - if: matrix.kind == 'binary' - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: sandbox-binary-linux-${{ matrix.artifact_arch }} - path: runtime-input/ - - - name: Download supervisor binary artifact - if: matrix.kind == 'binary' - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: supervisor-binary-linux-${{ matrix.artifact_arch }} - path: runtime-input/ - - - name: Smoke runtime binary artifacts - if: matrix.kind == 'binary' - run: | - set -euo pipefail - mkdir -p runtime-bin - tar -xzf "runtime-input/openshell-sandbox-${{ matrix.sandbox_target }}.tar.gz" -C runtime-bin - tar -xzf "runtime-input/openshell-supervisor-${{ matrix.target }}.tar.gz" -C runtime-bin - runtime-bin/openshell-sandbox --version - LD_BIND_NOW=1 runtime-bin/openshell-supervisor --version - - - name: Download Debian package artifact - if: matrix.kind == 'deb' - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: deb-linux-${{ matrix.artifact_arch }} - path: package-input/ - - - name: Smoke Debian package on Ubuntu 22.04 - if: matrix.kind == 'deb' - run: | - set -euo pipefail - apt-get update - apt-get install -y --no-install-recommends ./package-input/*.deb - LD_BIND_NOW=1 openshell-gateway --version - /usr/libexec/openshell/openshell-driver-vm --version - - - name: Download RPM package artifacts - if: matrix.kind == 'rpm' - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: rpm-linux-${{ matrix.rpm_arch }} - path: package-input/ - - - name: Smoke RPM packages on Fedora - if: matrix.kind == 'rpm' - run: | - set -euo pipefail - dnf install -y ./package-input/openshell-[0-9]*.rpm ./package-input/openshell-gateway-*.rpm - LD_BIND_NOW=1 openshell-gateway --version - - - name: Download Python wheel artifact - if: matrix.kind == 'wheel' - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: python-wheel - path: wheel-input/ - - - name: Smoke Python wheel - if: matrix.kind == 'wheel' - run: | - set -euo pipefail - python -m venv /tmp/openshell-wheel-smoke - /tmp/openshell-wheel-smoke/bin/pip install --no-cache-dir wheel-input/*.whl - /tmp/openshell-wheel-smoke/bin/python - <<'PY' - import importlib - for name in ("openshell", "openshell._proto", "openshell.sandbox"): - importlib.import_module(name) - print(name, "OK") - PY - test ! -e /tmp/openshell-wheel-smoke/bin/openshell - # --------------------------------------------------------------------------- # Create / update the dev GitHub Release with CLI, gateway, driver, and wheels # --------------------------------------------------------------------------- release-dev: name: Release Dev - needs: [compute-versions, package-binaries, build-python-wheel, docker-e2e, podman-e2e, vm-e2e, build-deb, build-rpm, build-snap, smoke-linux-dev-artifacts] + needs: [compute-versions, package-binaries, build-python-wheel, docker-e2e, podman-e2e, vm-e2e, build-deb, build-rpm, build-snap] runs-on: linux-amd64-cpu8 timeout-minutes: 10 permissions: diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml index b746326671..811e43e31f 100644 --- a/.github/workflows/release-tag.yml +++ b/.github/workflows/release-tag.yml @@ -117,47 +117,18 @@ jobs: contents: read uses: ./.github/workflows/package-release-binaries.yml - build-gateway-image: + build-images: needs: [compute-versions, build-binaries] permissions: contents: read packages: write - uses: ./.github/workflows/docker-build.yml + uses: ./.github/workflows/build-images.yml with: - component: gateway - binary: openshell-gateway - target-suffix: unknown-linux-gnu - image-tag: ${{ needs.compute-versions.outputs.source_sha }} - checkout-ref: ${{ needs.compute-versions.outputs.source_sha }} - - build-sandbox-image: - needs: [compute-versions, build-binaries] - permissions: - contents: read - packages: write - uses: ./.github/workflows/docker-build.yml - with: - component: sandbox - binary: openshell-sandbox - target-suffix: unknown-linux-musl - image-tag: ${{ needs.compute-versions.outputs.source_sha }} - checkout-ref: ${{ needs.compute-versions.outputs.source_sha }} - - build-supervisor-image: - needs: [compute-versions, build-binaries] - permissions: - contents: read - packages: write - uses: ./.github/workflows/docker-build.yml - with: - component: supervisor - binary: openshell-supervisor - target-suffix: unknown-linux-gnu image-tag: ${{ needs.compute-versions.outputs.source_sha }} checkout-ref: ${{ needs.compute-versions.outputs.source_sha }} docker-e2e: - needs: [compute-versions, build-binaries, build-sandbox-image, build-supervisor-image] + needs: [compute-versions, build-binaries, build-images] permissions: actions: read contents: read @@ -170,7 +141,7 @@ jobs: conformance-artifact-prefix: openshell-conformance podman-e2e: - needs: [compute-versions, build-binaries, build-sandbox-image, build-supervisor-image] + needs: [compute-versions, build-binaries, build-images] permissions: actions: read contents: read @@ -194,7 +165,7 @@ jobs: tag-ghcr-release: name: Tag GHCR Images - needs: [compute-versions, build-gateway-image, build-sandbox-image, build-supervisor-image, release] + needs: [compute-versions, build-images, release] runs-on: linux-amd64-cpu8 timeout-minutes: 10 permissions: @@ -295,166 +266,12 @@ jobs: rpm-release: ${{ needs.compute-versions.outputs.rpm_release }} cargo-version: ${{ needs.compute-versions.outputs.cargo_version }} - smoke-linux-release-artifacts: - name: Smoke Linux Release Artifacts (${{ matrix.name }}) - needs: [package-binaries, build-deb, build-rpm, build-python-wheel] - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - include: - - name: ubuntu-20.04-binaries - runner: linux-amd64-cpu8 - image: ubuntu:20.04 - kind: binary - artifact_arch: amd64 - rpm_arch: x86_64 - target: x86_64-unknown-linux-gnu - sandbox_target: x86_64-unknown-linux-musl - - name: ubuntu-20.04-binaries-arm64 - runner: linux-arm64-cpu8 - image: ubuntu:20.04 - kind: binary - artifact_arch: arm64 - rpm_arch: aarch64 - target: aarch64-unknown-linux-gnu - sandbox_target: aarch64-unknown-linux-musl - - name: ubuntu-22.04-deb - runner: linux-amd64-cpu8 - image: ubuntu:22.04 - kind: deb - artifact_arch: amd64 - rpm_arch: x86_64 - target: x86_64-unknown-linux-gnu - - name: ubuntu-22.04-deb-arm64 - runner: linux-arm64-cpu8 - image: ubuntu:22.04 - kind: deb - artifact_arch: arm64 - rpm_arch: aarch64 - target: aarch64-unknown-linux-gnu - - name: fedora-rpm - runner: linux-amd64-cpu8 - image: fedora:latest - kind: rpm - artifact_arch: amd64 - rpm_arch: x86_64 - target: x86_64-unknown-linux-gnu - - name: fedora-rpm-aarch64 - runner: linux-arm64-cpu8 - image: fedora:latest - kind: rpm - artifact_arch: arm64 - rpm_arch: aarch64 - target: aarch64-unknown-linux-gnu - - name: python-wheel - runner: linux-amd64-cpu8 - image: python:3.12-slim - kind: wheel - runs-on: ${{ matrix.runner }} - container: - image: ${{ matrix.image }} - steps: - - name: Download gateway binary artifact - if: matrix.kind == 'binary' - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: gateway-binary-linux-${{ matrix.artifact_arch }} - path: smoke-input/ - - - name: Download VM driver binary artifact - if: matrix.kind == 'binary' - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: driver-vm-linux-${{ matrix.artifact_arch }} - path: smoke-input/ - - - name: Download sandbox binary artifact - if: matrix.kind == 'binary' - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: sandbox-binary-linux-${{ matrix.artifact_arch }} - path: smoke-input/ - - - name: Download supervisor binary artifact - if: matrix.kind == 'binary' - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: supervisor-binary-linux-${{ matrix.artifact_arch }} - path: smoke-input/ - - - name: Smoke binary artifacts - if: matrix.kind == 'binary' - run: | - set -euo pipefail - apt-get update - mkdir -p smoke-bin - tar -xzf smoke-input/openshell-gateway-${{ matrix.target }}.tar.gz -C smoke-bin - tar -xzf smoke-input/openshell-driver-vm-${{ matrix.target }}.tar.gz -C smoke-bin - tar -xzf smoke-input/openshell-sandbox-${{ matrix.sandbox_target }}.tar.gz -C smoke-bin - tar -xzf smoke-input/openshell-supervisor-${{ matrix.target }}.tar.gz -C smoke-bin - LD_BIND_NOW=1 smoke-bin/openshell-gateway --version - smoke-bin/openshell-driver-vm --version - smoke-bin/openshell-sandbox --version - LD_BIND_NOW=1 smoke-bin/openshell-supervisor --version - - - name: Download Debian package artifact - if: matrix.kind == 'deb' - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: deb-linux-${{ matrix.artifact_arch }} - path: package-input/ - - - name: Smoke Debian package - if: matrix.kind == 'deb' - run: | - set -euo pipefail - apt-get update - apt-get install -y --no-install-recommends ./package-input/*.deb - LD_BIND_NOW=1 openshell-gateway --version - /usr/libexec/openshell/openshell-driver-vm --version - - - name: Download RPM package artifacts - if: matrix.kind == 'rpm' - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: rpm-linux-${{ matrix.rpm_arch }} - path: package-input/ - - - name: Smoke RPM packages - if: matrix.kind == 'rpm' - run: | - set -euo pipefail - dnf install -y ./package-input/openshell-[0-9]*.rpm ./package-input/openshell-gateway-*.rpm - LD_BIND_NOW=1 openshell-gateway --version - - - name: Download Python wheel artifact - if: matrix.kind == 'wheel' - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: python-wheel - path: wheel-input/ - - - name: Smoke Python wheel - if: matrix.kind == 'wheel' - run: | - set -euo pipefail - python -m venv /tmp/openshell-wheel-smoke - /tmp/openshell-wheel-smoke/bin/pip install --no-cache-dir wheel-input/*.whl - /tmp/openshell-wheel-smoke/bin/python - <<'PY' - import importlib - for name in ("openshell", "openshell._proto", "openshell.sandbox"): - importlib.import_module(name) - print(name, "OK") - PY - test ! -e /tmp/openshell-wheel-smoke/bin/openshell - # --------------------------------------------------------------------------- # Create a tagged GitHub Release with CLI, gateway, driver, and wheels # --------------------------------------------------------------------------- release: name: Release - needs: [compute-versions, package-binaries, build-python-wheel, docker-e2e, podman-e2e, vm-e2e, build-deb, build-rpm, build-snap, smoke-linux-release-artifacts] + needs: [compute-versions, package-binaries, build-python-wheel, docker-e2e, podman-e2e, vm-e2e, build-deb, build-rpm, build-snap] runs-on: linux-amd64-cpu8 timeout-minutes: 10 permissions: diff --git a/CI.md b/CI.md index 365cc2fa21..e5518c8515 100644 --- a/CI.md +++ b/CI.md @@ -350,7 +350,8 @@ The bot's full administrator documentation is internal to NVIDIA. The only comma |---|---| | `.github/workflows/branch-checks.yml` | Required non-E2E checks. Triggers on `push: pull-request/[0-9]+` for PR mirrors and `merge_group` for queued merges. | | `.github/workflows/branch-e2e.yml` | Standard, GPU, Kubernetes HA, and Kubernetes credential-driver E2E. PR mirror pushes use `test:e2e`, `test:e2e-gpu`, and `test:e2e-kubernetes` labels; merge groups run core and GPU E2E. | -| `.github/workflows/build-{cli,gateway,sandbox}-binaries.yml` | Independent target matrices used by branch and release workflows without creating skipped jobs. | +| `.github/workflows/build-binaries.yml`, `build-vm-driver.yml` | Shared binary matrices used by branch and release workflows. The VM driver remains separate because its build consumes the runtime binaries. | +| `.github/workflows/build-images.yml` | Builds and pushes multi-platform images, then uploads the same OCI images as workflow artifacts. | | `.github/workflows/package-release-binaries.yml` | Packages raw build artifacts into release tarballs without rebuilding them. | | `.github/workflows/e2e-docker-test.yml`, `e2e-podman-test.yml`, `e2e-vm-test.yml`, `e2e-kubernetes-test.yml` | Reusable runtime lanes called directly by branch and release workflows. Callers select suites and declare only the artifacts each runtime consumes. | | `.github/actions/setup-e2e-*` | Shared artifact, Podman, KVM, and kind setup used by the runtime lanes. |