feat(snap): add snap install method to install.sh when available#2250
Open
olivercalder wants to merge 6 commits into
Open
feat(snap): add snap install method to install.sh when available#2250olivercalder wants to merge 6 commits into
snap install method to install.sh when available#2250olivercalder wants to merge 6 commits into
Conversation
…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>
|
All contributors have signed the DCO ✍️ ✅ |
Author
|
I have read the DCO document and I hereby sign the DCO. |
Author
|
recheck |
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Update
install.shto install the OpenShellsnappackage if snapd is available on the system and the required conditions are met. Also add theOPENSHELL_INSTALL_METHODenvironment 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
snapdand if compatible conditions (dockersnap) are met, installs the snap from the store.OPENSHELL_INSTALL_METHODto override automatic detectiondeb,rpm,snap, andhomebrewTesting
mise run pre-commitpassesChecklist