Skip to content

feat(snap): add snap install method to install.sh when available#2250

Open
olivercalder wants to merge 6 commits into
NVIDIA:mainfrom
olivercalder:feature/install-snap-default
Open

feat(snap): add snap install method to install.sh when available#2250
olivercalder wants to merge 6 commits into
NVIDIA:mainfrom
olivercalder:feature/install-snap-default

Conversation

@olivercalder

Copy link
Copy Markdown

Summary

Update install.sh to install the OpenShell snap package if snapd is available on the system and the required conditions are met. Also add the OPENSHELL_INSTALL_METHOD environment variable to force a particular install method rather than fall back to automatic system detection.

Related Issue

Based on: #1697 (picking up the work from @zyga)

Addresses: #1674

Changes

  • The install script detects the presence of snapd and if compatible conditions (docker snap) are met, installs the snap from the store.
  • Adds OPENSHELL_INSTALL_METHOD to override automatic detection
    • Supports deb, rpm, snap, and homebrew

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)

Checklist

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

zyga and others added 6 commits July 13, 2026 17:06
…ovisioning

Add snap install path to install.sh so that on Linux systems with snapd
available and no native Docker Engine installed, the installer chooses
the snap path. Snap is preferred when 'snap' command exists and
'snapd.socket' is active.

New functions:
- has_snapd(): detects snapd availability via snap command + snapd.socket
- has_native_docker(): pre-flight check for conflicting native Docker
- install_linux_snap(): installs openshell snap, Docker snap if missing,
  connects interfaces (best-effort), registers gateway via HTTP, verifies status
- register_local_gateway_snap(): gateway add with http:// URL (no mTLS)
- wait_for_local_gateway_listener_snap(): waits for HTTP listener

linux_package_method() returns 'snap' when snapd is available and no native
docker, respecting OPENSHELL_INSTALL_METHOD=classic override.

The installer handles the full flow: installing Docker snap if missing,
connecting all required interfaces, and registering the gateway.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Fix the snap gateway protocol from https to http to match what the
installer actually registers. Correct misleading claims that the
installer "exits with an error" and "refuses" snap installs on hosts
with native Docker — it silently falls back to classic.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
… backend

Add Spread integration tests for install.sh using the image-garden
backend to provision cloud VMs. The test suite covers three install
paths across Ubuntu 24.04/26.04, Debian 13, and Fedora 44:

  - install-snap-only: installs OpenShell as a snap on systems with
    snapd but no docker
  - install-classic: installs OpenShell via native packages (deb/rpm)
    on systems with docker (either with or without snapd)

Cloud-init instance templates in .image-garden.mk define the pre-
installed software per system variant. A .gitignore in .image-garden/
excludes generated disk images and VM artifacts.

Tests require image-garden snap, version 0.6 from the --candidate
channel.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
…e-garden backend"

This reverts commit d907412.

For now, do not add spread. We will consider adding it in the future as
a means to test openshell on a matrix of Linux systems.

Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
Adjust the wording of the installation docs for the `openshell` snap. In
particular, clarify when the snap will be installed, how it currently
requires the docker snap, and how to override the installation method.

Also, prune some of the manual interface connections, as these have
since been granted autoconnection via snap store assertions. See:

https://forum.snapcraft.io/t/please-update-snap-declaration-assertion-for-openshell/51762

Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
As @drew suggested, add `deb`, `rpm`, `snap`, and `homebrew` as
installation methods which the user can specify via
`OPENSHELL_INSTALL_METHOD` rather than falling back to detecting the
package manager automatically.

`homebrew` is not yet supported on Linux, and it is the only supported
option on MacOS.

Also adds a TODO to implement `install_linux_homebrew` in the future.

Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 13, 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.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

All contributors have signed the DCO ✍️ ✅
Posted by the DCO Assistant Lite bot.

@olivercalder

Copy link
Copy Markdown
Author

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

@olivercalder

Copy link
Copy Markdown
Author

recheck

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.

2 participants