mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-12 05:36:40 +00:00
Parallel compose slots, swarm lab clusters and GUI lanes each kept their own pip, npm and pacman downloads, and a failed swarm run left its cluster (about 25 GB of node docker data plus the rescue bundle in the act container) on the root filesystem until someone ran make swarm-down. INFINITO_CACHE_SHARED_HOST_PATH (default <DIR_CACHE>/shared) is now mounted read-write at the same path into every compose slot and every swarm lab node, with PIP_CACHE_DIR and npm_config_cache below it; empty, the renders stay byte-identical to before. On a host whose os-release ID is exactly arch running an arch stack, INFINITO_CACHE_HOST_PACMAN_PATH mounts the host pacman cache read-only and scripts/docker/cache/pacman.sh makes it the first CacheDir with <shared>/pacman/ second, so new downloads land in the shared folder and the host cache stays untouched; on Manjaro and every other host pacman uses the shared folder alone. make swarm-zombie without keep=true now copies the act job's rescue diagnostics and Playwright artefacts to the host and then releases the lab nodes, the lab network, the NFS export volume and the act outer container, on success and on failure; when the copy fails the nodes still go, the act container stays and the run exits naming make swarm-down. make roundtrip passes keep to every swarm step, make clean-cache removes the shared folder, and the disc-space cleanup skips pacman cache directories it cannot write. apt and dnf keep their per-container caches behind the package-cache proxy, and no docker data root is shared between daemons. Requirement 065. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
79 lines
3.1 KiB
Bash
Executable File
79 lines
3.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Iterate one or more roles through every deploy mode in order, stopping at the
|
|
# first failure. Inputs (env):
|
|
# apps - space-separated role ids; defaults to one role per dna cluster
|
|
# (complexity clone == false), most complex first, when unset
|
|
# modes - mode sequence (default "compose swarm"; append "k8s" here once it exists)
|
|
# keep - true keeps each swarm cluster, green or failed; empty or false lets
|
|
# swarm-zombie release it once the rescue bundle is on the host
|
|
# disable - comma-separated provider keys removed from the test inventory;
|
|
# the Tor key pins the swarm step to clearnet
|
|
_repo_root="$(cd "$(dirname "$0")/../../.." && pwd)"
|
|
|
|
# shellcheck source=scripts/meta/env/load.sh
|
|
. "${_repo_root}/scripts/meta/env/load.sh"
|
|
|
|
if [ -z "${apps:-}" ]; then
|
|
apps="$("${PYTHON}" -m cli.meta.roles.applications.complexity \
|
|
--sort "desc weight" --filter "clone == false" --format string)"
|
|
fi
|
|
[ -n "${apps// /}" ] || {
|
|
echo "roundtrip: no roles to run" >&2
|
|
exit 2
|
|
}
|
|
|
|
: "${keep?keep is required: true keeps each swarm cluster, empty or false releases it}"
|
|
modes="${modes:-compose swarm}"
|
|
_log_dir="${TMPDIR:-/tmp}" # nocheck: posix TMPDIR convention
|
|
|
|
read -ra _apps <<<"${apps//$'\n'/ }"
|
|
read -ra _modes <<<"$modes"
|
|
|
|
_tor_key="$("${PYTHON}" -c "import sys; sys.path.insert(0, '${_repo_root}'); from utils.github.variant.network import TOR_SERVICE; print(TOR_SERVICE)")"
|
|
_disabled=",${disable:-},"
|
|
_disabled="${_disabled//[[:space:]]/,}"
|
|
|
|
for app in "${_apps[@]}"; do
|
|
app_skip="$("${PYTHON}" -c "import sys; sys.path.insert(0, '${_repo_root}'); from utils.roles.meta_lookup import get_role_skip; print(' '.join(get_role_skip('${app}')))")"
|
|
for mode in "${_modes[@]}"; do
|
|
if [[ " ${app_skip} " == *" ${mode} "* ]]; then
|
|
echo "==> roundtrip: ${app} [${mode}] SKIPPED (meta/services.yml skip)"
|
|
continue
|
|
fi
|
|
log="${_log_dir}/roundtrip-${app}-${mode}.log"
|
|
echo "==> roundtrip: ${app} [${mode}] (log: ${log})"
|
|
case "$mode" in
|
|
compose)
|
|
make -C "$_repo_root" compose-deploy \
|
|
mode=reinstall apps="$app" full_cycle=true variant=0 \
|
|
disable="${disable:-}" 2>&1 | tee "$log"
|
|
;;
|
|
swarm)
|
|
network=""
|
|
if [[ "${_disabled}" == *",${_tor_key},"* ]]; then
|
|
network="clearnet"
|
|
elif "${PYTHON}" -m cli.meta.ci.validate --modes swarm --whitelist "${app}#0@swarm+multi" >/dev/null 2>&1; then
|
|
network="multi"
|
|
fi
|
|
echo "==> roundtrip: ${app} [swarm] network=${network:-rotation}"
|
|
ACT_PLATFORM_IMAGE=local/act-runner-fixed:latest \
|
|
make -C "$_repo_root" swarm-zombie app="$app" network="$network" \
|
|
disable="${disable:-}" keep="${keep}" 2>&1 | tee "$log"
|
|
marker="==> swarm drill complete: app=${app}"
|
|
grep -qF "${marker}" "$log" || {
|
|
echo "roundtrip: ${app} [swarm] FAILED: swarm-zombie exited 0 but the drill never completed for ${app} (marker '${marker}' absent from ${log})" >&2
|
|
exit 1
|
|
}
|
|
;;
|
|
*)
|
|
echo "roundtrip: unknown mode '${mode}' (expected: compose | swarm)" >&2
|
|
exit 2
|
|
;;
|
|
esac
|
|
done
|
|
done
|
|
|
|
echo "==> roundtrip: all ${#_apps[@]} role(s) green across [${modes}]"
|