From c0839c0fea74fb27e4322854ff6b7d601e284c3a Mon Sep 17 00:00:00 2001 From: CJ Rivas Date: Thu, 26 Nov 2026 01:08:45 -0500 Subject: [PATCH] WZ: Skip non-media projects and lay the fleet out 3 by 2 - `update-arr-stack.sh`: skip whole compose projects (`stripe-bridge`, `raven`) by label through one `OTHER_PROJECTS` list - `SKILL.md`: raven runs on Meleys as well as Vhagar, no `--services` needed - Fleet grid: at most three columns, so six hosts land 3 by 2, then 2 by 3, then one --- .claude/skills/arr-stack-update/SKILL.md | 21 ++++++++++--------- .../scripts/update-arr-stack.sh | 20 ++++++++++-------- .../src/pages/Fleet/Fleet.module.scss | 19 ++++++++++++++--- 3 files changed, 38 insertions(+), 22 deletions(-) diff --git a/.claude/skills/arr-stack-update/SKILL.md b/.claude/skills/arr-stack-update/SKILL.md index 1b0be646..dec86d2e 100644 --- a/.claude/skills/arr-stack-update/SKILL.md +++ b/.claude/skills/arr-stack-update/SKILL.md @@ -33,9 +33,10 @@ from container labels — never hardcode the paths, they have moved before. Meleys and Vermithor both run a `sonarr`, a `radarr` and a `sabnzbd`. **Always name the host** — never say "the sonarr container". -**Vhagar hosts two compose projects**, `jellyfin` and `raven` (`/volume1/docker/raven`, not part -of the media stack), so `vhagar` and `all` stop at discovery unless narrowed: run it as -`vhagar --services jellyfin`. Its docker sudo uses the stored keychain password, like Vermithor. +**Meleys and Vhagar both also run `raven`** (`/volume1/docker/raven`), its own compose project and +not part of the media stack. The script skips it through `OTHER_PROJECTS`; without that, the +one-project check stops both hosts at discovery. Vhagar's docker sudo uses the stored keychain +password, like Vermithor. **Jellyfin's bind mounts are CIFS remote folders** (`/volume1/Vhagar/{Caraxes,Meleys,Syrax,Vermithor}`). After a fleet-wide reboot (a DSM update) Vhagar mounts them before the other boxes serve SMB, the @@ -99,10 +100,10 @@ Before ever passing `--include-stateful`: - For Wizarr specifically, prefer the `wizarr-upgrade` skill, which judges whether a given release is safe to take and knows the rollback shape. -`stripe-bridge`, `fleet-monitor` and `fleet-collector` are filtered out unconditionally. -They are built from this repo, `compose pull` has nothing to fetch for them, `deploy-nas` -owns their lifecycle, and on meleys they sit in a second compose project whose directory -would otherwise clobber the media project's. +`stripe-bridge`, `fleet-monitor` and `fleet-collector` are filtered out unconditionally, as +their whole `stripe-bridge` compose project is in `OTHER_PROJECTS`. They are built from this +repo, `compose pull` has nothing to fetch for them, `deploy-nas` owns their lifecycle, and on +meleys their project directory would otherwise clobber the media project's. ## Hard-Won Details (do not "simplify" these away) @@ -126,9 +127,9 @@ would otherwise clobber the media project's. if a label is empty. Do not "tidy" either back to tabs. - **Meleys hosts two compose projects, not one.** `westeroz` is the media stack; `stripe-bridge`, `fleet-monitor` and `fleet-collector` live in `/volume1/docker/stripe-bridge`, - are built from this repo rather than pulled, and belong to `deploy-nas`. All three are in - `NEVER`. They were not always, and the loop's last-wins `workdir` assignment then pointed - the pull at the wrong directory. The script now `die`s if the selected services span two + are built from this repo rather than pulled, and belong to `deploy-nas`. Their project is in + `OTHER_PROJECTS`, matched on the compose project label. It was not always, and the loop's + last-wins `workdir` assignment then pointed the pull at the wrong directory. The script now `die`s if the selected services span two project dirs rather than guessing. - **`sudo` needs the literal path `/usr/local/bin/docker`.** Docker is not on the non-interactive `PATH`, so a plain `ssh host docker ps` returns `command not found`, diff --git a/.claude/skills/arr-stack-update/scripts/update-arr-stack.sh b/.claude/skills/arr-stack-update/scripts/update-arr-stack.sh index 4dea9471..e2a3cb8f 100755 --- a/.claude/skills/arr-stack-update/scripts/update-arr-stack.sh +++ b/.claude/skills/arr-stack-update/scripts/update-arr-stack.sh @@ -25,10 +25,12 @@ REPO="${WZ_REPO:-$(cd "$(dirname "$0")/../../../.." && pwd)}" # project, discovered at runtime from container labels rather than hardcoded. ALL_HOSTS="meleys vermithor vhagar" STATEFUL="wizarr tautulli" -# Built from this repo, not pulled. compose pull has nothing to fetch for them, -# and they sit in a second compose project (/volume1/docker/stripe-bridge) whose -# dir would otherwise clobber the media project's. deploy-nas owns their lifecycle. -NEVER="stripe-bridge fleet-monitor fleet-collector" +# Compose projects that share a host with the media stack but are not it, matched +# on the project label so a container added to one needs no edit here. +# stripe-bridge (bridge, fleet monitor and collector, on Meleys) is built from this +# repo, so compose pull has nothing to fetch and deploy-nas owns it; raven (Meleys +# and Vhagar) is a separate app. Either one left in trips the one-project check. +OTHER_PROJECTS="stripe-bridge raven" # A service is "up" if it answers at all — some *arr UIs 200, some redirect to a # login, some 401. Only a connection failure or a 5xx means broken. @@ -170,13 +172,13 @@ update_host() { # no compose labels then yields svc="", which compose rejects with # "no such service" and the whole pull aborts having fetched nothing. The label # filter drops those containers at the source; '|' keeps the rest aligned anyway. - inventory="$(docker_on "$host" "ps -a --filter 'label=com.docker.compose.service' --format '{{.Names}}|{{.Label \"com.docker.compose.service\"}}|{{.Label \"com.docker.compose.project.working_dir\"}}|{{.Image}}|{{.Ports}}'")" + inventory="$(docker_on "$host" "ps -a --filter 'label=com.docker.compose.service' --format '{{.Names}}|{{.Label \"com.docker.compose.service\"}}|{{.Label \"com.docker.compose.project\"}}|{{.Label \"com.docker.compose.project.working_dir\"}}|{{.Image}}|{{.Ports}}'")" names=(); services=(); images=(); ports=(); workdir="" - while IFS='|' read -r name svc dir image portspec; do + while IFS='|' read -r name svc project dir image portspec; do [ -n "${svc:-}" ] && [ -n "${dir:-}" ] || continue - if in_list "$name" $NEVER; then - say " · skipping $svc (built from this repo — deploy-nas owns it)" + if in_list "${project:-}" $OTHER_PROJECTS; then + say " · skipping $svc (in the $project project, not the media stack)" continue fi if [ -n "$ONLY_SERVICES" ]; then @@ -188,7 +190,7 @@ update_host() { # One compose project per run. Meleys really does host two, so a stray service # from the other one would silently send the pull to the wrong directory. if [ -n "$workdir" ] && [ "$dir" != "$workdir" ]; then - die "$host: selected services span two compose projects ($workdir and $dir). Narrow with --services, or add the other project's services to NEVER." + die "$host: selected services span two compose projects ($workdir and $dir). Narrow with --services, or add the other project to OTHER_PROJECTS." fi workdir="$dir" port="$(printf '%s' "${portspec:-}" | sed -n 's/.*0\.0\.0\.0:\([0-9]*\)->.*/\1/p' | head -1)" diff --git a/apps/admin-portal/src/pages/Fleet/Fleet.module.scss b/apps/admin-portal/src/pages/Fleet/Fleet.module.scss index 1c2c71fb..fdd645e1 100644 --- a/apps/admin-portal/src/pages/Fleet/Fleet.module.scss +++ b/apps/admin-portal/src/pages/Fleet/Fleet.module.scss @@ -79,11 +79,24 @@ font-size: var(--font-size-sm); } +/* Never more than three host columns: each track takes at least its share of a + three-wide row, so the six hosts land 3 by 2 rather than 5 and 1. Narrower than + three 18rem tracks it falls to two columns, then one, and min(100%, ...) keeps a + 320px screen from scrolling sideways. */ +$gridMaxColumns: 3; + .grid { - // min(100%, 18rem) keeps the track from demanding 18rem on a 320px screen, - // which is what would push the page into a sideways scroll. display: grid; - grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); + grid-template-columns: repeat( + auto-fit, + minmax( + min( + 100%, + max(18rem, calc((100% - #{$gridMaxColumns - 1} * var(--space-2)) / #{$gridMaxColumns})) + ), + 1fr + ) + ); gap: var(--space-2); padding: 0; list-style: none;