diff --git a/Makefile b/Makefile index da8401d38d..5fffca3331 100644 --- a/Makefile +++ b/Makefile @@ -783,11 +783,12 @@ SWARM_DISTROS = $(or $(distros),$${INFINITO_DISTRO:?}) # Param variant: optional matrix variant index to deploy (default 0); a multi-variant app runs one cluster per swarm-zombie, so pick the round to validate. # Param disable: optional comma-separated provider keys removed from the test inventory (e.g. matomo,dashboard,prometheus,email,css). # Param name: optional cluster-id prefix for the container + network names; release with the same name=. +# Param network: optional node network mode pinned on the row (clearnet | tor | multi); empty keeps the run's rotation. # Param step_timeout: optional minute budget for the matrix-deploy step (default 690). # Note: Use `make swarm-exec` / `make swarm-shell` to inspect, `make swarm-down` to release. swarm-zombie: install-act - @test -n '$(app)' || { echo 'usage: make swarm-zombie app= [distros=] [variant=] [name=] [disable=]'; exit 2; } - @"$${PYTHON}" -m cli.meta.ci.validate --modes swarm --whitelist '$(app)#$(or $(variant),0)@swarm' + @test -n '$(app)' || { echo 'usage: make swarm-zombie app= [distros=] [variant=] [name=] [disable=] [network=]'; exit 2; } + @"$${PYTHON}" -m cli.meta.ci.validate --modes swarm --whitelist '$(app)#$(or $(variant),0)@swarm$(if $(network),+$(network))' @SWARM_NAME='$(or $(name),$(app))' INFINITO_KEEP_SWARM_NODES=false bash scripts/tests/deploy/swarm/utils/clean/teardown.sh @bash scripts/tests/deploy/swarm/utils/clean/lab_subnet.sh @bash scripts/tests/deploy/act/down_act_outer.sh @@ -803,7 +804,7 @@ swarm-zombie: install-act ACT_WORKFLOW=.github/workflows/call-test-deploy.yml \ ACT_JOB=deploy \ ACT_MATRIX="apps:$(app);variant:$(or $(variant),0);mode:swarm" \ - ACT_INPUTS="whitelist=$(app)#$(or $(variant),0)@swarm distros=$(SWARM_DISTROS) index=0 sweep=0 modes=swarm disable=$(disable)" \ + ACT_INPUTS="whitelist=$(app)#$(or $(variant),0)@swarm$(if $(network),+$(network)) distros=$(SWARM_DISTROS) index=0 sweep=0 modes=swarm disable=$(disable)" \ bash scripts/tests/deploy/act/workflow.sh .PHONY: system-purge diff --git a/docs/agents/action/iteration/roundtrip.md b/docs/agents/action/iteration/roundtrip.md index 896d211950..aad94d9b78 100644 --- a/docs/agents/action/iteration/roundtrip.md +++ b/docs/agents/action/iteration/roundtrip.md @@ -14,7 +14,7 @@ For debugging the compose deploy of one role, see [Compose Loop](compose.md); fo - With no `apps=`, the loop defaults to **every application, most-complex first** (the `complexity` CLI: `infinito meta roles applications complexity --sort "desc weight" --format string`). That is a large run (one compose plus one swarm deploy per app), so narrow it with `apps=` while iterating. - The mode sequence defaults to `compose swarm` and is overridable with `modes="compose swarm"`. The order is always compose first, so the cheaper mode fails fast before the expensive swarm rebuild. Append `k8s` here once that mode exists. - Per step the output is streamed to `${TMPDIR:-/tmp}/roundtrip--.log`. Tell the operator the exact `tail -f` path for the running step. -- The compose step runs `compose-deploy mode=reinstall apps= full_cycle=true variant=0`; the swarm step runs `swarm-zombie app=`, pinned to `variant:0` so a multi-variant app validates one cluster (parity with the compose step, not the full per-variant CI matrix that runs one isolated runner per variant). The cluster is named `-swarm-mgr-01` etc. via the mandatory `SWARM_NAME` (the app id is the default cluster id). Each validated swarm cluster is released afterwards unless you pass `keep=true`. +- The compose step runs `compose-deploy mode=reinstall apps= full_cycle=true variant=0`; the swarm step runs `swarm-zombie app=`, pinned to `variant:0` and, whenever the role can take it, to the `multi` network mode, so a multi-variant app validates one cluster (parity with the compose step, not the full per-variant CI matrix that runs one isolated runner per variant). The cluster is named `-swarm-mgr-01` etc. via the mandatory `SWARM_NAME` (the app id is the default cluster id). Each validated swarm cluster is released afterwards unless you pass `keep=true`. - `make autoformat` and `make test` MUST be green before a roundtrip; the loop does not re-run them per app. - **A blocked mode is NEVER a reason to silently switch to another.** If a mode cannot run (the swarm NFS wedge below, a wedged daemon, a missing host capability), STOP the whole sweep, report the blocker together with the exact recovery command, and wait for it to be cleared. You MUST NOT fall back to a `modes=compose`-only (or any reduced) sweep to look productive: it hides the unmet swarm parity and never satisfies the compose-AND-swarm gate. Resume the full sweep only once the blocker is gone. diff --git a/scripts/tests/deploy/roundtrip.sh b/scripts/tests/deploy/roundtrip.sh index 34488d141e..b969b88212 100755 --- a/scripts/tests/deploy/roundtrip.sh +++ b/scripts/tests/deploy/roundtrip.sh @@ -44,8 +44,13 @@ for app in "${_apps[@]}"; do disable="${disable:-}" 2>&1 | tee "$log" ;; swarm) + network="" + if "${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" \ + make -C "$_repo_root" swarm-zombie app="$app" network="$network" \ disable="${disable:-}" 2>&1 | tee "$log" marker="==> swarm drill complete: app=${app}" grep -qF "${marker}" "$log" || {