065 - Shared stack caches and release after rescue¶
User Story¶
As an operator who runs several compose slots, swarm lab clusters and GUI lanes on one host, I want repeated package and tool downloads to land in one shared host cache folder and every swarm or roundtrip run to release its cluster once the rescue bundle is saved, so that parallel stacks stop filling the root filesystem.
Acceptance Criteria¶
[ ]
make dotenvwritesINFINITO_CACHE_SHARED_HOST_PATH=<DIR_CACHE>/sharedunless the environment orcustom.envsets another path.[ ] With the cache stack enabled and
INFINITO_CACHE_SHARED_HOST_PATHset,docker compose configof a compose slot shows that folder bind-mounted read-write at the same path into theinfinitoservice, withPIP_CACHE_DIRandnpm_config_cachepointing below it.[ ] With
INFINITO_CACHE_SHARED_HOST_PATHset, renderingcompose/swarm/compose.ymlwithcompose/swarm/cache.override.ymlandcompose/swarm/shared-cache.override.ymlshows the same read-write bind on the manager, both workers, the NFS server and the backup host.[ ] With
INFINITO_CACHE_SHARED_HOST_PATHandINFINITO_CACHE_HOST_PACMAN_PATHempty or missing from.env, a compose slot renders and starts without the cache mounts and the cache environment, anddocker compose configof its services is byte-identical to the render of the same.envbefore this change.[ ]
make dotenvwrites the host’s pacman cache directory toINFINITO_CACHE_HOST_PACMAN_PATHonly when the host’s/etc/os-releaseIDis exactlyarchand the stack runs arch; on Manjaro and every other host or stack the value is empty and pacman uses the shared folder alone.[ ] With
INFINITO_CACHE_HOST_PACMAN_PATHandINFINITO_CACHE_SHARED_HOST_PATHset, the rendered compose slot and every rendered swarm lab node mount the host pacman cache read-only at the same path.[ ]
scripts/docker/cache/pacman.shrewrites[options]of apacman.confso that the read-only host cache is the firstCacheDir, the node’s own download directory<shared>/pacman/node-XXXXXX/the second and<shared>/pacman/the third, gives two nodes on one shared folder different download directories, removes every otherCacheDirline, writes aPostTransactionhook that renames finished downloads from the node download directory into<shared>/pacman/, gives the same result when run twice, and leaves a system withoutpacman.confuntouched.[ ]
make compose-upand the swarm node bootstrap run that script in every arch runner and arch lab node that mounts the shared folder.[ ] A package pacman downloads on an arch runner or lab node lands in
<shared>/pacman/once its transaction completes, two nodes that download the same package at the same time never write the same file, and the host cache directory stays byte-identical.[ ] apt and dnf keep their per-container caches and reach the package cache proxies as before;
docs/contributing/environment/cache.mdstates this next to the folder layout.[ ]
docs/contributing/environment/cache.mddocuments the folder layout, both variables and the mount contract a GUI lane follows.[ ] Images keep reaching every inner daemon through
infinito-registry-cache; no compose file shares a docker data root between daemons.[ ]
make swarm-zombiewithoutkeep=truecopies the act job’s rescue diagnostics and Playwright artefacts to the same paths on the host and then removes the lab nodes, the lab network, the NFS export volume and the act outer container, on success and on failure.[ ]
make swarm-zombie keep=truecopies the same artefacts and leaves the cluster and the act outer container up.[ ] When the artefact copy fails, the lab nodes are still removed, the act outer container stays, and the run exits non-zero naming
make swarm-down.[ ]
make roundtriphandskeepto every swarm step, so a failed swarm step releases its cluster the same way a green one does.[ ]
make clean-cacheremoves the shared cache folder.[ ] The disc-space cleanup cleans only pacman cache directories it can write, so a read-only host cache layer cannot fail it.
[ ]
INFINITO_DISTROresolves exactly as before this change; deriving the default distro from the host ships as a separate follow-up.[ ] Every changed logic has one unit test, and each of these tests fails on the code before this change.