broker: auto-deploy on main — CI publishes ourcloud-broker per sha, a sudo-scoped installer on the mail droplet, a deploy workflow on the workstation runner (the ADR 0185 rail for the broker) #688
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#688
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Every broker fix the swarm lands (#647 deploy,
b415707for #672,c4d0bbctoday) has needed a human!to reachbroker.idss.nz: build on a laptop,scpover the Netbird door,sudo install+systemctl restarton the mail droplet. In the phase-4 rehearsal loop that is the ONLY remaining hands step between a swarm-landed broker fix and the drive re-firing — today it cost ~2 h of wall-clock twice. The agent already rides a rail for this (ci.ymlpublishesagent-x86_64per sha; ADR 0185 tracking pin). The broker should ride the same rail.Deliverable
.forgejo/workflows/ci.yml: whenbroker/**(orgo.mod/go.sum) changes onmain, buildourcloud-broker(cd broker && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath ./cmd/broker) and publish it to the Forgejo generic package registry asidss-broker/<fullsha>/ourcloud-broker-x86_64, mirroring the agent's publish step. The version string already comes frombroker.Version.scripts/broker/idss-broker-install.sh(installed to/usr/local/sbin/idss-broker-install, root:755):idss-broker-install <fullsha>→ download from the registry (anonymous read is fine — it is public-read today), verify non-empty and thatstringscarries the version,cp -athe running binary to/usr/local/bin/ourcloud-broker.bak-<oldsha>,install -m755,systemctl restart ourcloud-broker, wait ≤10 s foris-activeAND a 200 fromhttp://127.0.0.1:8090/v1/gateways/offer; on failure restore the backup, restart, exit non-zero. Keep the last 3 backups. Idempotent for an already-installed sha..forgejo/workflows/broker-deploy.ymlon the workstation runner (it is on the Netbird mesh):workflow_dispatchwith ashainput and, after CI's publish job succeeds onmain, an automatic run —ssh deploy@100.98.48.68 sudo /usr/local/sbin/idss-broker-install <sha>. SSH key = a NEWdeployuser's key stored as a repo secret (BROKER_DEPLOY_SSH_KEY), not thedevuser's.!, written up as a runbook inbroker/README.md: create userdeploy(no shell beyond the one command), install the script, onesudoersline:deploy ALL=(root) NOPASSWD: /usr/local/sbin/idss-broker-install *. The worker must NOT attempt it (no swarm substrate reaches the droplet — #445 caveat); it ships the recipe and files the hands step as aready-for-humanfollow-up.docs/GOTCHAS.mdentry: a broker change is not live untilbroker-deployran — checkjournalctl -u ourcloud-broker | grep 'broker booted'for the version before re-driving;STATUS.mdlead.Acceptance
broker/**change tomainproduces a registry package for that sha (CI green).workflow_dispatchofbroker-deploywith that sha, once the droplet half is in place, ends withbroker booted … version=…in the journal andofferanswering — proven by one real run (Ben or the session-runner triggers it after Ben's!).systemctl/curl, the wayscripts/lib/*-lib.shtests are done.Non-goals
Blue/green, multiple brokers, containerising the broker, changing the broker's env/credential layout (
/etc/ourcloud/broker.envand theLoadCredentialdo-token drop-in stay as they are).swarm-claim host=elitebook-distributed-server-03 run=9104
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #688 — status
blocked✅ close-report gates passed — every claim verified against main; issue closed.
envelope