|
All checks were successful
Sync infra to hosts / sync-beta (push) Has been skipped
Sync infra to hosts / sync-prod (push) Has been skipped
Sync infra to hosts / sync-centralis (push) Has been skipped
Sync infra to hosts / sync-dev (push) Successful in 9s
secrets-guard / encrypted (push) Successful in 5s
Validate observability stack / validate (push) Successful in 12s
shell-lint / shellcheck (push) Successful in 8s
Build + push images (Forgejo registry) / build-push (frontend) (push) Successful in 26s
Build + push images (Forgejo registry) / build-push (backend) (push) Successful in 1m10s
Deploy / deploy (backend) (push) Successful in 1m41s
Deploy / deploy (frontend) (push) Successful in 1m48s
secrets-guard / encrypted (pull_request) Successful in 8s
shell-lint / shellcheck (pull_request) Successful in 9s
PR build (required check) / changes (pull_request) Successful in 20s
PR build (required check) / validate-observability (pull_request) Successful in 15s
PR build (required check) / build-frontend (pull_request) Successful in 17s
PR build (required check) / build-backend (pull_request) Successful in 2m26s
PR build (required check) / gate (pull_request) Successful in 1s
Completes the Forgejo domain migration. ROOT_URL moved to dev.jinemi.com earlier; the registry half was deliberately deferred. Every image name, REGISTRY_HOST default, runner label and --add-host pin now names dev.jinemi.com, so the registry host and the bearer-token realm agree again. Both names address the same Forgejo, so no image needs re-pushing and a rollback to a tag pushed under the old prefix still resolves. git.thermograph.org therefore stays served off the same Caddy site block -- one block, so the /v2/* mesh-only matcher keeps covering both names -- for pre-migration tags and for runners holding it as their registered instance URL. Mesh clients now pin both names in /etc/hosts: the new one as registry host and token realm, the old one for pre-migration tags. runner-vps2/config.yaml carries both --add-host entries for the same reason. Also renames Centralis' endpoint to mcp.jinemi.com in the two places this repo names it; Centralis itself is provisioned outside this repo. Host-side steps this cannot do (documented in deploy/forgejo/README.md, "Host-side steps"): the Forgejo Actions variable REGISTRY_HOST, docker login against the new host, and the /etc/hosts pins. |
||
|---|---|---|
| .. | ||
| firewall-swarm.sh | ||
| init-swarm.sh | ||
| join-swarm.sh | ||
| label-forge-node.sh | ||
| README.md | ||
| setup-wireguard.sh | ||
3-node Docker Swarm (vps2 + vps1 + desktop)
This Swarm mesh's only Swarm-scheduled workload is Forgejo
(deploy/forgejo/), pinned to vps1. It does not orchestrate the
Thermograph app the same way — prod and beta each run as their own docker stack deploy (deploy/stack/thermograph-stack.yml /
thermograph-beta-stack.yml) that happens to land on this same manager node
(vps2) because their volumes are local to it today. Keeping Forgejo's stack
and the app stacks conceptually separate means nothing here can strand or
interfere with the app's single-writer Postgres/TimescaleDB.
This is the canonical topology from
thermograph-docs/runbooks/implementation-handoff.md (Track B steps 2-3) — three nodes,
not two. The desktop (formerly the LAN dev machine) joins as a worker for flex
capacity and AI-model hosting; it hosts no Thermograph environment.
Nodes:
- manager — vps2 (
169.58.46.181), the box with headroom for prod's and beta's Swarm stacks and their local volumes. - worker — vps1 (
75.119.132.91), pinned to run Forgejo (node.labels.role == forge). Also runs Grafana/Loki/Alloy and the dev environment, both outside this Swarm cluster (plain Docker/compose on the same host's daemon, not Swarm-scheduled). - worker — desktop (this machine), flex capacity plus AI-model hosting. No Thermograph environment runs here.
One manager, not more: Raft needs 3 nodes for real quorum-based HA, and this cluster only has 3 nodes total, so making even one more of them a manager would still fall short of real HA while adding split-brain risk. If the manager (vps2) goes down, the workers keep running whatever was already scheduled on them (Forgejo, pinned to vps1) but the cluster can't reschedule anything until vps2's back — acceptable for a small cluster whose only Swarm-scheduled job is CI/CD.
Order of operations
- Agent access first (
deploy/provision-agent-access.sh) on vps1 and vps2 — everything below on those two boxes is run through that access. The desktop is wherever you're already working from; no separate access step needed there. - WireGuard mesh (
setup-wireguard.sh <my_wg_ip> <peers_file>) — run on all three nodes. See the script's header for the peer-list format and the two-pass key-exchange dance (pubkeys aren't known until every node has run it once). Verify withping <peer_wg_ip>to each of the other two before continuing. - Swarm init (
init-swarm.sh <manager_wg_ip>) on the manager (vps2) only. - Swarm join (
join-swarm.sh <manager_wg_ip> <token>) on each of the two workers (vps1, desktop) — same token for both. - Firewall lockdown (
firewall-swarm.sh) on all three nodes — closes 2377/7946/4789 to everything except the WireGuard interface. Do this after joining is confirmed working on all three, not before (locking the ports first would make the join itself fail). - Label vps1 (
label-forge-node.sh <vps1-node-name>) on the manager —docker node lsshows each node's name/ID. Only vps1 getsrole=forge; the desktop and vps2 don't need a Swarm label for anything in this setup. - Deploy Forgejo: see
deploy/forgejo/README.md. - Register the Actions runner:
deploy/forgejo/register-lan-runner.sh. See that document (andDEPLOY-DEV.md) for where it actually runs today — its own header comment predates the vps1/vps2 rename and still describes "the desktop" as the canonical placement.
Why WireGuard instead of relying on Swarm's built-in TLS alone
Swarm's control plane (port 2377) is TLS-encrypted and mutually authenticated by default. Its overlay data plane (VXLAN, port 4789) is not encrypted by default, and Docker's own guidance is that port must never face the public internet — these nodes are on different networks (two separate providers' public IPs, plus a home/LAN connection for the desktop), not one private LAN, so the tunnel is the network boundary the Swarm ports advertise into, rather than trusting the public internet (or the desktop's home network) directly.
Verifying
# On the manager (vps2):
docker node ls # all three nodes Ready
docker node inspect <vps1-node> --format '{{.Spec.Labels}}' # role:forge
# From a FOURTH machine outside the mesh entirely, confirm the Swarm ports
# are NOT reachable on either VPS's public IP (the desktop has no public IP
# to check this way):
nc -zv -w2 <vps1_or_vps2_public_ip> 2377 # should fail/timeout
nc -zvu -w2 <vps1_or_vps2_public_ip> 4789 # should fail/timeout
Adding a node label back out (undo)
docker node update --label-rm role <vps1-node>