Skip to content

Commit 239405c

Browse files
committed
feat(install): install the snap package by default when supported
- `install.sh` now selects snap when the `snap` command exists and `OPENSHELL_VERSION` is unset or `dev`. - Explicit `OPENSHELL_INSTALL_METHOD=snap|deb|rpm` still takes precedence. - Exact releases and prereleases continue to use native packages during automatic selection. - Docker-related snap errors now mention DEB/RPM overrides. - Installer selection tests cover default snap selection, native fallbacks, overrides, pinned releases, and prereleases. - Snap canary jobs no longer force `OPENSHELL_INSTALL_METHOD=snap`, so they test automatic selection. - Updated installation, VM driver, release canary, CI, and test guest documentation. - Fixed some leftover "Snap" language which should be "snap" Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
1 parent 61d4210 commit 239405c

9 files changed

Lines changed: 91 additions & 84 deletions

File tree

‎.agents/skills/test-release-canary/SKILL.md‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ The Release Canary (`.github/workflows/release-canary.yml`) smoke-tests the arti
1616
| `macos` | `macos-latest-xlarge` | Installs the dev Homebrew artifacts, reaches the VM gateway, and creates, executes in, and deletes a sandbox. |
1717
| `ubuntu-deb` | `ubuntu-latest` | Installs the dev Debian package, reaches the Docker gateway, and creates, executes in, and deletes a sandbox. |
1818
| `fedora` | `fedora:latest` container | Installs the dev RPM packages, reaches the Podman gateway, and creates, executes in, and deletes a sandbox. |
19-
| `ubuntu-snap-system-docker` | `ubuntu-latest` | Uses `install.sh` to install the snap from `latest/edge`, reuses system Docker, verifies the packaged prover version and a local policy boundary check, reaches the Docker gateway, creates, executes in, and deletes a sandbox, and verifies that the Docker snap is not installed. |
20-
| `ubuntu-snap-docker-preflight` | `ubuntu-latest` | Verifies that `install.sh` rejects the OpenShell Snap path when Docker is absent or supplied by the Docker snap, without installing OpenShell. |
19+
| `ubuntu-snap-system-docker` | `ubuntu-latest` | Verifies that `install.sh` selects the snap automatically when the `snap` command is available, installs it from `latest/edge`, reuses system Docker, verifies the packaged prover version and a local policy boundary check, reaches the Docker gateway, creates, executes in, and deletes a sandbox, and verifies that the Docker snap is not installed. |
20+
| `ubuntu-snap-docker-preflight` | `ubuntu-latest` | Verifies that automatic snap selection rejects installation when Docker is absent or supplied by the Docker snap, without installing OpenShell. |
2121
| `kubernetes` | `ubuntu-latest` + kind | Installs the dev Helm chart, reaches the in-cluster gateway, and creates, executes in, and deletes a sandbox using the published runtime images. |
2222

2323
All canary jobs disable anonymous OpenShell telemetry. Host package jobs inject
@@ -26,11 +26,13 @@ Kubernetes job installs with `server.telemetryEnabled=false`, so smoke traffic
2626
does not contribute to product usage metrics.
2727

2828
The workflow sets `OPENSHELL_VERSION=dev` for every `install.sh` job. Positive
29-
jobs consume the rolling dev release produced by the triggering workflow. The
30-
system-Docker Snap lane tracks `latest/edge`; the missing-Docker lane exits
31-
before installing a snap. The Debian and Kubernetes CLI lanes remove snapd so
32-
they continue to exercise the dev Debian package. Kubernetes pins the matching
33-
`0.0.0-dev` chart and `:dev` images.
29+
jobs consume the rolling dev release produced by the triggering workflow. Both
30+
snap lanes rely on the installed `snap` command to exercise automatic snap
31+
selection without setting `OPENSHELL_INSTALL_METHOD`. The system-Docker lane
32+
tracks `latest/edge`; the missing-Docker lane exits before installing a snap.
33+
The Debian and Kubernetes CLI lanes remove snapd so they continue to exercise
34+
the dev Debian package. Kubernetes pins the matching `0.0.0-dev` chart and
35+
`:dev` images.
3436

