Skip to content

feat(packaging): ship openshell-driver-vm in an RPM subpackage - #5152

Open
vineethsai7 wants to merge 2 commits into
NVIDIA:mainfrom
vineethsai7:feat/5146-v1
Open

vineethsai7 wants to merge 2 commits into
NVIDIA:mainfrom
vineethsai7:feat/5146-v1

Conversation

@vineethsai7

@vineethsai7 vineethsai7 commented Nov 2, 2026 •

Copy link
Copy Markdown

Summary

Ship the VM compute driver as an optional RPM for x86_64 and aarch64. Fedora and RHEL users can install it with dnf at the path the gateway already searches, without managing a separate release tarball.

Related Issue

Closes #5146

The issue is still state:triage-needed; design feedback is welcome.

Design

The gateway already looks for openshell-driver-vm under /usr/libexec/openshell, the path used by the Debian package. The new RPM owns that directory and binary. It requires openshell-gateway = %{version}-%{release} so upgrades keep the two builds together, and e2fsprogs >= 1.43 for VM disk operations. The existing RPM configuration continues to select Podman until the operator selects vm.

Bundling the driver in openshell-gateway would put the VM binary and its host-tool dependency on every Podman installation. The current tarball workaround and a separate driver repository leave another artifact to pin and upgrade. Middleware, interceptors, providers, and OCSF events do not apply to package delivery; the gateway's existing subprocess lookup is the extension point used here.

Changes

  • Package the release-built VM driver in openshell-driver-vm at /usr/libexec/openshell/openshell-driver-vm, with an exact gateway requirement and an e2fsprogs requirement.
  • Download the matching GNU driver artifact in the RPM build workflow and check the built package's contents, dependencies, installed binary, and compute_driver = "vm" preflight.
  • Document the optional RPM and the one-line gateway selector change in the RPM and published gateway guides.

The workflow diff is limited to the driver artifact download and installed-package check. Changes under .github/workflows/ require upstream code-owner review.

Usage

sudo dnf install openshell-driver-vm

In the existing ~/.config/openshell/gateway.toml, change the gateway selector and keep the other settings:

[openshell.gateway]
compute_driver = "vm"
openshell-gateway config preflight --path ~/.config/openshell/gateway.toml
systemctl --user restart openshell-gateway
rpm -ql openshell-driver-vm

The RPM lists /usr/libexec/openshell/openshell-driver-vm. No configuration field or event shape changes.

Compatibility

The driver package is opt-in, and the existing Podman RPM default is unchanged. The gateway searches the installed driver path without a driver_dir override. dnf upgrade must select matching gateway and driver releases because of the exact RPM requirement.

Release Notes

Fedora and RHEL users can install the VM driver from an RPM alongside the matching gateway. Install openshell-driver-vm and select compute_driver = "vm" on a KVM host.

Testing

  • Checks appropriate to the affected code and behavior pass: targeted cargo fmt --check; default-feature clippy with -D warnings for openshell-gateway and openshell-driver-vm; 29 gateway VM unit tests, 7 gateway preflight tests, and 268 VM driver unit tests; workflow YAML parsing and bash -n; docs navigation and Fern checks.
  • Unit tests added/updated (if applicable): no Rust behavior changed; the spec now checks the driver binary, and the RPM workflow adds package assertions.
  • E2E tests added/updated (if applicable): the Fedora RPM workflow now installs the built packages and runs gateway VM preflight. A KVM sandbox launch was not run locally.

On the build box, a native rpmbuild smoke build using the v0.1.6 release binaries and temporary shims for unavailable Fedora macros produced the new RPM. The package queries returned:

$ rpm -qlp openshell-driver-vm-0.1.6-1.x86_64.rpm | grep openshell-driver-vm$
/usr/libexec/openshell/openshell-driver-vm
$ rpm -qpR openshell-driver-vm-0.1.6-1.x86_64.rpm | grep -E '^(e2fsprogs|openshell-gateway)'
e2fsprogs >= 1.43
openshell-gateway = 0.1.6-1

The shared build box has no Fedora packaging macros or container runtime, so a full Packit/Fedora build and the installed-package workflow step await CI. The preflight test binary used a temporary Z3 library path because the build box lacks the system library and the fixture clears LD_LIBRARY_PATH. Fern reports zero errors and three warnings also present with the base documentation page. A VM-only clippy build with -D warnings reports three warnings in unchanged gateway code; clippy passes with the crate's configured default features.

Follow-ups

  • Qualify a sandbox boot on a RHEL 9 or Fedora KVM host and review the x86_64 and aarch64 RPM workflow results.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

Review follow-up

Local strict-maintainer review of PR #5152 against fetched upstream main is in REVIEW-5152.md. All valid findings were fixed in f623a0cf69d72b4c5de800cc51946d53b3d95555:

Finding Severity Status
F1: RPM jobs could race the VM artifact upload P1 Fixed in f623a0cf69; all three callers now wait for build-vm-driver.
F2: tmachine RPM builder omitted the required VM binary P2 Fixed in f623a0cf69; checks and mounts the binary.
F3: VM RPM omitted bundled GPL/LGPL license metadata and notices P2 Fixed in f623a0cf69; driver-specific license expression and texts added.
F4: installed RPM check did not launch the driver P2 Fixed in f623a0cf69; startup smoke verifies the live child executable path.
F5: RPM troubleshooting skill omitted driver package diagnostics P3 Fixed in f623a0cf69; package ownership and preflight scope documented.

Each P1/P2 has a regression case in tasks/scripts/rpm_vm_packaging_test.py; F1 covers three callers. These six cases failed against the original branch inputs and passed after the fixes. The startup script was also run against locally built gateway and VM driver binaries.

Assessed concerns marked not applicable:

  • A user-local driver does not shadow the RPM binary by default: an installed /usr/bin/openshell-gateway searches /usr/libexec/openshell before ~/.local/libexec/openshell. An explicit driver_dir is an intentional override.
  • Podman remains a dependency through the existing gateway RPM Requires: podman; that predates this PR and the issue accepted a driver package that requires the gateway.
  • dnf install assumes a configured RPM source, as the existing RPM quick start does. This PR does not add repository management.
  • The published x86_64 and aarch64 embedded libkrun.so assets require at most GLIBC_2.34 in readelf --version-info; no newer glibc floor was found.
  • GitHub had no inline review comments or submitted reviews. Its two general comments were a workflow-vetting notice and a DCO statement, with no code change requested.

Checks run on the build box through dcb up-os-5146 'nice -n 15 <cmd>':

  • cargo fmt --all -- --check: passed.
  • cargo clippy -p openshell-gateway -p openshell-driver-vm --all-targets -- -D warnings: passed with configured default features.
  • cargo test -p openshell-gateway --lib vm:: -- --test-threads=4: 29 passed.
  • cargo test -p openshell-gateway --test config_preflight -- --test-threads=4: 8 passed.
  • cargo test -p openshell-driver-vm --lib -- --test-threads=4: 268 passed.
  • uv run --no-project --with pytest --with pytest-asyncio --with pyyaml pytest -q tasks/scripts/rpm_vm_packaging_test.py: 6 passed.
  • bash tasks/scripts/test-packaging-assets.sh, bash -n tasks/scripts/test-rpm-vm-install.sh, Ruff lint and format, and uv run python scripts/update_license_headers.py --check: passed.
  • uv run --no-project --with pyyaml python tasks/scripts/check_docs_nav.py: passed. npx --yes fern-api@5.112.0 check in fern/: zero errors, three baseline warnings.

The full Fedora package install lane and a KVM sandbox boot remain for upstream CI and a KVM qualification environment. Neither was run locally.

Manual verification

Result: PASS — The optional VM RPM owns /usr/libexec/openshell/openshell-driver-vm, declares the exact gateway and e2fsprogs requirements, and lets the PR-head gateway start the packaged driver from that default path. With the RPM absent, the upstream-main gateway fails startup with “vm compute driver binary not found.”

Environment

  • Fetched upstream main at cc0642fa8955 and PR head f623a0cf69d7. The source worktree was restored to the PR head afterward; no commit or GitHub write was made.
  • RHEL 9.8 x86_64 stack host: glibc 2.34, e2fsprogs 1.46.5, existing openshell-gateway RPM 0.1.5-1.fc44. Tests used one disposable user, a private HOME, private loopback ports, and compute_driver = "vm" without driver_dir. The existing gateway service and DefenseClaw were untouched.
  • Built the main gateway and the PR gateway and VM driver on the build box through dcb up-os-5146 with nice -n 15 cargo build --release --locked (only openshell-gateway and openshell-driver-vm, with openshell-gateway/vendored-z3). Both gateway binaries ran on RHEL with an Ubuntu 24.04 glibc loader and libraries confined to the disposable HOME; the host runtime libraries were unchanged.
  • Built a native x86_64 smoke RPM with rpmbuild -bb. Its reduced spec carries the PR spec's driver-vm subpackage name, dependency and license expressions, binary path, and GPL/LGPL notices. The payload is the official v0.1.6 GNU VM driver release binary, the type of artifact downloaded by the PR RPM workflow. The locally compiled PR driver required glibc 2.39 and could not run directly on this glibc 2.34 host; the release binary required at most glibc 2.28.

Steps and before: upstream main

  1. Confirm upstream/main:openshell.spec has no %package driver-vm or %files driver-vm; confirm the host had neither the VM RPM nor its libexec binary.
  2. Start the freshly built upstream-main gateway with a private VM config. Preflight found the host tools, but gateway startup stopped at the missing executable:
preflight=pass
startup=driver-binary-not-found
configuration error: vm compute driver binary not found

