Files
a5b414b7fb feat(backends): run container backends through ContainerManager, starting with llamacpp:nathanw (#3709)
* feat(backends): run container backends through ContainerManager, starting with llamacpp:nathanw

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(containers): list every missing setup step and ask for consent at install

Container setup now reports what a user still has to do in one pass,
in the order they do it, and the CLI finishes the install once only
consent is left.

- Setup checks run in two groups. Before consent: the container tool
  on PATH, then the video/render groups (or the Docker socket), then
  enable_containers. These read only PATH, groups and sockets, so no
  container command runs before the user opts in; Podman counts as
  rootful when CONTAINER_HOST is set or lemond runs as root, until
  podman info answers. After consent: podman info, then SELinux.
- Every failed check is reported at once. /system-info gives one
  problem per line in message, numbered steps in action (install
  commands, group changes, enable_containers, and logging out last),
  and the failed checks' ids in setup_checks.
- lemonade backends prints message and action lines side by side.
- lemonade backends install, run and load check the backend's setup
  before installing or downloading anything. When enable_containers
  is the only step left, they show the existing warning, enable it on
  yes and finish the command; backends install --yes skips the prompt.
  Otherwise they print every problem and step and exit 1.
- The spec, user guide, CLI and API docs follow the new order and
  fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* fix(cli): read the selected backend only when recipe options were given

lemonade run and load without a --<recipe> option have no recipe
options, and reading the backend option from them aborted the CLI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* style(containers): trim the setup comments the comment-slop hook flagged

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V3HB9nm64VVxScERksHiia

* ci(containers): gate the container smoke test like the other hosted test jobs

The signing and release-branch skips exist to spare self-hosted runners;
the smoke test runs on ubuntu-latest.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci(containers): pin the container smoke test to Ubuntu 24.04

The job installs the 24.04 .deb on the bare runner, and ubuntu-latest moves
to 26.04 in November 2026, where libmbedcrypto7t64 does not exist. The
comments now say why the job runs on the bare runner and needs the PPA.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): assert lemond's mode in the smoke test and log at debug

test_03 now checks the published port on lemond's container, so each leg
proves lemond detected the intended mode, not only that the tool runs in it.
LEMONADE_CI_MODE puts llama-server's output in the uploaded logs, as in the
other jobs that start lemond.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci: say why backends-gate also lists jobs that run on every PR

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): cut the container spec changes back to what the implementation made false

Keeps the opt-in invariants (off by default, install and load refused while
off, no container command before opt-in), rootful Podman's connection path,
the Podman answers check, and reporting every failed check at once. Drops
setup_checks, action ordering, CLI prompting, and the expect_rootless detail.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): name the enable warning instead of quoting it

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(llamacpp): list nathanw as a guest backend, as its descriptor declares

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(cli): word the enable_containers prompts as enabling containers, not backends

The setting enables every container, whatever its tier, so the warning no
longer calls the images community-built.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(backends): drop the image allowlist comment from ContainerPolicy

ContainerManager::allowed_image is the allowlist; the comment restated it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* refactor(containers): leave GPU selection and the SELinux check to the first ROCm container backend

llamacpp:nathanw maps only /dev/dri, so nothing here reached the
HIP_VISIBLE_DEVICES lookup or the SELinux check, both gated on /dev/kfd.
needs_gfx1151_cwsr_fix goes back to its own KFD read.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): drop checks that restate code, and mount single files only

The directory mounts serve Halogen's tokenizer and move to that PR; here
every model file llamacpp names is a GGUF.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): take the smoke test's backend as --backend

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): leave Podman and Docker alone while enable_containers is false

With containers disabled, lemond no longer sweeps at startup, connects to
the Docker socket, runs `image inspect`, or removes images on uninstall.
Setting enable_containers to false unloads every model running in a
container first, so none is left that a later crash would orphan.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015BUXEd42tPQH67MQPW1XZh

* Update to a modern pin

* refactor(containers): drop the startup sweep

A killed lemond's containers already stop and remove themselves: the
attached `run --rm` child gets SIGTERM from PR_SET_PDEATHSIG and proxies it
into the container. Verified with Docker and rootful/rootless Podman. The
smoke test now kills lemond with a model loaded and checks no container
remains.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* docs(load): list nathanw among the llamacpp_backend choices

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* ci(containers): cap the Dispatch container job at 45 minutes

