Repository navigation
fix(snap): ship the VM compute driver - #2894
alexclewontin wants to merge 1 commit into
Conversation
The snap advertised the vm compute driver but never staged its binary, so selecting it crash-looped the gateway with "vm compute driver binary not found". Stage openshell-driver-vm and expose it at the conventional /usr/libexec/openshell path with a snapcraft layout symlink, and add the kvm plug the driver needs to reach /dev/kvm. Sandbox creation then failed while formatting the rootfs. core24 ships mke2fs, mkfs.ext4 and debugfs under /usr/sbin, but the snap AppArmor profile denies execve on base-snap sbin binaries: they resolve on PATH and then fail with EACCES, so a presence check cannot detect the problem. Vendor e2fsprogs into $SNAP/usr/sbin, which the snap PATH already prefers. Point build:rust:snap at the VM runtime directory. Without OPENSHELL_VM_RUNTIME_COMPRESSED_DIR the driver's build.rs embeds empty stub resources and exits 0, producing a binary that passes --version and only fails later at sandbox creation; add a precondition so a stub build fails loudly instead. Cover the packaging in release-canary so a future regression that drops the driver or breaks the layout is caught before publishing. Verified by packing the snap, installing it, and creating a VM sandbox end to end: the guest boots and exec returns from inside the microVM. Signed-off-by: Alex Lewontin <alex.lewontin@canonical.com>
|
This pull request has had no activity for 14 days and is now marked stale. It may be closed in 7 days if there is no further activity. |
keep this alive |
|
|
||
| The snap ships `openshell-driver-vm` at `/usr/libexec/openshell/openshell-driver-vm`, exposed | ||
| through a snapcraft `layout:` symlink. To enable it, set `compute_drivers = ["vm"]` in | ||
| `$SNAP_COMMON/gateway.toml`, then connect the `kvm` interface and restart the service: |
There was a problem hiding this comment.
How does setting this interact with OPENSHELL_COMPUTE_DRIVER, as in https://github.com/NVIDIA/OpenShell/pull/2250/files#diff-9f4438d00ff0b9f13896fd034278896ec94153fc2a5733b1852cbfce7ecaff77R450 ?
FWIW snapcraft.yaml never sets that variable by default, it seems it's just something which is currently in the release-canary.yml, though it is present for various packages (macos, kubernetes, fedora, ubuntu), and actually isn't present for the ubuntu-snap task at the moment.
elezar
left a comment
There was a problem hiding this comment.
The underlying packaging approach looks sound, but these items need to be addressed before merge:
-
Rebase and adapt this change to the current release artifact pipeline. Current
mainuses thebuild-vm-driverjob and rawopenshell-driver-vm-<triple>artifacts; retaining the olderbuild-driver-vm-linuxdependency anddriver-vm-linux-*download path would break the Snap build. Preserve the current Snap canary Docker sandbox exercise and add the VM layout assertion alongside it. -
Update the installation guidance for gateway schema version 2.
compute_drivers = ["vm"]is now rejected; the supported setting iscompute_driver = "vm". As written, an operator followingdocs/about/installation.mdxafter the required rebase would prevent the gateway from starting. -
Correct or substantiate the state persistence statement in
docs/about/installation.mdx:155-157. Snap documents revision-scopedSNAP_DATAandSNAP_USER_DATAas copied or snapshotted across refresh and revert operations, so saying the default state does not persist across refreshes is misleading without evidence specific to this daemon path.
Please also update .agents/skills/test-release-canary/SKILL.md to cover the new VM-driver assertion and fix the truncated /usr/libexec/openshell/openshe path in architecture/build.md:143.
GitHub currently reports the branch as conflicting, and Branch Checks plus Helm Lint have not completed, so the rebased result will need fresh CI validation.
BlockedGator is blocked because this branch conflicts with Thanks @elezar. I checked your maintainer review against the current PR metadata: GitHub confirms the branch is not mergeable, and the current head still needs the release artifact pipeline rebase, schema-v2 documentation correction, persistence wording correction or evidence, release-canary skill update, and truncated architecture path fix you identified. Next action: @alexclewontin, rebase onto current Gator metadata
|
|
This pull request has had no activity for 14 days and is now marked stale. |
Summary
The OpenShell snap never packaged it the vm compute driver binary, so selecting it crash-looped the gateway. This stages
openshell-driver-vmin the snap, exposes it at the conventional/usr/libexec/openshellpath via a snapcraftlayout:, and vendors thee2fsprogstooling the driver shells out to. A VM sandbox now boots from an installed snap.Related Issue
No issue required: localized packaging bug fix, and the diff plus verification below carries enough context to review the decision and implementation together.
Changes
snapcraft.yamlopenshell-driver-vmto$SNAP/usr/libexec/openshell/and add a top-levellayout:symlinking/usr/libexec/openshellonto it, so the gateway's existing search path resolves inside confinement with nodriver_dirpin.kvmplug to thegatewayapp so the driver can open/dev/kvm.e2fsprogspart staged into$SNAP/usr/sbin..github/workflows/snap-package.yml— download and stage thedriver-vm-linux-<arch>artifact; include the driver in the staging completeness check..github/workflows/release-dev.yml,release-tag.yml—build-snapnow depends onbuild-driver-vm-linux..github/workflows/release-canary.yml— assert the driver resolves at its layout path inside the installed snap.tasks/ci.toml— setOPENSHELL_VM_RUNTIME_COMPRESSED_DIRforbuild:rust:snapand fail loudly when the runtime is absent.docs/about/installation.mdx, runtime layout inarchitecture/build.md, packaging ande2fsprogsnotes incrates/openshell-driver-vm/README.md.Testing
mise run pre-commitpassesrelease-canaryassertion covers driver presence and layout resolution. Booting a microVM needs nested virtualization on the runner, which the canary environment does not provide.Manual end-to-end on Ubuntu 26.04, amd64, strict confinement:
--dangerous.meta/snap.yamlcarries thelayout:mapping andkvmin the gateway plugs;unsquashfsshows the driver atusr/libexec/openshell/openshell-driver-vm.test -f /usr/libexec/openshell/openshell-driver-vm(the exact checkresolve_compute_driver_binperforms) is true, and the binary executes through that path.nprocandMemTotalmatch the configuredvcpus = 2/mem_mib = 2048, confirming the VM came from the driver.Checklist