After: PR head

  1. Query the built RPM, then attempt an ordinary install test. The test correctly rejected the host's older gateway RPM because the driver requires an exact match. Install only the driver RPM with rpm -i --nodeps for this isolated lookup check, preserving the existing gateway package and service.
  2. Query installed package ownership and version. Start the freshly built PR-head gateway under the same private VM config. Check the live child PID's /proc/<pid>/exe target; it resolves to the RPM-owned default path. Preflight and startup both succeeded:
$ rpm -qlp openshell-driver-vm-0.1.6-1.pf5152.x86_64.rpm | grep openshell-driver-vm$
/usr/libexec/openshell/openshell-driver-vm
$ rpm -qpR openshell-driver-vm-0.1.6-1.pf5152.x86_64.rpm | grep -E '^(e2fsprogs|openshell-gateway)'
e2fsprogs >= 1.43
openshell-gateway = 0.1.6-1.pf5152
$ rpm -qf /usr/libexec/openshell/openshell-driver-vm
openshell-driver-vm-0.1.6-1.pf5152.x86_64
$ /usr/libexec/openshell/openshell-driver-vm --version
openshell-driver-vm 0.1.6
preflight=pass
driver_child=/usr/libexec/openshell/openshell-driver-vm
gateway_and_driver_alive=yes
  1. Erase the driver RPM. The PR-head gateway again reported vm compute driver binary not found with the same VM selector. Readback found the RPM, libexec directory, disposable user and HOME, staging files, proof processes, and private listeners absent. The pre-existing gateway RPM remained 0.1.5-1.fc44 and its service retained PID 1643.

Not covered

  • The full Fedora/Packit build, generated Cargo license manifests, and a dependency-resolved dnf install with a matching gateway RPM. The stack host's installed gateway was older; the ordinary RPM install test failed on the exact requirement as expected, and the manual lookup check used --nodeps to avoid replacing it.
  • An x86_64 VM sandbox boot, because this host has no /dev/kvm; aarch64 packaging and execution were not run.
  • Running the freshly compiled PR-head VM driver directly on RHEL. The installed payload was the official v0.1.6 GNU release artifact so the package path and gateway lookup could be tested on this host. The PR's two commits change packaging and documentation, not VM driver Rust code.

Signed-off-by: Vineeth Sai Narajala <vnarajal@cisco.com>
@copy-pr-bot

copy-pr-bot Bot commented Nov 2, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@vineethsai7

Copy link
Copy Markdown
Author

I have read the DCO document and I hereby sign the DCO.

Signed-off-by: Vineeth Sai Narajala <vnarajal@cisco.com>
@vineethsai7
vineethsai7 marked this pull request as ready for review November 3, 2026 04:50
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T04:58:18.991763Z f623a0c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f623a0cf69

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread openshell.spec
Summary: OpenShell MicroVM compute driver
# The embedded libkrunfw library and guest Linux kernel have separate licenses.
License: Apache-2.0 AND BSD-3-Clause AND CC0-1.0 AND CDLA-Permissive-2.0 AND GPL-2.0-only AND ISC AND LGPL-2.1-only AND MIT AND Unicode-3.0 AND Zlib
Requires: %{name}-gateway = %{version}-%{release}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Include the VM driver in release-asset upgrades

For Fedora/RHEL users who install this optional RPM from the published GitHub release assets, rerunning the supported install.sh flow for a later release becomes unsatisfiable: the installed old driver requires the old gateway exactly, while install_linux_rpm still downloads and passes only openshell, openshell-gateway, and openshell-prover (install.sh:1231-1266). With no repository supplying the matching new driver, the package transaction cannot replace the gateway, so include the matching driver RPM when it is already installed (or otherwise provide an atomic upgrade path).

Useful? React with 👍 / 👎.

Comment thread openshell.spec
# The embedded libkrunfw library and guest Linux kernel have separate licenses.
License: Apache-2.0 AND BSD-3-Clause AND CC0-1.0 AND CDLA-Permissive-2.0 AND GPL-2.0-only AND ISC AND LGPL-2.1-only AND MIT AND Unicode-3.0 AND Zlib
Requires: %{name}-gateway = %{version}-%{release}
Requires: e2fsprogs >= 1.43

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Declare the embedded runtime's glibc floor

On RHEL 8/glibc 2.28 hosts that the installation guide still says support Linux packages (docs/about/installation.mdx:102-105), this subpackage has no dependency for the current embedded libkrun runtime's GLIBC_2.34 floor. libkrun.so is compressed into the outer executable (crates/openshell-driver-vm/src/embedded_runtime.rs:25-30) and only dlopened when a VM boots (crates/openshell-driver-vm/src/ffi.rs:113-120), so RPM dependency generation and the new --version/startup smoke checks do not see that requirement; installation succeeds but the first sandbox fails to load libkrun. Build the embedded runtime to the documented 2.28 floor or declare the higher requirement and narrow the supported-host documentation.

AGENTS.md reference: AGENTS.md:L230-L230

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

packaging(rpm): ship openshell-driver-vm in the RPM packages

1 participant