A hung job would otherwise hold a pool machine for up to 4 hours.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* test(containers): skip the killed-lemond check under rootful Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LcAshvLHhLPAw6Ka6CJXwC

* docs(containers): link container images to their registry pages

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): skip the killed-lemond check under rootful Docker too

The Docker daemon owns the container, so whether it stops after lemond is
killed depends on the docker client forwarding SIGTERM in time, which is
racy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5SJqLuAuPwGaJQvWTwMai

* refactor(containers): drop the enable_containers setting

Container backends no longer need an opt-in before they install or
load. The setup assistant's remaining checks still report what is
missing.

- Remove the config key, its validation, getter and config effect.
- Remove the CLI consent prompt and pre-flight check, and the --yes
  flags on `config set` and `backends install` that only served it.
- Always check the Docker socket, read the image on disk for installed
  state, and remove the image on uninstall.
- Remove helpers left unused: containers_enabled,
  Router::get_container_model_names, WrappedServer::runs_in_container,
  ServerProcess::in_container.
- Update the spec, guides, generated API docs, tests and CI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* perf(containers): run container setup checks once per system-info build

The checks are host-wide, so every container backend got the same
report while each one ran them again, `podman info` included. Drop the
unused recipe and backend parameters from container_setup_failure and
compute its report at most once per pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* test(containers): fail when listing labeled containers or networks fails

A failed `ps` or `network ls` printed nothing, so the checks that expect
no leftovers passed without listing anything.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cGBZamSKYLVeygD6axiu9

* ci(containers): restore the Dispatch container job's 4-hour timeout

Four ds4 jobs downloading DS4's 81 GB checkpoint at once on fresh Dispatch
machines each ran past 45 minutes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(containers): run container backends from lemond.service with rootless Podman

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): create Podman networks without a DNS server

Every model load failed under lemond.service with Podman 5 (Fedora 43/44,
Ubuntu 26.04, Debian 13):

  netavark: error while applying dns entries: aardvark-dns failed to start:
  Failed to connect to user scope bus via local transport

`podman network create` turns DNS on by default, and rootless netavark
(1.14 and later) starts aardvark-dns with `systemd-run --scope --user`, which
needs the account's systemd user manager. The lemonade system account has no
login session, so it has none.

Each per-model network holds one container, and lemond reaches it through
its published port or inspected address, never by name, so the network
needs no DNS server. Docker has no such option and is unaffected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): let rootless Podman keep its runtime state in the host's /tmp

Every model load failed under lemond.service on Ubuntu 26.04 and Debian 13:

  Error: setting up Pasta: pasta failed with exit code 1: Couldn't open PID
  file /run/lemonade/containers/networks/rootless-netns/rootless-netns-conn.pid:
  Permission denied

Podman 5 sets up rootless networking with pasta, under $XDG_RUNTIME_DIR, which
the unit set to /run/lemonade. The AppArmor profile Ubuntu and Debian ship for
pasta allows writes only under /tmp, /run/user/<uid> and home directories under
/home, so it denied the PID file. ProtectHome=yes hides /run/user, and the
account has no login session to create /run/user/<uid> in any case.

With XDG_RUNTIME_DIR unset, Podman uses its own fallback in /tmp
(/tmp/storage-run-<uid>, or /tmp/containers-user-<uid> on Podman 4), which the
profile allows and Podman's own tmpfiles.d exempts from age-based cleanup.
lemond's own runtime directory stays /run/lemonade, through RuntimeDirectory=.

PrivateTmp goes with it. In a private /tmp, `podman` run as lemonade from a
shell finds no runtime state, and Podman 5 then refreshes the shared database:
the running container drops out of lemond's view, `podman stop` reports no such
container, and the engine keeps holding the GPU until the service stops.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(debian): create /var/lib/cni at install

On Ubuntu 24.04, every model load under lemond.service failed until the host
next rebooted:

  Error: unable to find network with name or ID lemonade-<...>: network not found

Podman 4's rootless network namespace bind-mounts a private directory over
/var/lib/cni, or, while that does not exist, over its nearest existing parent,
/var/lib. That mount hid /var/lib/lemonade, the lemonade account's home, which
holds its Podman storage and network configs, so `podman run` found no network
that `podman network create` had just made. Podman's own tmpfiles.d creates
/var/lib/cni only at boot (`D!`), so a fresh install hit this until a reboot.