3537
RPM package installation also has tmachine conformance coverage in
3638
`Branch E2E Checks` (with `test:e2e`), `Release Dev`, and `Release Tag`. Those
@@ -141,10 +143,10 @@ Loopback registration auto-derives the gateway name to `openshell` if `--name` i
141143
| Symptom | Likely cause | Where to look |
142144
|---|---|---|
143145
| `macos`/`ubuntu-deb`/`fedora` job fails on `install.sh` | Dev release missing an asset, checksum mismatch, or `install.sh` regression on this branch. | Job log around the `curl … install.sh \| sh` step. |
144-
| Sandbox create or exec fails | Published sandbox and supervisor artifacts are missing, incompatible, or cannot establish the protected runtime channel. | Gateway logs plus Docker, Podman, VM, Snap, or Kubernetes runtime diagnostics for the job. |
146+
| Sandbox create or exec fails | Published sandbox and supervisor artifacts are missing, incompatible, or cannot establish the protected runtime channel. | Gateway logs plus Docker, Podman, VM, snap, or Kubernetes runtime diagnostics for the job. |
145147
| `macos`/`ubuntu-deb`/`fedora` job fails on `openshell status` | Local gateway service did not start (systemd/brew/podman). Often a driver issue. | Service logs in the job log; `OPENSHELL_COMPUTE_DRIVER` env in the "Ensure …" step. |
146148
| `ubuntu-snap-system-docker` fails during `install.sh` | System Docker was unavailable to the runner user, the edge revision or automatic interfaces were unavailable, or the user gateway did not become reachable. | Failure diagnostics dump system Docker, snap service/connection/change state, user and legacy gateway journals, snap logs, and port 17670 listeners. |
147-
| `ubuntu-snap-system-docker` fails during the prover checks | The prover artifact is missing or packaged for the wrong architecture, `openshell.prover` is not exposed or confined to read the test policies, or its solver linkage is not runnable. | The `Verify Snap installation` and `Check a policy boundary with the Snap prover` steps, plus `snap info openshell` and `snap connections openshell`. |
149+
| `ubuntu-snap-system-docker` fails during the prover checks | The prover artifact is missing or packaged for the wrong architecture, `openshell.prover` is not exposed or confined to read the test policies, or its solver linkage is not runnable. | The `Install and check status` and `Check a policy boundary with the snap prover` steps, plus `snap info openshell` and `snap connections openshell`. |
148150
| `ubuntu-snap-docker-preflight` unexpectedly succeeds | The installer no longer fails before installing the OpenShell snap when Docker is absent or supplied by the Docker snap. | Inspect `install.log`, `docker-snap.log`, `snap list`, and snapd changes. |
149151
| `kubernetes` job fails on `helm install --wait` | Chart did not deploy in 5 min — usually image pull failure or readiness probe failing. | "Diagnostics on failure" step dumps `helm status`, manifest, pod describe, pod logs. |
150152
| `kubernetes` job fails on `kubectl wait` | Gateway pod stuck `CrashLoopBackOff` or `ImagePullBackOff`. | Diagnostics dump; check `:dev` image existence at `ghcr.io/nvidia/openshell/gateway`. |

‎.github/workflows/release-canary.yml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,6 @@ jobs:
195195
name: Ubuntu Snap with system Docker
196196
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
197197
runs-on: ubuntu-latest
198-
env:
199-
OPENSHELL_INSTALL_METHOD: snap
200198
timeout-minutes: 20
201199
steps:
202200
- name: Install snapd
@@ -297,8 +295,6 @@ jobs:
297295
name: Ubuntu Snap Docker preflight
298296
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
299297
runs-on: ubuntu-latest
300-
env:
301-
OPENSHELL_INSTALL_METHOD: snap
302298
timeout-minutes: 20
303299
steps:
304300
- name: Install snapd

