From 51351e4745fe05de9c2d81577fbbb892b82fd395 Mon Sep 17 00:00:00 2001 From: Drew Newberry Date: Thu, 30 Apr 2026 13:22:47 -0700 Subject: [PATCH 1/5] chore(ci): update checkout action to v6 (#1086) Signed-off-by: Drew Newberry --- .github/workflows/branch-checks.yml | 10 +++++----- .github/workflows/branch-docs.yml | 2 +- .github/workflows/branch-e2e.yml | 2 +- .github/workflows/ci-image.yml | 2 +- .github/workflows/docker-build.yml | 2 +- .github/workflows/e2e-gpu-test.yaml | 2 +- .github/workflows/e2e-test.yml | 2 +- .github/workflows/release-auto-tag.yml | 2 +- .github/workflows/release-canary.yml | 2 +- .github/workflows/release-dev.yml | 18 ++++++++--------- .github/workflows/release-tag.yml | 20 +++++++++---------- .github/workflows/release-vm-dev.yml | 16 +++++++-------- .github/workflows/release-vm-kernel.yml | 8 ++++---- .github/workflows/shadow-branch-checks.yml | 12 +++++------ .github/workflows/shadow-branch-e2e.yml | 2 +- .github/workflows/shadow-ci-image.yml | 4 ++-- .github/workflows/shadow-e2e-test.yml | 2 +- .../workflows/shadow-rust-native-build.yml | 2 +- .github/workflows/shadow-shared-cpu-spike.yml | 2 +- .github/workflows/test-gpu.yml | 2 +- .github/workflows/test-install.yml | 2 +- 21 files changed, 58 insertions(+), 58 deletions(-) diff --git a/.github/workflows/branch-checks.yml b/.github/workflows/branch-checks.yml index 324cb2fce5..15bac0ac20 100644 --- a/.github/workflows/branch-checks.yml +++ b/.github/workflows/branch-checks.yml @@ -22,7 +22,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Mark workspace as safe for git run: git config --global --add safe.directory "$GITHUB_WORKSPACE" @@ -53,7 +53,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install tools run: mise install --locked @@ -74,7 +74,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install tools run: mise install --locked @@ -118,7 +118,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install tools run: mise install --locked @@ -141,7 +141,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install tools run: mise install diff --git a/.github/workflows/branch-docs.yml b/.github/workflows/branch-docs.yml index 762d2d1fbb..1368bc775b 100644 --- a/.github/workflows/branch-docs.yml +++ b/.github/workflows/branch-docs.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Check Fern preview availability id: fern-preview diff --git a/.github/workflows/branch-e2e.yml b/.github/workflows/branch-e2e.yml index 1312c66b4a..a680bca4a0 100644 --- a/.github/workflows/branch-e2e.yml +++ b/.github/workflows/branch-e2e.yml @@ -18,7 +18,7 @@ jobs: outputs: should_run: ${{ steps.gate.outputs.should_run }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - id: gate uses: ./.github/actions/pr-gate with: diff --git a/.github/workflows/ci-image.yml b/.github/workflows/ci-image.yml index d28eba877a..1f59438cca 100644 --- a/.github/workflows/ci-image.yml +++ b/.github/workflows/ci-image.yml @@ -24,7 +24,7 @@ jobs: name: Build runs-on: build-amd64 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Log in to GitHub Container Registry uses: docker/login-action@v3 diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 907fd5bae9..6da7370e59 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -179,7 +179,7 @@ jobs: DOCKER_PUSH: ${{ inputs.push && '1' || '0' }} DOCKER_PLATFORM: ${{ matrix.platform }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 diff --git a/.github/workflows/e2e-gpu-test.yaml b/.github/workflows/e2e-gpu-test.yaml index cde1f4792c..6a296f5e30 100644 --- a/.github/workflows/e2e-gpu-test.yaml +++ b/.github/workflows/e2e-gpu-test.yaml @@ -55,7 +55,7 @@ jobs: OPENSHELL_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} OPENSHELL_GATEWAY: ${{ matrix.cluster }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Log in to GHCR run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 052e77e6ab..992065b25e 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -56,7 +56,7 @@ jobs: OPENSHELL_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} OPENSHELL_GATEWAY: ${{ matrix.cluster }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Log in to GHCR run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin diff --git a/.github/workflows/release-auto-tag.yml b/.github/workflows/release-auto-tag.yml index 569c333887..f89c506d7b 100644 --- a/.github/workflows/release-auto-tag.yml +++ b/.github/workflows/release-auto-tag.yml @@ -20,7 +20,7 @@ jobs: create-tag: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 diff --git a/.github/workflows/release-canary.yml b/.github/workflows/release-canary.yml index 0ef1e0355e..9f262a7262 100644 --- a/.github/workflows/release-canary.yml +++ b/.github/workflows/release-canary.yml @@ -104,7 +104,7 @@ jobs: # to advertise a reachable address instead. OPENSHELL_GATEWAY_HOST: host.docker.internal steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Determine release tag id: release diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml index 28a12f1a95..b088ceb330 100644 --- a/.github/workflows/release-dev.yml +++ b/.github/workflows/release-dev.yml @@ -30,7 +30,7 @@ jobs: python_version: ${{ steps.v.outputs.python }} cargo_version: ${{ steps.v.outputs.cargo }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 @@ -125,7 +125,7 @@ jobs: SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} OPENSHELL_IMAGE_TAG: dev steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 @@ -173,7 +173,7 @@ jobs: SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} OPENSHELL_IMAGE_TAG: dev steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 @@ -235,7 +235,7 @@ jobs: SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} OPENSHELL_IMAGE_TAG: dev steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 @@ -337,7 +337,7 @@ jobs: MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 @@ -407,7 +407,7 @@ jobs: MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 @@ -484,7 +484,7 @@ jobs: MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 @@ -558,7 +558,7 @@ jobs: MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 @@ -626,7 +626,7 @@ jobs: outputs: wheel_filenames: ${{ steps.wheel_filenames.outputs.wheel_filenames }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Download all CLI artifacts uses: actions/download-artifact@v4 diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml index 1db4ae1955..453636444b 100644 --- a/.github/workflows/release-tag.yml +++ b/.github/workflows/release-tag.yml @@ -43,7 +43,7 @@ jobs: # Semver without 'v' prefix (e.g. 0.6.0), used for image tags and release body semver: ${{ steps.v.outputs.semver }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: ref: ${{ inputs.tag || github.ref }} fetch-depth: 0 @@ -145,7 +145,7 @@ jobs: SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} OPENSHELL_IMAGE_TAG: ${{ needs.compute-versions.outputs.semver }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: ref: ${{ inputs.tag || github.ref }} fetch-depth: 0 @@ -194,7 +194,7 @@ jobs: SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} OPENSHELL_IMAGE_TAG: ${{ needs.compute-versions.outputs.semver }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: ref: ${{ inputs.tag || github.ref }} fetch-depth: 0 @@ -257,7 +257,7 @@ jobs: SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} OPENSHELL_IMAGE_TAG: ${{ needs.compute-versions.outputs.semver }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: ref: ${{ inputs.tag || github.ref }} fetch-depth: 0 @@ -360,7 +360,7 @@ jobs: MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: ref: ${{ inputs.tag || github.ref }} fetch-depth: 0 @@ -431,7 +431,7 @@ jobs: MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: ref: ${{ inputs.tag || github.ref }} fetch-depth: 0 @@ -516,7 +516,7 @@ jobs: MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: ref: ${{ inputs.tag || github.ref }} fetch-depth: 0 @@ -594,7 +594,7 @@ jobs: MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: ref: ${{ inputs.tag || github.ref }} fetch-depth: 0 @@ -653,7 +653,7 @@ jobs: outputs: wheel_filenames: ${{ steps.wheel_filenames.outputs.wheel_filenames }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: ref: ${{ inputs.tag || github.ref }} @@ -749,7 +749,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: ref: ${{ inputs.tag || github.ref }} diff --git a/.github/workflows/release-vm-dev.yml b/.github/workflows/release-vm-dev.yml index 85750b59f7..6619d2a6b5 100644 --- a/.github/workflows/release-vm-dev.yml +++ b/.github/workflows/release-vm-dev.yml @@ -42,7 +42,7 @@ jobs: outputs: cargo_version: ${{ steps.v.outputs.cargo }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 @@ -71,7 +71,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Download all runtime tarballs env: @@ -144,7 +144,7 @@ jobs: MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} OPENSHELL_IMAGE_TAG: dev steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Mark workspace safe for git run: git config --global --add safe.directory "$GITHUB_WORKSPACE" @@ -211,7 +211,7 @@ jobs: SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} OPENSHELL_IMAGE_TAG: dev steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 @@ -329,7 +329,7 @@ jobs: MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 @@ -448,7 +448,7 @@ jobs: SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} OPENSHELL_IMAGE_TAG: dev steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 @@ -566,7 +566,7 @@ jobs: MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 @@ -666,7 +666,7 @@ jobs: runs-on: build-amd64 timeout-minutes: 10 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Download all VM binary artifacts uses: actions/download-artifact@v4 diff --git a/.github/workflows/release-vm-kernel.yml b/.github/workflows/release-vm-kernel.yml index ca773ef0fd..4f63a5a4b9 100644 --- a/.github/workflows/release-vm-kernel.yml +++ b/.github/workflows/release-vm-kernel.yml @@ -47,7 +47,7 @@ jobs: env: MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Mark workspace safe for git run: git config --global --add safe.directory "$GITHUB_WORKSPACE" @@ -97,7 +97,7 @@ jobs: env: MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Mark workspace safe for git run: git config --global --add safe.directory "$GITHUB_WORKSPACE" @@ -130,7 +130,7 @@ jobs: env: RUSTC_WRAPPER: "" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install dependencies run: | @@ -171,7 +171,7 @@ jobs: runs-on: build-amd64 timeout-minutes: 10 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Download all runtime artifacts uses: actions/download-artifact@v4 diff --git a/.github/workflows/shadow-branch-checks.yml b/.github/workflows/shadow-branch-checks.yml index 5f7fbad683..b0311ca0f8 100644 --- a/.github/workflows/shadow-branch-checks.yml +++ b/.github/workflows/shadow-branch-checks.yml @@ -34,7 +34,7 @@ jobs: outputs: should_run: ${{ steps.gate.outputs.should_run }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - id: gate uses: ./.github/actions/pr-gate @@ -50,7 +50,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Mark workspace as safe for git run: git config --global --add safe.directory "$GITHUB_WORKSPACE" @@ -74,7 +74,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install tools run: mise install --locked @@ -99,7 +99,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install tools run: mise install --locked @@ -149,7 +149,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install tools run: mise install --locked @@ -174,7 +174,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install tools run: mise install --locked diff --git a/.github/workflows/shadow-branch-e2e.yml b/.github/workflows/shadow-branch-e2e.yml index 7b2433096b..2356b49489 100644 --- a/.github/workflows/shadow-branch-e2e.yml +++ b/.github/workflows/shadow-branch-e2e.yml @@ -25,7 +25,7 @@ jobs: outputs: should_run: ${{ steps.gate.outputs.should_run }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - id: gate uses: ./.github/actions/pr-gate diff --git a/.github/workflows/shadow-ci-image.yml b/.github/workflows/shadow-ci-image.yml index 2f725475e4..ce8b4765a6 100644 --- a/.github/workflows/shadow-ci-image.yml +++ b/.github/workflows/shadow-ci-image.yml @@ -30,7 +30,7 @@ jobs: outputs: should_run: ${{ steps.gate.outputs.should_run }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - id: gate uses: ./.github/actions/pr-gate @@ -52,7 +52,7 @@ jobs: runs-on: ${{ matrix.runner }} timeout-minutes: 60 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Resolve BuildKit config id: buildkit diff --git a/.github/workflows/shadow-e2e-test.yml b/.github/workflows/shadow-e2e-test.yml index 5e9fd1e1a2..c08be2170a 100644 --- a/.github/workflows/shadow-e2e-test.yml +++ b/.github/workflows/shadow-e2e-test.yml @@ -26,7 +26,7 @@ jobs: outputs: should_run: ${{ steps.gate.outputs.should_run }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - id: gate uses: ./.github/actions/pr-gate diff --git a/.github/workflows/shadow-rust-native-build.yml b/.github/workflows/shadow-rust-native-build.yml index 558bc192fd..80df1056f7 100644 --- a/.github/workflows/shadow-rust-native-build.yml +++ b/.github/workflows/shadow-rust-native-build.yml @@ -111,7 +111,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 diff --git a/.github/workflows/shadow-shared-cpu-spike.yml b/.github/workflows/shadow-shared-cpu-spike.yml index c264e595f7..ca7b2ef09b 100644 --- a/.github/workflows/shadow-shared-cpu-spike.yml +++ b/.github/workflows/shadow-shared-cpu-spike.yml @@ -46,7 +46,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} timeout-minutes: 60 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install tools run: mise install diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index dd406701f0..4721c97508 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -19,7 +19,7 @@ jobs: outputs: should_run: ${{ steps.gate.outputs.should_run }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - id: gate uses: ./.github/actions/pr-gate with: diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 416adef666..06b1e007fb 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -41,7 +41,7 @@ jobs: install: fish steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install ${{ matrix.shell }} if: matrix.install From 182cbc6750f3a340a61c5ec5cf1c0122262fdd91 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 30 Apr 2026 22:23:36 +0200 Subject: [PATCH 2/5] fix(docker): set apparmor=unconfined on sandbox containers (#1078) Docker's default AppArmor profile blocks mount(2) with MS_SHARED even when SYS_ADMIN is granted, which prevents ip-netns from creating network namespaces required for proxy-mode network isolation. The sandbox enforces its own isolation (seccomp, Landlock, network namespaces), so the host AppArmor profile provides no meaningful additional defence inside a container that already holds SYS_ADMIN. --- crates/openshell-driver-docker/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/openshell-driver-docker/src/lib.rs b/crates/openshell-driver-docker/src/lib.rs index 525cb2c74f..c6d272c1c3 100644 --- a/crates/openshell-driver-docker/src/lib.rs +++ b/crates/openshell-driver-docker/src/lib.rs @@ -928,6 +928,13 @@ fn build_container_create_body( "SYS_PTRACE".to_string(), "SYSLOG".to_string(), ]), + // AppArmor's default Docker profile blocks mount(2) with MS_SHARED + // even when SYS_ADMIN is granted, which prevents ip-netns from + // creating network namespaces for proxy-mode isolation. The sandbox + // enforces its own isolation via seccomp, Landlock, and network + // namespaces, so the host AppArmor profile adds no meaningful + // defence here. + security_opt: Some(vec!["apparmor=unconfined".to_string()]), extra_hosts: Some(vec![ format!("{HOST_DOCKER_INTERNAL}:host-gateway"), format!("{HOST_OPENSHELL_INTERNAL}:host-gateway"), From 0c0f3e32e1883f1e780c96be0b99857655b07f0c Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 30 Apr 2026 22:23:57 +0200 Subject: [PATCH 3/5] feat(docker): enable CDI GPU sandboxes (#1036) --- architecture/sandbox.md | 10 +++++ crates/openshell-driver-docker/src/lib.rs | 40 ++++++++++++++----- crates/openshell-driver-docker/src/tests.rs | 43 +++++++++++++++++++++ docs/sandboxes/manage-sandboxes.mdx | 4 ++ e2e/rust/e2e-docker.sh | 35 ++++++++++++----- e2e/rust/tests/docker_gpu.rs | 36 +++++++++++++++++ tasks/test.toml | 5 +++ 7 files changed, 155 insertions(+), 18 deletions(-) create mode 100644 e2e/rust/tests/docker_gpu.rs diff --git a/architecture/sandbox.md b/architecture/sandbox.md index 4557e88f2a..cbb6b77f09 100644 --- a/architecture/sandbox.md +++ b/architecture/sandbox.md @@ -460,6 +460,16 @@ Kernel-level error behavior (e.g., Landlock ABI unavailable) depends on `Landloc **Baseline path filtering**: System-injected baseline paths (e.g., `/app`) are pre-filtered by `enrich_proto_baseline_paths()` / `enrich_sandbox_baseline_paths()` using `Path::exists()` before they reach Landlock. If a baseline `read_write` path is already present in `read_only`, enrichment skips the promotion so explicit policy intent is preserved. User-specified paths are not pre-filtered -- they are evaluated at Landlock apply time so misconfigurations surface as warnings or errors. +**GPU baseline paths**: The supervisor currently infers GPU baseline paths from +device nodes and NVIDIA runtime paths visible inside the sandbox container. The +Docker compute driver can request CDI GPU injection, but this implementation +does not pass CDI metadata into the supervisor. Future device-specific CDI +selection may need follow-up work so the supervisor can enrich Landlock using +the requested CDI device's actual device nodes and mounted library paths. That +design must work for remote Docker daemons, where Docker-reported CDI spec +directories are paths on the daemon host and may not be readable by the gateway +process or the sandbox supervisor. + ### Seccomp syscall filtering **File:** `crates/openshell-sandbox/src/sandbox/linux/seccomp.rs` diff --git a/crates/openshell-driver-docker/src/lib.rs b/crates/openshell-driver-docker/src/lib.rs index c6d272c1c3..870a51ca6c 100644 --- a/crates/openshell-driver-docker/src/lib.rs +++ b/crates/openshell-driver-docker/src/lib.rs @@ -8,8 +8,8 @@ use bollard::Docker; use bollard::errors::Error as BollardError; use bollard::models::{ - ContainerCreateBody, ContainerSummary, ContainerSummaryStateEnum, HostConfig, Mount, - MountTypeEnum, RestartPolicy, RestartPolicyNameEnum, + ContainerCreateBody, ContainerSummary, ContainerSummaryStateEnum, DeviceRequest, HostConfig, + Mount, MountTypeEnum, RestartPolicy, RestartPolicyNameEnum, }; use bollard::query_parameters::{ CreateContainerOptionsBuilder, CreateImageOptions, DownloadFromContainerOptionsBuilder, @@ -17,7 +17,7 @@ use bollard::query_parameters::{ }; use bytes::Bytes; use futures::{Stream, StreamExt}; -use openshell_core::config::DEFAULT_STOP_TIMEOUT_SECS; +use openshell_core::config::{CDI_GPU_DEVICE_ALL, DEFAULT_STOP_TIMEOUT_SECS}; use openshell_core::proto::compute::v1::{ CreateSandboxRequest, CreateSandboxResponse, DeleteSandboxRequest, DeleteSandboxResponse, DriverCondition, DriverSandbox, DriverSandboxStatus, DriverSandboxTemplate, @@ -159,6 +159,7 @@ struct DockerDriverRuntimeConfig { supervisor_bin: PathBuf, guest_tls: Option, daemon_version: String, + supports_gpu: bool, } #[derive(Clone)] @@ -195,6 +196,12 @@ impl DockerComputeDriver { let version = docker.version().await.map_err(|err| { Error::execution(format!("failed to query Docker daemon version: {err}")) })?; + let supports_gpu = docker + .info() + .await + .ok() + .and_then(|info| info.cdi_spec_dirs) + .is_some_and(|dirs| !dirs.is_empty()); let daemon_arch = normalize_docker_arch(version.arch.as_deref().unwrap_or_default()); let supervisor_bin = resolve_supervisor_bin(&docker, docker_config, &daemon_arch).await?; let guest_tls = docker_guest_tls_paths(config, docker_config)?; @@ -212,6 +219,7 @@ impl DockerComputeDriver { supervisor_bin, guest_tls, daemon_version: version.version.unwrap_or_else(|| "unknown".to_string()), + supports_gpu, }, events: broadcast::channel(WATCH_BUFFER).0, supervisor_readiness, @@ -230,12 +238,15 @@ impl DockerComputeDriver { driver_name: "docker".to_string(), driver_version: self.config.daemon_version.clone(), default_image: self.config.default_image.clone(), - supports_gpu: false, + supports_gpu: self.config.supports_gpu, gpu_count: 0, } } - fn validate_sandbox(sandbox: &DriverSandbox) -> Result<(), Status> { + fn validate_sandbox( + sandbox: &DriverSandbox, + config: &DockerDriverRuntimeConfig, + ) -> Result<(), Status> { let spec = sandbox .spec .as_ref() @@ -250,9 +261,9 @@ impl DockerComputeDriver { "docker sandboxes require a template image", )); } - if spec.gpu { + if spec.gpu && !config.supports_gpu { return Err(Status::failed_precondition( - "docker compute driver does not support gpu sandboxes", + "docker GPU sandboxes require Docker CDI support. Enable CDI on the Docker daemon, then restart the OpenShell gateway/server so GPU capability is detected.", )); } if !template.agent_socket_path.trim().is_empty() { @@ -300,7 +311,7 @@ impl DockerComputeDriver { } async fn create_sandbox_inner(&self, sandbox: &DriverSandbox) -> Result<(), Status> { - Self::validate_sandbox(sandbox)?; + Self::validate_sandbox(sandbox, &self.config)?; if self .find_managed_container_summary(&sandbox.id, &sandbox.name) @@ -674,7 +685,7 @@ impl ComputeDriver for DockerComputeDriver { .into_inner() .sandbox .ok_or_else(|| Status::invalid_argument("sandbox is required"))?; - Self::validate_sandbox(&sandbox)?; + Self::validate_sandbox(&sandbox, &self.config)?; Ok(Response::new(ValidateSandboxCreateResponse {})) } @@ -876,6 +887,16 @@ fn build_environment(sandbox: &DriverSandbox, config: &DockerDriverRuntimeConfig .collect() } +fn docker_gpu_device_requests(gpu: bool) -> Option> { + gpu.then(|| { + vec![DeviceRequest { + driver: Some("cdi".to_string()), + device_ids: Some(vec![CDI_GPU_DEVICE_ALL.to_string()]), + ..Default::default() + }] + }) +} + fn build_container_create_body( sandbox: &DriverSandbox, config: &DockerDriverRuntimeConfig, @@ -917,6 +938,7 @@ fn build_container_create_body( host_config: Some(HostConfig { nano_cpus: resource_limits.nano_cpus, memory: resource_limits.memory_bytes, + device_requests: docker_gpu_device_requests(spec.gpu), mounts: Some(build_mounts(config)), restart_policy: Some(RestartPolicy { name: Some(RestartPolicyNameEnum::UNLESS_STOPPED), diff --git a/crates/openshell-driver-docker/src/tests.rs b/crates/openshell-driver-docker/src/tests.rs index cf9632c40d..16dc3f733f 100644 --- a/crates/openshell-driver-docker/src/tests.rs +++ b/crates/openshell-driver-docker/src/tests.rs @@ -52,6 +52,7 @@ fn runtime_config() -> DockerDriverRuntimeConfig { key: PathBuf::from("/tmp/tls.key"), }), daemon_version: "28.0.0".to_string(), + supports_gpu: false, } } @@ -170,6 +171,48 @@ fn build_container_create_body_clears_inherited_cmd() { .and_then(|labels| labels.get(SANDBOX_NAMESPACE_LABEL_KEY)), Some(&"default".to_string()) ); + assert!( + create_body + .host_config + .as_ref() + .and_then(|host_config| host_config.device_requests.as_ref()) + .is_none(), + "non-GPU containers should not request Docker devices" + ); +} + +#[test] +fn validate_sandbox_rejects_gpu_when_cdi_unavailable() { + let config = runtime_config(); + let mut sandbox = test_sandbox(); + sandbox.spec.as_mut().unwrap().gpu = true; + + let err = DockerComputeDriver::validate_sandbox(&sandbox, &config).unwrap_err(); + + assert_eq!(err.code(), tonic::Code::FailedPrecondition); + assert!(err.message().contains("Docker CDI")); +} + +#[test] +fn build_container_create_body_maps_gpu_to_all_cdi_device() { + let mut config = runtime_config(); + config.supports_gpu = true; + let mut sandbox = test_sandbox(); + sandbox.spec.as_mut().unwrap().gpu = true; + + let create_body = build_container_create_body(&sandbox, &config).unwrap(); + let request = create_body + .host_config + .as_ref() + .and_then(|host_config| host_config.device_requests.as_ref()) + .and_then(|requests| requests.first()) + .expect("GPU request should add a Docker device request"); + + assert_eq!(request.driver.as_deref(), Some("cdi")); + assert_eq!( + request.device_ids.as_ref().unwrap(), + &vec![CDI_GPU_DEVICE_ALL.to_string()] + ); } #[test] diff --git a/docs/sandboxes/manage-sandboxes.mdx b/docs/sandboxes/manage-sandboxes.mdx index fb24bae9bb..4b83fb4bb3 100644 --- a/docs/sandboxes/manage-sandboxes.mdx +++ b/docs/sandboxes/manage-sandboxes.mdx @@ -39,6 +39,10 @@ To request GPU resources, add `--gpu`: openshell sandbox create --gpu -- claude ``` +For Docker-backed sandboxes, GPU injection uses Docker CDI. If you enable Docker +CDI after the gateway starts, restart the gateway so OpenShell can detect the +updated Docker daemon capability. + ### Custom Containers Use `--from` to create a sandbox from a pre-built community package, a local directory, or a container image: diff --git a/e2e/rust/e2e-docker.sh b/e2e/rust/e2e-docker.sh index 1c32ed4d17..fdb849a6fa 100755 --- a/e2e/rust/e2e-docker.sh +++ b/e2e/rust/e2e-docker.sh @@ -2,7 +2,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# Run the Rust e2e smoke test against a standalone gateway running the +# Run a Rust e2e test against a standalone gateway running the # bundled Docker compute driver. # # Unlike the Kubernetes driver (which deploys a k3s cluster) or the VM @@ -20,10 +20,12 @@ # 4. Starts openshell-gateway with --drivers=docker, binding to a # random free host port. # 5. Installs the client cert into the CLI gateway config dir and -# runs the Rust smoke test. +# runs the selected Rust e2e test. # 6. Tears the gateway process down on exit. # -# Usage: mise run e2e:docker +# Usage: +# mise run e2e:docker +# mise run e2e:docker:gpu set -euo pipefail @@ -35,6 +37,8 @@ STATE_DIR="" GATEWAY_CONFIG_DIR="" GATEWAY_PID="" GATEWAY_LOG="${WORKDIR}/gateway.log" +E2E_TEST="${OPENSHELL_E2E_DOCKER_TEST:-smoke}" +GPU_MODE="${OPENSHELL_E2E_DOCKER_GPU:-0}" # Unique sandbox namespace for this test run. Set just before the gateway # is started so cleanup can filter Docker containers strictly to ones # this run created, even when other OpenShell sandboxes are present on @@ -119,6 +123,17 @@ if ! command -v openssl >/dev/null 2>&1; then echo "ERROR: openssl is required to generate ephemeral PKI" >&2 exit 2 fi +if [ "${GPU_MODE}" = "1" ]; then + DOCKER_CDI_SPEC_DIRS="$(docker info --format '{{json .CDISpecDirs}}' 2>/dev/null || true)" + if [ -z "${DOCKER_CDI_SPEC_DIRS}" ] \ + || [ "${DOCKER_CDI_SPEC_DIRS}" = "null" ] \ + || [ "${DOCKER_CDI_SPEC_DIRS}" = "[]" ] \ + || [ "${DOCKER_CDI_SPEC_DIRS}" = "" ]; then + echo "ERROR: e2e:docker:gpu requires Docker CDI support." >&2 + echo " Generate CDI specs and restart Docker, then verify docker info reports CDISpecDirs." >&2 + exit 2 + fi +fi normalize_arch() { case "$1" in @@ -186,8 +201,10 @@ chmod +x "${SUPERVISOR_BIN}" # in the image. Use the community sandbox base image (also what real # deployments default to). Callers can override with # OPENSHELL_E2E_DOCKER_SANDBOX_IMAGE if they have a smaller local image -# with the required 'sandbox' user. -SANDBOX_IMAGE="${OPENSHELL_E2E_DOCKER_SANDBOX_IMAGE:-ghcr.io/nvidia/openshell-community/sandboxes/base:latest}" +# with the required 'sandbox' user. CDI injects the NVIDIA userspace +# stack at runtime, so the GPU lane uses the same base image. +DEFAULT_SANDBOX_IMAGE="ghcr.io/nvidia/openshell-community/sandboxes/base:latest" +SANDBOX_IMAGE="${OPENSHELL_E2E_DOCKER_SANDBOX_IMAGE:-${DEFAULT_SANDBOX_IMAGE}}" if ! docker image inspect "${SANDBOX_IMAGE}" >/dev/null 2>&1; then echo "Pulling ${SANDBOX_IMAGE}..." docker pull "${SANDBOX_IMAGE}" @@ -313,8 +330,8 @@ if [ "${elapsed}" -ge "${timeout}" ]; then exit 1 fi -# ── Run the smoke test ─────────────────────────────────────────────── -echo "Running e2e smoke test (gateway: ${OPENSHELL_GATEWAY}, endpoint: ${CLI_GATEWAY_ENDPOINT})..." -cargo test --manifest-path e2e/rust/Cargo.toml --features e2e --test smoke -- --nocapture +# ── Run the selected test ──────────────────────────────────────────── +echo "Running e2e ${E2E_TEST} test (gateway: ${OPENSHELL_GATEWAY}, endpoint: ${CLI_GATEWAY_ENDPOINT})..." +cargo test --manifest-path e2e/rust/Cargo.toml --features e2e --test "${E2E_TEST}" -- --nocapture -echo "Smoke test passed." +echo "${E2E_TEST} test passed." diff --git a/e2e/rust/tests/docker_gpu.rs b/e2e/rust/tests/docker_gpu.rs new file mode 100644 index 0000000000..f85dc48b8a --- /dev/null +++ b/e2e/rust/tests/docker_gpu.rs @@ -0,0 +1,36 @@ +// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +#![cfg(feature = "e2e")] + +//! Docker GPU e2e test. +//! +//! Requires a Docker-backed gateway started with Docker CDI support. The +//! `e2e:docker:gpu` mise task starts that gateway with the default sandbox image +//! unless OPENSHELL_E2E_DOCKER_SANDBOX_IMAGE is set. + +use openshell_e2e::harness::output::strip_ansi; +use openshell_e2e::harness::sandbox::SandboxGuard; + +#[tokio::test] +async fn docker_gpu_sandbox_runs_nvidia_smi() { + let mut guard = SandboxGuard::create(&[ + "--gpu", + "--", + "sh", + "-lc", + "gpu_name=$(nvidia-smi --query-gpu=name --format=csv,noheader | head -n 1); \ + test -n \"$gpu_name\"; \ + printf 'gpu-ok:%s\n' \"$gpu_name\"", + ]) + .await + .expect("GPU sandbox create should succeed"); + + let output = strip_ansi(&guard.create_output); + assert!( + output.contains("gpu-ok:"), + "expected GPU smoke marker in sandbox output:\n{output}" + ); + + guard.cleanup().await; +} diff --git a/tasks/test.toml b/tasks/test.toml index 5a7f306bc8..88cfcf3321 100644 --- a/tasks/test.toml +++ b/tasks/test.toml @@ -60,3 +60,8 @@ run = "e2e/rust/e2e-vm.sh" ["e2e:docker"] description = "Run smoke e2e against a standalone gateway with the Docker compute driver" run = "e2e/rust/e2e-docker.sh" + +["e2e:docker:gpu"] +description = "Run GPU e2e against a standalone gateway with the Docker compute driver" +env = { OPENSHELL_E2E_DOCKER_GPU = "1", OPENSHELL_E2E_DOCKER_TEST = "docker_gpu" } +run = "e2e/rust/e2e-docker.sh" From ea4915ad30ed26baae8517c438bcd670c7cca6f4 Mon Sep 17 00:00:00 2001 From: Seth Jennings Date: Thu, 30 Apr 2026 19:39:26 -0500 Subject: [PATCH 4/5] feat(server): add feat: auto-detection of compute driver at startup (#1088) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When no drivers are explicitly configured, the server now automatically detects the appropriate compute driver by checking the runtime environment: - Kubernetes: detected via KUBERNETES_SERVICE_HOST env var (set inside pods) - Podman: detected by checking if podman binary is available on PATH - Docker: detected by checking if docker binary is available on PATH Priority order: Kubernetes → Podman → Docker. VM is never auto-detected and must be selected explicitly via --drivers vm. The Auto variant is internal-only and does not serialize to config files. The default --drivers value is now empty, triggering auto-detection. --- crates/openshell-core/src/config.rs | 85 ++++++++++++++++++++++++----- crates/openshell-server/src/cli.rs | 4 +- crates/openshell-server/src/lib.rs | 38 +++++++++++-- 3 files changed, 105 insertions(+), 22 deletions(-) diff --git a/crates/openshell-core/src/config.rs b/crates/openshell-core/src/config.rs index bfcb6cd09f..8d59cb79b6 100644 --- a/crates/openshell-core/src/config.rs +++ b/crates/openshell-core/src/config.rs @@ -7,6 +7,7 @@ use serde::{Deserialize, Serialize}; use std::fmt; use std::net::SocketAddr; use std::path::PathBuf; +use std::process::Command; use std::str::FromStr; // ── Public default constants ──────────────────────────────────────────── @@ -86,6 +87,40 @@ impl FromStr for ComputeDriverKind { } } +/// Auto-detect the appropriate compute driver based on the runtime environment. +/// +/// Priority order: Kubernetes → Podman → Docker. +/// VM is never auto-detected (requires explicit `--drivers vm`). +/// +/// Returns the first driver where the environment check passes. +/// Returns `None` if no compatible driver is found. +pub fn detect_driver() -> Option { + // Kubernetes: check for KUBERNETES_SERVICE_HOST env var (set inside pods) + if std::env::var_os("KUBERNETES_SERVICE_HOST").is_some() { + return Some(ComputeDriverKind::Kubernetes); + } + + // Podman: check if podman binary is available + if is_binary_available("podman") { + return Some(ComputeDriverKind::Podman); + } + + // Docker: check if docker binary is available + if is_binary_available("docker") { + return Some(ComputeDriverKind::Docker); + } + + None +} + +/// Check if a binary is available on the system PATH. +fn is_binary_available(name: &str) -> bool { + Command::new(name) + .arg("--version") + .output() + .is_ok_and(|output| output.status.success()) +} + /// Server configuration. #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Config { @@ -124,7 +159,7 @@ pub struct Config { /// The config shape allows multiple drivers so the gateway can evolve /// toward multi-backend routing. Current releases require exactly one /// configured driver. - #[serde(default = "default_compute_drivers")] + #[serde(default)] pub compute_drivers: Vec, /// Kubernetes namespace for sandboxes. @@ -296,7 +331,7 @@ impl Config { tls, oidc: None, database_url: String::new(), - compute_drivers: default_compute_drivers(), + compute_drivers: vec![], sandbox_namespace: default_sandbox_namespace(), sandbox_image: default_sandbox_image(), sandbox_image_pull_policy: String::new(), @@ -472,10 +507,6 @@ fn default_sandbox_image() -> String { format!("{}/base:latest", crate::image::DEFAULT_COMMUNITY_REGISTRY) } -fn default_compute_drivers() -> Vec { - vec![ComputeDriverKind::Kubernetes] -} - fn default_ssh_gateway_host() -> String { "127.0.0.1".to_string() } @@ -506,7 +537,7 @@ const fn default_ssh_session_ttl_secs() -> u64 { #[cfg(test)] mod tests { - use super::{ComputeDriverKind, Config}; + use super::{ComputeDriverKind, Config, detect_driver}; use std::net::SocketAddr; #[test] @@ -535,14 +566,6 @@ mod tests { assert!(err.contains("unsupported compute driver 'firecracker'")); } - #[test] - fn config_defaults_to_kubernetes_driver() { - assert_eq!( - Config::new(None).compute_drivers, - vec![ComputeDriverKind::Kubernetes] - ); - } - #[test] fn config_new_disables_health_bind_by_default() { let cfg = Config::new(None); @@ -555,4 +578,36 @@ mod tests { let cfg = Config::new(None).with_health_bind_address(addr); assert_eq!(cfg.health_bind_address, Some(addr)); } + + #[test] + fn detect_driver_returns_none_without_k8s_env_or_binaries() { + // When KUBERNETES_SERVICE_HOST is not set and no docker/podman binaries + // are available, detect_driver should return None. + // This test may pass or fail depending on the test environment, + // but it documents the expected behavior. + let _ = detect_driver(); // Returns Some or None based on environment + } + + #[test] + #[allow(unsafe_code)] // std::env::set_var/remove_var require unsafe in Rust 2024 + fn detect_driver_prefers_kubernetes_when_k8s_env_is_set() { + // Save the original env var + let original = std::env::var("KUBERNETES_SERVICE_HOST").ok(); + + // Set the env var + unsafe { + std::env::set_var("KUBERNETES_SERVICE_HOST", "127.0.0.1"); + } + + let result = detect_driver(); + assert_eq!(result, Some(ComputeDriverKind::Kubernetes)); + + // Restore the original env var + unsafe { + match original { + Some(val) => std::env::set_var("KUBERNETES_SERVICE_HOST", val), + None => std::env::remove_var("KUBERNETES_SERVICE_HOST"), + } + } + } } diff --git a/crates/openshell-server/src/cli.rs b/crates/openshell-server/src/cli.rs index 2d8ad391a2..6e64b596ee 100644 --- a/crates/openshell-server/src/cli.rs +++ b/crates/openshell-server/src/cli.rs @@ -61,12 +61,14 @@ struct Args { /// Accepts a comma-delimited list such as `kubernetes` or /// `kubernetes,podman`. The configuration format is future-proofed for /// multiple drivers, but the gateway currently requires exactly one. + /// When unset, the gateway auto-detects the driver based on the runtime + /// environment (Kubernetes → Podman → Docker). VM is never auto-detected + /// and requires explicit configuration. #[arg( long, alias = "driver", env = "OPENSHELL_DRIVERS", value_delimiter = ',', - default_value = "kubernetes", value_parser = parse_compute_driver )] drivers: Vec, diff --git a/crates/openshell-server/src/lib.rs b/crates/openshell-server/src/lib.rs index 562d926b89..18243dc5af 100644 --- a/crates/openshell-server/src/lib.rs +++ b/crates/openshell-server/src/lib.rs @@ -498,9 +498,12 @@ async fn build_compute_runtime( fn configured_compute_driver(config: &Config) -> Result { match config.compute_drivers.as_slice() { - [] => Err(Error::config( - "at least one compute driver must be configured", - )), + [] => openshell_core::config::detect_driver().ok_or_else(|| { + Error::config( + "no compute driver configured and auto-detection found no suitable driver; \ + set --drivers or OPENSHELL_DRIVERS to kubernetes, podman, docker, or vm", + ) + }), [ driver @ (ComputeDriverKind::Kubernetes | ComputeDriverKind::Vm @@ -545,10 +548,33 @@ mod tests { } #[test] - fn configured_compute_driver_rejects_empty_drivers() { + fn configured_compute_driver_triggers_auto_detection_when_empty() { let config = Config::new(None).with_compute_drivers([]); - let err = configured_compute_driver(&config).unwrap_err(); - assert!(err.to_string().contains("at least one compute driver")); + // Empty drivers triggers auto-detection, which may return Some or None + // depending on the environment. This test verifies the auto-detection path + // is taken rather than immediately returning an error. + let result = configured_compute_driver(&config); + // Either we get a detected driver or an error about none being detected + match result { + Ok(driver) => { + assert!( + matches!( + driver, + ComputeDriverKind::Kubernetes + | ComputeDriverKind::Docker + | ComputeDriverKind::Podman + ), + "auto-detected unexpected driver: {driver:?}" + ); + } + Err(e) => { + assert!( + e.to_string() + .contains("no compute driver configured and none detected"), + "unexpected error: {e}" + ); + } + } } #[test] From f46b296daf32596f3204e4e178e996df7ef5b0f8 Mon Sep 17 00:00:00 2001 From: Piotr Mlocek Date: Thu, 30 Apr 2026 18:59:43 -0700 Subject: [PATCH 5/5] test(e2e): skip docker gpu test in rust suite (#1103) Signed-off-by: Piotr Mlocek --- tasks/test.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/test.toml b/tasks/test.toml index 88cfcf3321..90ef471907 100644 --- a/tasks/test.toml +++ b/tasks/test.toml @@ -32,8 +32,8 @@ description = "Run Rust CLI e2e tests (requires a running cluster)" depends = ["cluster"] run = [ "cargo build -p openshell-cli --features openshell-core/dev-settings", - # gateway_resume tests run in a dedicated CI job with their own cluster. - "cargo test --manifest-path e2e/rust/Cargo.toml --features e2e -- --skip gateway_resume_scenarios", + # gateway_resume and Docker GPU tests run in dedicated jobs with their own clusters. + "cargo test --manifest-path e2e/rust/Cargo.toml --features e2e -- --skip gateway_resume_scenarios --skip docker_gpu_sandbox_runs_nvidia_smi", ] ["e2e:python"]