The package now ships the directory in tmpfiles.d, which dh_installtmpfiles
applies at install. The .rpm keeps lemonade's home in /opt, and Podman 5 makes
no such mount, so neither needs it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): keep DNS on rootful Podman's per-model networks

Podman 4's CNI backend gives an --internal network created with
--disable-dns no gateway, so the host has no route to the container and
rootful lemond, which connects at the container's address, waited on
llama-server until the test timed out. Only rootless Podman needs DNS
off, and it reaches the container through a published port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app): show container setup steps in a collapsible section

The Setup guide button passed `action` to window.open, but lemond's
`action` holds a command, steps, or a link. A non-link action now shows
as a "Setup required" disclosure with the failure message and steps,
regardless of the technical-details toggle; links keep the button.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): check GPU device access instead of video/render membership

Desktop distros such as Ubuntu and Arch grant the logged-in account
/dev/kfd and /dev/dri access through ACLs, so an account outside video
and render could use the GPU yet was told to fix its groups. The setup
check now tests read/write access to /dev/kfd and each render node.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): ask Podman its mode before the host check

container_setup_failure() ran check_host() before check_podman(), so the
first pass after startup guessed rootless and could report a GPU access
failure on rootful Podman that the next pass cleared.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): check Docker with docker info instead of a fixed socket

The socket probe only looked at /var/run/docker.sock, so DOCKER_HOST,
Docker contexts and Docker Desktop's socket read as a refused account.
docker info follows the CLI's own connection, and its answer also
identifies Docker Desktop and rootless Docker, which cannot run
container backends, so those now get Podman as the fix step. The spec's
device-node rows now describe the access check instead of group
membership.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(lemond.service): keep PrivateTmp and give Podman's private /tmp state to tmpfiles.d

04919f697 turned PrivateTmp off for every lemond.service user, containers or
not, raising systemd-analyze security exposure from 8.5 to 8.7. Its reason was
`podman` run as lemonade from a shell: in the host's /tmp it finds none of the
service's runtime state, and Podman 5 then refreshes the shared database, so
lemond loses track of its running containers.

PrivateTmp=yes is back. XDG_RUNTIME_DIR stays unset, so rootless Podman still
keeps its runtime state in its own fallback in /tmp, which pasta's AppArmor
profile allows; under PrivateTmp that is the service's private /tmp.

Podman's own tmpfiles.d exempts its fallback only in the host's /tmp, and
age-based cleanup of /tmp reaches into the service's private one, so a new
tmpfiles.d entry exempts that instead. The .rpm installs it under /opt with a
link in /usr/lib/tmpfiles.d, like the unit, and applies it in %post;
dh_installtmpfiles applies it for the .deb.

The guide gives the command that runs Podman in the service's /tmp, through
JoinsNamespaceOf=lemond.service, in place of a plain `sudo -u lemonade podman`.
It uses --pty: SELinux on Fedora 44 denies dbus-broker the caller's pipes
that --pipe passes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): escape container names so distinct models never share one

name_token() mapped every rejected character to `-`, so `user.foo/bar`,
`user.foo bar` and `user.foo-bar` shared a container and network name,
and starting one removed the other. Rejected characters now become `_`
plus two hex digits and `_` is doubled, so the mapping is one-to-one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(containers): return a failed result for an empty command

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(containers): explain how Lemonade chooses Podman or Docker, with service steps for rootful Podman and Docker

The guide said only that Lemonade uses Podman when installed and Docker
otherwise. It now lists when each engine runs (rootless Podman by default,
rootful through CONTAINER_HOST or a root lemond, Docker without Podman) and
that rootful Podman and Docker are root-equivalent.

Its Docker step for lemond.service did nothing: the packages pull in Podman,
which takes precedence, so it now removes Podman first. Rootful Podman under
lemond.service had no steps, and root's socket is closed to lemonade, so the
guide gives a dedicated socket and service for lemonade that leave root's
podman.socket untouched. User-mode lemond shares the user's own Podman and
follows the CONTAINER_HOST its environment sets, which the guide now says.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): require lemonade's subordinate IDs only for local rootless Podman

With CONTAINER_HOST pointing at root's Podman socket, as the guide's rootful
setup does, check_podman() still demanded subordinate UID and GID ranges for
lemonade and reported subordinate_ids when they were missing. Root's Podman
maps container IDs onto its own ranges and never uses lemonade's, so the check
blocked a working rootful setup on hosts where lemonade has no ranges.

