Skip to content

test: resolve fallback templates from the linuxcontainers catalog - #25

Draft
MickLesk wants to merge 4 commits into
mainfrom
test/linuxcontainers-full-catalog
Draft

test: resolve fallback templates from the linuxcontainers catalog#25
MickLesk wants to merge 4 commits into
mainfrom
test/linuxcontainers-full-catalog

Conversation

@MickLesk

@MickLesk MickLesk commented Sep 4, 2026

Copy link
Copy Markdown
Member

Spike, not for merge as-is. Builds on #23.

The linuxcontainers fallback only knew what arm64_template_variant() hardcoded — debian 12/13, ubuntu 24.04/26.04, alpine — and built a legacy Jenkins URL. This resolves against the simplestreams index instead, the same source Incus uses. The index carries aliases (debian/13trixie), so the mapping table is deleted rather than extended.

That opens up 22 distributions and 42 arm64 images, against 2 arm64 templates in a live pveam catalog. Only reached when Proxmox has nothing, so amd64 is unchanged for anything it ships.

Open questions before this is more than a spike: it needs jq and installs it when missing; these images carry no Proxmox metadata; and everything outside pveam is ours to support.

Every ARM64 container took the custom-template path, so pveam was never
consulted on that architecture. For Debian that path resolved its URL from
community-scripts/debian-arm64-lxc, a repository that does not exist: the
releases endpoint answers 404, so ARM64 Debian could not be created at all
through the split core.

Template lookup now runs the same way on both architectures. Local templates
first, then the catalog, both matched on OS, version and exact architecture.
Only when Proxmox has nothing does the linuxcontainers.org build step in, which
is still the only source for Ubuntu, Fedora and the rest on ARM64.

Against a live catalog this routes debian 13 and alpine 3.24 through pveam on
ARM64 -- Proxmox ships both -- while debian 12, ubuntu and fedora keep the
old path. A local template short-circuits before any catalog read.

The interactive "pick another version" fallback filtered by name only. On a
host whose catalog carries both architectures, which is now the normal case,
it could offer an amd64 template to an ARM64 host and fail later at creation.

Supersedes the Debian-only routing in #5.
Image resolution tried up to six images: candidates over the network before
looking at what was already copied locally, so an image on disk still cost
round-trips and resolution failed outright on a host without internet.

The local match was also a substring search over the whole CSV row: asking for
debian/12 matched a debian/13 row uploaded on 2026/12/01, because the row
contains "debian" and the date contains "12". That launched the wrong release
with no error. It now compares the alias field whole.
The fallback only knew what arm64_template_variant() hardcoded: debian 12/13,
ubuntu 24.04/26.04, alpine. Everything else exited 225, and the Jenkins URL it
built is a legacy endpoint.

Resolves against the simplestreams index instead, which is what Incus already
uses. The index carries aliases (debian/13 -> trixie), so the mapping table is
gone rather than extended.

Opens up 22 distributions and 42 arm64 images against 2 arm64 templates in a
live pveam catalog: almalinux, alt, amazonlinux, archlinux, busybox, centos,
devuan, kali, mint, nixos, openeuler, opensuse, openwrt, oracle, plamo,
rockylinux, slackware, voidlinux and the four already covered.

Only reached when pveam has nothing, so amd64 behaviour is unchanged for
anything Proxmox ships. Needs jq and installs it when missing.

Verified against the live catalog: lookup returns correct paths for debian,
ubuntu, alpine, rockylinux, fedora, archlinux and voidlinux, refuses unknown
releases, and the resulting URLs are real tarballs (debian trixie arm64 86 MB,
rockylinux 9 arm64 99 MB). Not run on a Proxmox host.
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Try this branch

The engine and the scripts resolve independently, so a production script can
be run against the engine from this PR by setting one variable:

COMMUNITY_SCRIPTS_CORE_URL=https://raw.githubusercontent.com/community-scripts/core/test/linuxcontainers-full-catalog \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/ct/debian.sh)"

Swap ct/debian.sh for whatever exercises the change.

This PR touches both backends. Worth running on a Proxmox VE and an Incus host.

Run a script from a fork as well
curl -fsSL https://raw.githubusercontent.com/community-scripts/core/test/linuxcontainers-full-catalog/tools/run.sh |
  bash -s -- https://raw.githubusercontent.com/YOU/ProxmoxVED/your-branch ct/debian.sh \
             https://raw.githubusercontent.com/community-scripts/core/test/linuxcontainers-full-catalog

Note that run.sh is reached through a pipe, so the script it starts inherits
an exhausted stdin. Whiptail is fine — it opens /dev/tty — but a plain read
would see EOF. The single-variable form above does not have that problem.

Useful flags while testing

dev_mode=net logs every engine fetch with status and duration, which is the
quickest way to confirm the branch is really being used. dev_mode=keep stops a
failed build from deleting the container along with the evidence.

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.

1 participant