‎CI.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,9 @@ These workflows run after merge to publish dev/tagged artifacts and verify them.
541541
|---|---|
542542
| `.github/workflows/release-dev.yml` | Publishes the rolling `dev` build on every push to `main`. Builds gateway, sandbox, and supervisor images and binaries, packages, wheels, and pushes the Helm chart as `oci://ghcr.io/nvidia/openshell/helm-chart:0.0.0-dev` (plus an immutable `0.0.0-dev.<sha>` pin). Also dispatchable manually. |
543543
| `.github/workflows/release-tag.yml` | Publishes tagged stable releases and manually dispatched pre-releases. Its automatic tag trigger excludes `-pre.*`. Both require the currently implemented qualification profile to pass before publication; the summary identifies the remaining RFC 0014 coverage. Failed candidates retain build artifacts and evidence in Actions storage. Source-SHA OCI images remain available as qualification inputs. |
544-
| `.github/workflows/snap-package.yml` | Builds Snap and component artifacts for Release Dev and Release Tag without Store credentials or publication. |
545-
| `.github/workflows/snap-publish.yml` | Uploads existing Snap and component artifacts to the Store without rebuilding. Release Dev calls it directly for `latest/edge` after Snap builds and requires it to succeed before creating the dev release. Release Tag calls it for `latest/stable` only for stable releases, after qualification and release assembly succeed. |
546-
| `.github/workflows/release-canary.yml` | Smoke-tests published dev artifacts in the `macos`, `ubuntu-deb`, `ubuntu-snap-system-docker`, `fedora`, and `kubernetes` (kind + Helm) jobs. Each job reaches its gateway and creates, exercises, and deletes a sandbox. The `ubuntu-snap-system-docker` job verifies a compatible system Docker lifecycle, while `ubuntu-snap-docker-preflight` tests fail-fast behavior when Docker is absent or supplied by the Docker snap. The positive Snap lane also runs a local policy containment check with the packaged prover. It runs automatically after `Release Dev` succeeds and supports manual dispatch (`gh workflow run release-canary.yml --ref <branch>`). See the `test-release-canary` skill for the playbook and local kind reproduction. |
544+
| `.github/workflows/snap-package.yml` | Builds snap and component artifacts for Release Dev and Release Tag without Store credentials or publication. |
545+
| `.github/workflows/snap-publish.yml` | Uploads existing snap and component artifacts to the Store without rebuilding. Release Dev calls it directly for `latest/edge` after snap builds and requires it to succeed before creating the dev release. Release Tag calls it for `latest/stable` only for stable releases, after qualification and release assembly succeed. |
546+
| `.github/workflows/release-canary.yml` | Smoke-tests published dev artifacts in the `macos`, `ubuntu-deb`, `ubuntu-snap-system-docker`, `fedora`, and `kubernetes` (kind + Helm) jobs. Each job reaches its gateway and creates, exercises, and deletes a sandbox. The snap jobs verify that `install.sh` selects the snap automatically when the `snap` command is available. The `ubuntu-snap-system-docker` job verifies a compatible system Docker lifecycle, while `ubuntu-snap-docker-preflight` tests fail-fast behavior when Docker is absent or supplied by the Docker snap. The positive snap lane also runs a local policy containment check with the packaged prover. It runs automatically after `Release Dev` succeeds and supports manual dispatch (`gh workflow run release-canary.yml --ref <branch>`). See the `test-release-canary` skill for the playbook and local kind reproduction. |
547547

548548
## Required status contexts
549549

‎crates/openshell-driver-vm/README.md‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,14 +304,17 @@ create TAP devices or install nftables/iptables rules.
304304
`release-vm-kernel.yml`
305305
306306
On Debian-family Linux amd64 and arm64 systems, `install.sh` installs the
307-
Debian package from the selected `OPENSHELL_VERSION` release tag. That package
308-
includes `openshell-gateway` and `openshell-driver-vm`, but leaves
307+
Debian package when the `snap` command is unavailable, automatic selection
308+
receives an exact `OPENSHELL_VERSION` release tag, or
309+
`OPENSHELL_INSTALL_METHOD=deb` is set. That package includes
310+
`openshell-gateway` and `openshell-driver-vm`, but leaves
309311
`OPENSHELL_COMPUTE_DRIVER` unset so the gateway uses its normal runtime
310312
auto-detection. Set `OPENSHELL_COMPUTE_DRIVER=vm` to force the VM driver.
311313
312-
On RPM-family Linux x86_64 and aarch64 systems, `install.sh` installs the
313-
`openshell` and `openshell-gateway` RPM packages from the selected release tag.
314-
The RPM gateway package is configured for the Podman driver.
314+
On RPM-family Linux x86_64 and aarch64 systems, the equivalent native path
315+
installs the `openshell` and `openshell-gateway` RPM packages from the selected
316+
release tag. Select it explicitly with `OPENSHELL_INSTALL_METHOD=rpm`. The RPM
317+
gateway package is configured for the Podman driver.
315318
316319
On Apple Silicon macOS, `install.sh` stages the generated `openshell.rb`
317320
formula from the selected release in the `nvidia/openshell` Homebrew tap.