The check now runs only when Podman is local and rootless, the same condition
check_host() already applies to the device-group checks.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): report rootful Podman on CNI instead of timing out

Rootful lemond connects at the container's address, and Podman 4's CNI
backend gives an --internal network no gateway on the host, with DNS on or
off. A model load therefore waited out the whole startup timeout (8 minutes
on Ubuntu 24.04 with Podman 4.9.3) and failed with "llama-server failed to
start". Publishing a port does not help: rootful Podman does not forward a
port published on 127.0.0.1 into an internal network on either backend.

check_podman() now reads the network backend in the same `podman info` call
that reports rootless mode, and reports rootful_cni with the way back to
rootless Podman: remove CONTAINER_HOST from /etc/default/lemond (service),
unset it (user mode), or run lemond as a regular account (root). The guide
names switching root's Podman to netavark as well, and warns that the
`podman system reset` it needs deletes all of root's containers and images.
Rootless Podman publishes a port and works on CNI, and rootful Podman on
netavark keeps working, so neither is affected.

The create_network comment named CNI for netavark's behavior, now corrected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(containers): explain the rootless port vs rootful address once

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(containers): keep the runner's persistent Hugging Face cache

Devlab Dispatch runners set HF_HOME to a cache on their scratch disk that
survives the job. Pointing it at RUNNER_TEMP downloaded every model on
every run, 70 minutes for DS4's 87 GB checkpoint.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(debian): keep the postinst chown out of Podman's storage and off symlinks

The postinst re-owns /var/lib/lemonade on every install with
`find ... -exec chown lemonade:lemonade`. Rootless Podman now keeps the
service's image storage in that home under .local/share/containers, so
the walk entered every image layer. Plain chown follows symlinks, and
layers are full of absolute ones (/bin/sh -> /usr/bin/busybox), so root
re-owned the host's files: reinstalling the same .deb on Ubuntu 24.04
after pulling two images handed /run, /run/lock, /etc/ssl/certs,
/usr/bin/busybox and 13 other host files to lemonade. The walk also
flattened the layers' subordinate-ID owners and cleared their setuid
bits, so `su` in an ubuntu image lost setuid.

Prune Podman's storage, which lemonade already owns and Podman manages,
and use chown -h so a symlink anywhere in the home is re-owned itself
instead of its target. The chown -R this walk replaced in #3393 never
followed symlinks, so -h restores that.

Tested on a fresh Ubuntu 24.04 VM: after the reinstall no host file
changes owner, the layers keep their 5 sub-UID files and 8 setuid files,
and a root-owned file in ~/.config is still re-owned to lemonade.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(nathanw): pin the 2026-10-25 vulkan-radv-performance image

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(nathanw): default to 2048-token batches

llama-server's 512-token ubatch held the Vulkan performance fork well
below its author's published prefill. At 2048, which the author measures
and recommends for MoE models, Qwen3.6-35B-A3B prefills at 1625 tok/s at
4k and 1909 at 32k (from 1373 and 1531) and Qwen3.8-Flash-Next at 717
and 909 (from 580 and 689), with decode unchanged. A user's own -b or
-ub still wins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(packaging): recommend Podman only when Docker is missing

Recommends: podman installed Podman alongside an existing Docker, and since
Podman takes precedence when both are on PATH, Docker users had to remove it
again. The .deb now recommends podman | docker.io | docker-ce, and the .rpm
(podman or docker or docker-ce), so an installed Docker satisfies it. On
Fedora, moby-engine provides docker; Docker's own docker-ce does not.

The .rpm's recommendation also never reached the package on Fedora 43:
CPack before CMake 4.1 ignores CPACK_RPM_PACKAGE_RECOMMENDS, so the tag goes
into the spec preamble through CPACK_RPM_SPEC_MORE_DEFINE instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(packaging): warn when lemonade's subordinate ID range can't be allocated

The postinsts ignored a failed usermod --add-subuids/--add-subgids with
|| true, so the only sign was usermod's own error, with nothing tying it to
container backends. They now say what the failure breaks. It still doesn't
fail the install, since only container backends need the range.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): grant GPU access through render alone

