Repository navigation
ci(snap): build the snap in the snapcraft container instead of LXD - #5893
Merged
Merged
Conversation
The snap build launched an LXD instance, which first downloads its Ubuntu base image. That download can hang: a Release Dev run sat at "Creating new base instance from remote" for 49 minutes until it was cancelled, against the usual 3 to 6 minutes, and Pre-release builds the snap too. Build with Canonical's snapcraft image instead, on the same runners. It runs `snapcraft pack` on the container itself (SNAPCRAFT_BUILD_ENVIRONMENT=host), so no LXD or snapd setup is needed. The inputs are copied into a Docker volume, packed there, and the .snap and .comp files copied back out. Snapcraft's logs are bind-mounted to the workspace for the failure upload, which is now named per architecture. The pack step times out after 20 minutes. Refs #4554 Co-authored-by: Evan Lezar <elezar@nvidia.com> Signed-off-by: Simon Scatton <sscatton@nvidia.com>
7 of 9 tasks
alangou
approved these changes
Nov 23, 2026
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
The CI snap build no longer launches an LXD instance. It runs
snapcraft packin Canonical'sghcr.io/canonical/snapcraft:8_core24image, on the same runners. LXD first downloads an Ubuntu base image, and that step can hang: in Release Dev run 45155122631,Build snap (Linux amd64)sat at "Creating new base instance from remote" for 49 minutes until it was cancelled. The job normally takes 3–6 minutes. Pre-release builds the snap too, so a hang there blocks publishing.This supersedes the CI snap build part of #3795 and follows its approach from
tests/artifacts.nix. The tmachine snap scenario from #3795 is not carried over, and neither is itsgitstage-package;snapcraft.yamlis unchanged.Related Issue
Refs #4554
Changes
snapcraft packruns inghcr.io/canonical/snapcraft:8_core24, withdocker run --platform linux/<arch>on the native runner (ubuntu-24.04for amd64,ubuntu-24.04-armfor arm64). The image runs snapcraft withSNAPCRAFT_BUILD_ENVIRONMENT=host, so it builds on the container itself, without LXD or multipass, and without prompts.snapcraft.yamlandsnap/are copied read-only into a Docker volume. Snapcraft packs in the volume, and the.snapand.compfiles are copied back to the workspace and chowned to the runner user.8_core24has moved since test(tmachine): build and test local Snap packages #3795, so this pins the tag's current digest,sha256:f51fc508…(snapcraft 8.14.5). test(tmachine): build and test local Snap packages #3795's digest still resolves but is no longer the tag./root/.local/state/snapcraft/log, is bind-mounted tosnapcraft-logs/for the failure upload. The log artifact is now named per architecture, so the two matrix jobs don't collide.timeout-minutes: 20, so a hang fails fast.Testing
No PR check builds the snap.
snap-package.ymlis only called from Release Dev and Release Build, so I tested with a temporary workflow on this branch (since dropped). It took the binaries from thedevGitHub release and called the changedsnap-package.yml. Run: https://github.com/ai-openshell/openshell/actions/runs/45174868387openshell_0.1.10-dev.89-g83c0b675a_amd64.snap.openshell_0.1.10-dev.89-g83c0b675a_arm64.snap.Same output as LXD: the amd64 snap has the same 14 files as the LXD-built snap in the
devrelease, including the prover, the hooks and the stagedssh. Itsmeta/snap.yamldiffers only in the version.Failure behaviour, checked locally: a failed pack exits non-zero, and its log lands in the bind-mounted directory.
Lints:
actionlintreports only the existing shellcheck notes in the untouched "Capture snap filename" step, andzizmoronly the existingartipackedfinding.Checks appropriate to the affected code and behavior pass
Unit tests added/updated (if applicable)
E2E tests added/updated (if applicable)
Checklist