‎docs/about/installation.mdx‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ The gateway reads `~/.config/openshell/gateway.toml` if it exists, otherwise the
8686

8787
## Linux
8888

89-
The script installs a Debian package on Debian and Ubuntu or an RPM package on Fedora and RHEL. Set `OPENSHELL_INSTALL_METHOD=snap` to install the [Snap](#snap) package instead; hosts that already have the OpenShell snap keep refreshing it. Linux packages require glibc 2.28 or newer.
89+
When the `snap` command is available, the script installs the [snap](#snap) package for the latest stable release or the rolling `dev` release. Otherwise, it installs a Debian package on Debian and Ubuntu or RPM packages on Fedora and RHEL. During automatic selection, prereleases and explicit release tags use native packages so the installer can select the exact release artifacts. Explicit `OPENSHELL_INSTALL_METHOD=snap` supports only an unset version or `OPENSHELL_VERSION=dev`.
9090

91-
The gateway runs as a systemd user service at `https://127.0.0.1:17670` and reads `~/.config/openshell/gateway.toml`.
91+
Set `OPENSHELL_INSTALL_METHOD=deb` or `OPENSHELL_INSTALL_METHOD=rpm` to select a native package explicitly. Native Linux packages require glibc 2.28 or newer.
92+
93+
For Debian and RPM installations, the gateway runs as a systemd user service at `https://127.0.0.1:17670` and reads `~/.config/openshell/gateway.toml`.
9294

9395
Both Debian and RPM load `~/.config/openshell/gateway.env` for configuration
9496
preflight and gateway startup. Use it to select exact trusted runtime artifacts
@@ -119,9 +121,9 @@ sudo loginctl enable-linger $USER
119121

120122
## Snap
121123

122-
The snap requires Docker Engine installed from your distribution or Docker's package repository. The Docker snap is not compatible.
124+
The snap requires Docker Engine installed from your distribution or Docker's package repository. The Docker snap is not compatible. To use Podman or the VM driver instead, select a native package with `OPENSHELL_INSTALL_METHOD=deb` or `OPENSHELL_INSTALL_METHOD=rpm`.
123125

124-
The snap does not migrate existing Debian, RPM, or Homebrew installs. Remove any existing installation first, then either rerun the `install.sh` script with `OPENSHELL_INSTALL_METHOD=snap OPENSHELL_ACK_BREAKING_UPGRADE=1`, or install the snap directly:
126+
The snap does not migrate existing Debian, RPM, or Homebrew installs. If the script detects an existing native installation while selecting the snap, it stops before making changes. To update the existing native installation instead, rerun it with `OPENSHELL_INSTALL_METHOD=deb` or `OPENSHELL_INSTALL_METHOD=rpm`. To migrate, remove the existing installation after backing up any state you need, then rerun the script with `OPENSHELL_ACK_BREAKING_UPGRADE=1`, or install the snap directly:
125127

126128
```shell
127129
sudo snap install openshell
@@ -142,7 +144,7 @@ openshell status
142144

143145
Existing installations upgraded from the former `openshell.gateway` service retain their state under `/var/snap/openshell/common` through `openshell.system-gateway`. Existing HTTPS registrations continue to work because the endpoint and TLS identity do not change.
144146

145-
If this user still has an old HTTP registration, or has not previously been enrolled, wait for the system gateway to be active, copy its client credentials into the user's Snap state, and register its HTTPS endpoint:
147+
If this user still has an old HTTP registration, or has not previously been enrolled, wait for the system gateway to be active, copy its client credentials into the user's snap state, and register its HTTPS endpoint:
146148

147149
```shell
148150
snap services openshell.system-gateway
@@ -161,9 +163,9 @@ openshell gateway add https://127.0.0.1:17670 --local --name openshell
161163
openshell status
162164
```
163165

164-
Set `old_registration` to the name shown by `openshell gateway list`, and omit the variable assignment and `openshell gateway remove` when no registration exists. Older direct Snap instructions may have used `openshell-gateway`, while the install script uses `openshell`.
166+
Set `old_registration` to the name shown by `openshell gateway list`, and omit the variable assignment and `openshell gateway remove` when no registration exists. Older direct snap instructions may have used `openshell-gateway`, while the install script uses `openshell`.
165167

166-
### Change the Snap gateway mode
168+
### Change the snap gateway mode
167169

168170
The user and system gateways have separate configuration, databases, and cryptographic identities. Changing modes does not migrate gateway or sandbox state and interrupts active sandbox sessions. Back up any state you need and delete active sandboxes before changing modes.
169171

‎install.sh‎

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
#
55
# Install OpenShell from a GitHub release.
66
#
7-
# Linux installs either the Debian or RPM packages from the selected release.
7+
# Linux automatically installs the snap when the snap command is available and
8+
# the version is unset or dev; exact releases and prereleases use native packages.
89
# Apple Silicon macOS installs the generated Homebrew formula, so Homebrew owns
910
# the binary layout and launchd service lifecycle.
1011
#
@@ -63,19 +64,19 @@ ENVIRONMENT VARIABLES:
6364
pre-v0.0.37 or non-snap installation.
6465
OPENSHELL_INSTALL_METHOD
6566
Linux package to install: snap, deb, or rpm. Unset
66-
selects deb or rpm from the host package manager.
67+
selects snap when available, otherwise deb or rpm.
6768
6869
NOTES:
6970
When OPENSHELL_VERSION is unset, this resolves the latest tagged release
7071
from ${GITHUB_URL}/releases/latest.
7172
72-
Linux installs the Debian package on amd64/arm64 or the RPM packages on
73-
x86_64/aarch64, depending on the host package manager. Set
74-
OPENSHELL_INSTALL_METHOD=snap to install the OpenShell snap instead; hosts
75-
that already have the OpenShell snap keep refreshing it. Snap installs use
76-
latest/stable by default and latest/edge for dev, and do not support
77-
explicit release tags or prereleases. The OpenShell snap requires a running
78-
Docker Engine installed from a system package or Docker's package
73+
Linux installs the OpenShell snap when the snap command is available and
74+
OPENSHELL_VERSION is unset or dev. Snap installs use latest/stable by
75+
default and latest/edge for dev. Explicit release tags and prereleases use
76+
the Debian package on amd64/arm64 or the RPM packages on x86_64/aarch64,
77+
depending on the host package manager. Set OPENSHELL_INSTALL_METHOD=deb or
78+
rpm to select a native package explicitly. The OpenShell snap requires a
79+
running Docker Engine installed from a system package or Docker's package
7980
repository. The Docker snap is not currently compatible with OpenShell.
8081
macOS installs the release Homebrew formula on Apple Silicon and starts a
8182
brew services-backed local gateway.
@@ -668,11 +669,9 @@ linux_package_method() {
668669
*) error "unsupported OPENSHELL_INSTALL_METHOD=${OPENSHELL_INSTALL_METHOD}; use snap, deb, or rpm" ;;
669670
esac
670671

671-
# Keep refreshing an existing snap install instead of adding a second
672-
# gateway on the same port.
673672
case "${OPENSHELL_VERSION:-}" in
674673
'' | dev)
675-
if has_cmd snap && snap list openshell >/dev/null 2>&1; then
674+
if has_cmd snap; then
676675
echo "snap"
677676
return 0
678677
fi
@@ -1467,11 +1466,11 @@ install_linux_snap() {
14671466

14681467
if snap list docker >/dev/null 2>&1; then
14691468
error "the Docker snap is not currently compatible with OpenShell because its AppArmor confinement prevents OpenShell's hardened containers from starting.
1470-
Remove the Docker snap and install Docker Engine from a system package or Docker's package repository, then rerun this installer."
1469+
Remove the Docker snap and install Docker Engine from a system package or Docker's package repository, then rerun this installer. To use a native OpenShell package instead, set OPENSHELL_INSTALL_METHOD=deb or OPENSHELL_INSTALL_METHOD=rpm."
14711470
fi
14721471
if ! has_cmd docker; then
14731472
error "Docker is required before installing the OpenShell snap.
1474-
Install Docker Engine from a system package or Docker's package repository, then rerun this installer. The Docker snap is not currently compatible with OpenShell."
1473+
Install Docker Engine from a system package or Docker's package repository, then rerun this installer. The Docker snap is not currently compatible with OpenShell. To use a native OpenShell package instead, set OPENSHELL_INSTALL_METHOD=deb or OPENSHELL_INSTALL_METHOD=rpm."
14751474
fi
14761475
info "using existing Docker installation"
14771476
if [ "$_existing_mode" = user ]; then

0 commit comments

Comments
 (0)