Of the nodes a container backend opens, video owns only /dev/dri/card*, the
display node; /dev/kfd and the renderD* nodes belong to render. On a Strix
Halo host, nathanw ran inference on the GPU at the same speed as the
lemonade account with only render, where it could not open card1, as with
video and render, and with no card1 in the container at all. So the
packages add lemonade to render only, as they did before container
backends, and the setup steps and Docker's --group-add ask for render alone.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(lemond.service): run without PrivateTmp so Podman's state stays in the host's /tmp

With PrivateTmp, rootless Podman's runtime state sat in the service's private
/tmp, which took three workarounds: a tmpfiles.d entry to keep age-based
cleanup out of it, packaging to install that entry, and a systemd-run
JoinsNamespaceOf= command in the guide, because a plain
`sudo -u lemonade podman` saw an empty /tmp and Podman 5 then reset the state
of the containers lemond was running.

In the host's /tmp, Podman's own tmpfiles.d already protects that state and
plain `podman` sees it, so the workarounds go. The cost is the private /tmp,
a small step next to the NoNewPrivileges and RestrictNamespaces rootless
Podman already needs off.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(backends): keep the previous container image until the new pin is committed

Stage version.txt in a sibling directory, check the write, then swap it
into place. The previous image is removed only after the swap succeeds,
so a failed directory creation or marker write no longer leaves a
working backend without its image.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(packaging): allocate subordinate IDs when nsswitch.conf says subid: files

subid: files means the local /etc/subuid and /etc/subgid, so only a
subid: line naming another source (sss, ldap, ...) is left to the
administrator.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(containers): include the lemond port in container names

Two lemond instances on one container daemon loading the same model
produced the same name, and start() removes that name unconditionally,
so the second instance killed the first one's container. The name is
now lemonade-<port>-<recipe>-<backend>-<model>, still stable per
instance so a load clears that instance's own crash leftovers, and the
container carries an ai.lemonade.instance label.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* refactor(containers): trim the install staging and drop the unused instance label

The staging directory is hidden and cleared at the start of the next
install, so the failure paths no longer clean it up. The port in the
container name already keeps instances apart, so the ai.lemonade.instance
label is dropped until something filters on it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB6RM2hfmfgheR7KvsP

* fix(lemond-user.service): keep the sandbox and run containers through podman.socket

In a user manager, every sandboxing option the unit had on main takes away
something rootless Podman needs: the seccomp-based ones set no-new-privileges,
which stops the setuid newuidmap/newgidmap helpers, and PrivateTmp and
ProtectSystem confine the service to a user namespace that maps only the
user's own UID. So the unit had dropped them all.

The unit now keeps them and sets CONTAINER_HOST to the user's podman.socket.
`podman` in the unit only sends requests to Podman's API service, which
systemd starts outside the unit, and that service creates the containers.
lemond treats a socket in the account's own runtime directory as rootless
Podman, and passes the crun annotation run.oci.keep_original_groups=1 there,
since the Podman API rejects --group-add keep-groups.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(containers): require crun for rootless Podman and recommend it

Rootless containers reach the GPU through the account's render group, which
--group-add keep-groups (and its run.oci.keep_original_groups annotation)
carries into the container. Only crun supports that; runc always resets a
container's supplementary groups, so under runc the engine cannot open the
render node and silently runs on the CPU, about 14x slower on nathanw.

Podman installs crun by default, but on Debian and Ubuntu a host that had
docker.io first already has runc, which satisfies Podman's crun | runc
dependency. The Podman setup check now reads the OCI runtime from
`podman info` and, for rootless Podman on anything but crun, asks for the
host's install command for crun. That answer is not cached, so installing
crun takes effect without restarting lemond. The .deb and .rpm also
recommend crun.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(spec): give the podman.socket and CONTAINER_HOST steps for a failing podman info

The setup check's step for a failing `podman info` depends on CONTAINER_HOST
since the user unit moved to podman.socket; the spec's tables still gave
only the generic step.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(containers): expect the lemond port in container names

8e03e4d renamed containers to lemonade-<port>-<recipe>-<backend>-<model>,
but the smoke test still asserted the old lemonade-<recipe>-<backend>-
prefix, failing test_03_load_and_chat on docker and both podman modes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LdWSB7BgnHh2Hv3FiEwQHz

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Co-authored-by: Sawan Srivastava <[email protected]>
2026-11-03 15:45:14 +00:00
..