From ca2b6e577bd400f0a255c64afcb0d5b685ca14f1 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Fri, 20 Nov 2026 10:58:59 +0100 Subject: [PATCH 1/3] test(tmachine): make the external driver role runtime-agnostic Each runtime's vars file now supplies the driver's own arguments, environment, and an optional configuration template, so the service template no longer assumes the Docker driver's flags. Add the Podman settings, which run the driver as the gateway's user and wait for the rootless user manager. Signed-off-by: Evan Lezar --- .../openshell_external_driver/tasks/main.yaml | 14 +++++++++-- .../templates/driver.service.j2 | 9 ++++--- .../vars/docker.yaml | 6 +++++ .../vars/podman.yaml | 25 +++++++++++++++++++ 4 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 tests/tmachine/ansible/roles/openshell_external_driver/vars/podman.yaml diff --git a/tests/tmachine/ansible/roles/openshell_external_driver/tasks/main.yaml b/tests/tmachine/ansible/roles/openshell_external_driver/tasks/main.yaml index a31363d57d..3b8bdc3772 100644 --- a/tests/tmachine/ansible/roles/openshell_external_driver/tasks/main.yaml +++ b/tests/tmachine/ansible/roles/openshell_external_driver/tasks/main.yaml @@ -14,7 +14,16 @@ # openshell_external_driver_name the name to register it under; a built-in # driver's name cannot be selected over a socket # The binary must be openshell-driver- for the machine's container runtime -# (openshell_gateway_driver), which selects the settings in vars/.yaml. +# (openshell_gateway_driver), which selects the settings in vars/.yaml: +# openshell_external_driver_binary_name the installed executable's name +# openshell_external_driver_socket the compute socket the driver binds +# openshell_external_driver_args the runtime's own command-line arguments, +# after the common --bind-socket +# openshell_external_driver_requires the unit the service needs running first +# openshell_external_driver_config_template optional, for a driver that reads a +# configuration file +# openshell_external_driver_environment optional, extra Environment= entries +# openshell_external_driver_supplementary_groups optional --- - name: Check the driver matches the container runtime ansible.builtin.assert: @@ -59,9 +68,10 @@ mode: "0755" - name: Write the external driver configuration + when: openshell_external_driver_config_template is defined become: true ansible.builtin.template: - src: "driver-{{ openshell_gateway_driver }}.toml.j2" + src: "{{ openshell_external_driver_config_template }}" dest: "/etc/openshell/driver-{{ openshell_external_driver_name }}.toml" mode: "0644" diff --git a/tests/tmachine/ansible/roles/openshell_external_driver/templates/driver.service.j2 b/tests/tmachine/ansible/roles/openshell_external_driver/templates/driver.service.j2 index 6bf453e158..1df422df24 100644 --- a/tests/tmachine/ansible/roles/openshell_external_driver/templates/driver.service.j2 +++ b/tests/tmachine/ansible/roles/openshell_external_driver/templates/driver.service.j2 @@ -13,10 +13,13 @@ SupplementaryGroups={{ openshell_external_driver_supplementary_groups }} RuntimeDirectory=openshell-driver-{{ openshell_gateway_driver }} Environment=OPENSHELL_SANDBOX_RUNTIME_IMAGE=docker.io/openshell/sandbox:tmachine Environment=OPENSHELL_SUPERVISOR_IMAGE=docker.io/openshell/supervisor:tmachine +{% for entry in openshell_external_driver_environment | default([]) %} +Environment={{ entry }} +{% endfor %} ExecStart=/usr/local/bin/{{ openshell_external_driver_binary_name }} \ - --bind-socket {{ openshell_external_driver_socket }} \ - --config /etc/openshell/driver-{{ openshell_external_driver_name }}.toml \ - --gateway-bind {{ openshell_gateway_bind_address }} + --bind-socket {{ openshell_external_driver_socket }}{% for arg in openshell_external_driver_args %} \ + {{ arg }}{% endfor %} + Restart=on-failure [Install] diff --git a/tests/tmachine/ansible/roles/openshell_external_driver/vars/docker.yaml b/tests/tmachine/ansible/roles/openshell_external_driver/vars/docker.yaml index c9518d3bef..dc15c5bec0 100644 --- a/tests/tmachine/ansible/roles/openshell_external_driver/vars/docker.yaml +++ b/tests/tmachine/ansible/roles/openshell_external_driver/vars/docker.yaml @@ -6,3 +6,9 @@ openshell_external_driver_binary_name: openshell-driver-docker openshell_external_driver_socket: /run/openshell-driver-docker/compute.sock openshell_external_driver_supplementary_groups: docker openshell_external_driver_requires: docker.service +openshell_external_driver_config_template: driver-docker.toml.j2 +openshell_external_driver_args: + - --config + - "/etc/openshell/driver-{{ openshell_external_driver_name }}.toml" + - --gateway-bind + - "{{ openshell_gateway_bind_address }}" diff --git a/tests/tmachine/ansible/roles/openshell_external_driver/vars/podman.yaml b/tests/tmachine/ansible/roles/openshell_external_driver/vars/podman.yaml new file mode 100644 index 0000000000..fd5332653c --- /dev/null +++ b/tests/tmachine/ansible/roles/openshell_external_driver/vars/podman.yaml @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# The Podman driver takes its settings as arguments, not a configuration file. +# It runs as the gateway's user: root for rootful Podman, and for rootless +# Podman the unprivileged user whose Podman socket it talks to. The rootless +# socket is a user unit, so the driver waits for that user's manager instead. +--- +openshell_external_driver_binary_name: openshell-driver-podman +openshell_external_driver_socket: /run/openshell-driver-podman/compute.sock +openshell_external_driver_requires: >- + {{ ('user@' ~ openshell_gateway_uid ~ '.service') + if tmachine_container_runtime_is_rootless | bool else 'podman.socket' }} +openshell_external_driver_environment: >- + {{ ['XDG_RUNTIME_DIR=/run/user/' ~ openshell_gateway_uid] + if tmachine_container_runtime_is_rootless | bool else [] }} +openshell_external_driver_args: + - --podman-socket + - "{{ openshell_runtime_socket }}" + - --podman-tls-ca + - "{{ openshell_gateway_home }}/.local/state/openshell/tls/ca.crt" + - --gateway-port + - "17670" + - --network-name + - tmachine From ad7722ea7271bd9130b1e6e5d3bde0af19228df8 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Fri, 20 Nov 2026 10:58:59 +0100 Subject: [PATCH 2/3] ci: run the Podman external-driver conformance on tmachine Build the external-driver installers from one helper and add rpm-external-podman-driver, which serves both rootful and rootless Podman because the role selects the driver's settings from the machine's runtime. Add conformance rows for both Fedora Podman environments. Signed-off-by: Evan Lezar --- .github/workflows/e2e-suites.yml | 2 + tests/tmachine/config.nix | 80 ++++++++++++++++++++------------ 2 files changed, 52 insertions(+), 30 deletions(-) diff --git a/.github/workflows/e2e-suites.yml b/.github/workflows/e2e-suites.yml index a2fade9dcc..0edb3dd8a6 100644 --- a/.github/workflows/e2e-suites.yml +++ b/.github/workflows/e2e-suites.yml @@ -95,6 +95,8 @@ jobs: rows='[ {"environment":"ubuntu-docker-rootful","installer":"deb","family":"conformance","package":"conformance","gateway":"openshell","runner":"ubuntu-24.04"}, {"environment":"ubuntu-docker-rootful","installer":"deb-external-docker-driver","family":"conformance","package":"conformance","gateway":"openshell","runner":"ubuntu-24.04","external_driver":true}, + {"environment":"fedora-podman-rootful","installer":"rpm-external-podman-driver","family":"conformance","package":"conformance","gateway":"openshell","runner":"ubuntu-24.04","external_driver":true}, + {"environment":"fedora-podman-rootless","installer":"rpm-external-podman-driver","family":"conformance","package":"conformance","gateway":"openshell","runner":"ubuntu-24.04","external_driver":true}, {"environment":"fedora-podman-rootful","installer":"rpm","family":"conformance","package":"conformance","gateway":"openshell","runner":"ubuntu-24.04"}, {"environment":"fedora-podman-rootless","installer":"rpm","family":"conformance","package":"conformance","gateway":"openshell","runner":"ubuntu-24.04"}, {"environment":"ubuntu-k3s","installer":"k3s","family":"conformance","package":"conformance","gateway":"tmachine","runner":"ubuntu-24.04"}, diff --git a/tests/tmachine/config.nix b/tests/tmachine/config.nix index 6f3194cbe9..e0738e84e7 100644 --- a/tests/tmachine/config.nix +++ b/tests/tmachine/config.nix @@ -34,6 +34,42 @@ let openshell_sandbox_image = "../../artifacts/images/openshell-sandbox-tmachine.tar"; openshell_supervisor_image = "../../artifacts/images/openshell-supervisor-tmachine.tar"; }; + # The packaged installers' inputs, shared with the ones that also run a + # compute driver as an external service. + debInputs = { + openshell_deb = "../../artifacts/packages/openshell.deb"; + openshell_e2e_python_image = e2ePythonImage; + openshell_supervisor_image = "../../artifacts/images/openshell-supervisor-tmachine.tar"; + openshell_sandbox_image = "../../artifacts/images/openshell-sandbox-tmachine.tar"; + }; + rpmInputs = { + openshell_rpm = "../../artifacts/packages/rpm/openshell.rpm"; + openshell_gateway_rpm = "../../artifacts/packages/rpm/openshell-gateway.rpm"; + openshell_e2e_python_image = e2ePythonImage; + openshell_supervisor_image = "../../artifacts/images/openshell-supervisor-tmachine.tar"; + openshell_sandbox_image = "../../artifacts/images/openshell-sandbox-tmachine.tar"; + }; + # A packaged installer with the compute driver for the machine's container + # runtime run as an external service, built from the same revision as the + # gateway. The openshell_external_driver role reads the driver's settings + # for that runtime, so an installer for a driver works on any machine with + # that driver's runtime, such as both rootful and rootless Podman. + externalDriverInstaller = + { + package, + playbook, + inputs, + driver, + }: + { + name = "${package}-external-${driver}-driver"; + use_galaxy = false; + playbooks = [ playbook ]; + inputs = inputs // { + openshell_external_driver_binary = "../../artifacts/external-drivers/${gnuTarget}/openshell-driver-${driver}"; + openshell_external_driver_name = "external"; + }; + }; fedoraPodman = podman: { machine = "fedora"; driver = "podman"; @@ -202,30 +238,14 @@ let playbooks = [ "ansible/playbooks/openshell-deb.yaml" ]; - inputs = { - openshell_deb = "../../artifacts/packages/openshell.deb"; - openshell_e2e_python_image = e2ePythonImage; - openshell_supervisor_image = "../../artifacts/images/openshell-supervisor-tmachine.tar"; - openshell_sandbox_image = "../../artifacts/images/openshell-sandbox-tmachine.tar"; - }; - } - { - # The deb installer, with the Docker compute driver run as an external service, - # built from the same revision as the gateway. - name = "deb-external-docker-driver"; - use_galaxy = false; - playbooks = [ - "ansible/playbooks/openshell-deb.yaml" - ]; - inputs = { - openshell_deb = "../../artifacts/packages/openshell.deb"; - openshell_e2e_python_image = e2ePythonImage; - openshell_external_driver_binary = "../../artifacts/external-drivers/${gnuTarget}/openshell-driver-docker"; - openshell_external_driver_name = "external"; - openshell_supervisor_image = "../../artifacts/images/openshell-supervisor-tmachine.tar"; - openshell_sandbox_image = "../../artifacts/images/openshell-sandbox-tmachine.tar"; - }; + inputs = debInputs; } + (externalDriverInstaller { + package = "deb"; + driver = "docker"; + playbook = "ansible/playbooks/openshell-deb.yaml"; + inputs = debInputs; + }) { # Installs the latest published release, as the baseline of an upgrade # test, and stages the candidate under /var/lib/openshell-qualification @@ -247,14 +267,14 @@ let name = "rpm"; use_galaxy = false; playbooks = [ "ansible/playbooks/openshell-rpm.yaml" ]; - inputs = { - openshell_rpm = "../../artifacts/packages/rpm/openshell.rpm"; - openshell_gateway_rpm = "../../artifacts/packages/rpm/openshell-gateway.rpm"; - openshell_e2e_python_image = e2ePythonImage; - openshell_supervisor_image = "../../artifacts/images/openshell-supervisor-tmachine.tar"; - openshell_sandbox_image = "../../artifacts/images/openshell-sandbox-tmachine.tar"; - }; + inputs = rpmInputs; } + (externalDriverInstaller { + package = "rpm"; + driver = "podman"; + playbook = "ansible/playbooks/openshell-rpm.yaml"; + inputs = rpmInputs; + }) ]; testsuites = [ From 378252e15e60901b24f8c0763258cd930bbb2f5e Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Fri, 20 Nov 2026 11:46:07 +0100 Subject: [PATCH 3/3] ci(e2e): remove the shell-driven Podman external-driver lane The tmachine rows for rpm-external-podman-driver run the same Podman conformance against the packaged gateway, so drop podman-external-driver-e2e, its mise task, and the external-driver-binary input only it used. Signed-off-by: Evan Lezar --- .github/workflows/branch-e2e.yml | 17 ----------------- .github/workflows/e2e-podman-test.yml | 9 --------- tasks/test.toml | 5 ----- 3 files changed, 31 deletions(-) diff --git a/.github/workflows/branch-e2e.yml b/.github/workflows/branch-e2e.yml index bd73fa983f..98d925d3e8 100644 --- a/.github/workflows/branch-e2e.yml +++ b/.github/workflows/branch-e2e.yml @@ -569,22 +569,6 @@ jobs: suite-name: additional-ca test-name: additional_ca - podman-external-driver-e2e: - needs: [pr_metadata, build-binaries-linux, build-conformance, 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 - contents: read - packages: read - uses: ./.github/workflows/e2e-podman-test.yml - with: - prebuilt-conformance: true - image-tag: ${{ github.sha }} - gateway-artifact: openshell-gateway-plain-x86_64-unknown-linux-gnu - external-driver-binary: openshell-driver-podman - suite-matrix: >- - [{"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-binaries-linux, build-conformance, build-gateway-plain, build-vm-driver-linux] if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true' @@ -785,7 +769,6 @@ jobs: - podman-additional-ca-e2e - vm-e2e - vm-additional-ca-e2e - - podman-external-driver-e2e - vm-external-driver-e2e - kubernetes-e2e - kubernetes-app-listener-e2e diff --git a/.github/workflows/e2e-podman-test.yml b/.github/workflows/e2e-podman-test.yml index ac6d7d66ef..4f63d0cc2c 100644 --- a/.github/workflows/e2e-podman-test.yml +++ b/.github/workflows/e2e-podman-test.yml @@ -21,10 +21,6 @@ on: required: false type: boolean default: false - external-driver-binary: - required: false - type: string - default: "" suite-matrix: required: true type: string @@ -63,11 +59,6 @@ jobs: with: artifact-name: ${{ inputs.gateway-artifact }} - - if: inputs.external-driver-binary != '' - uses: ./.github/actions/setup-e2e-driver - with: - binary: ${{ inputs.external-driver-binary }} - - uses: ./.github/actions/setup-e2e-podman with: podman-major: ${{ matrix.podman_major }} diff --git a/tasks/test.toml b/tasks/test.toml index b2e599241c..465d9cff74 100644 --- a/tasks/test.toml +++ b/tasks/test.toml @@ -397,11 +397,6 @@ run = "e2e/rust/e2e-vm.sh" description = "Build and launch-check openshell-gateway without compiled compute drivers" run = "bash e2e/no-compute-driver-gateway.sh" -["e2e:podman:external-driver"] -description = "Run Podman conformance with a driver-free gateway and external Podman driver binary" -env = { OPENSHELL_E2E_EXTERNAL_COMPUTE_DRIVER = "1", OPENSHELL_E2E_PODMAN_FEATURES = "e2e-conformance-only" } -run = "e2e/rust/e2e-podman.sh" - ["e2e:vm:external-driver"] description = "Run VM E2E with a driver-free gateway and external VM driver binary" env = { OPENSHELL_E2E_EXTERNAL_COMPUTE_DRIVER = "1" }