Watch
0
0
Fork
You've already forked hyperhive
0

swarmctl, vm tests: wait for the store's active node after an unseal

An unsealed store has no active node for a few seconds and refuses writes
with "local node not active". swarmctl bao grant-bootstrap now repeats
bao policy list and bao policy write every second, up to a minute, while
the store answers that; setup.md says so. The full-setup and semi-spread
tests wait for bao policy list with the root token before the bootstrap.

full-setup.py: when create_agent gives up it also prints the controller
pod's logs, the pod list and the swarm builder's journal. A run that
failed with no archetype "reviewer" for 13 minutes left no controller or
builder output to read.
This commit is contained in:
atlas 2026-11-27 05:25:02 +01:00 • committed by maia
commit fbc670087a

View file

@ -87,6 +87,14 @@ def create_agent(body):
return
machine.sleep(10)
diagnose("swarm-controller")
# The controller runs as a pod and the builder answers its archetype question: their own
# logs say why the list is empty.
for command in [
"kubectl -n hyperhive logs deploy/swarm-controller --tail=80",
"kubectl -n hyperhive get pods -o wide",
"journalctl --machine=swarm-builder --no-pager -n 60 | tail -c 6000",
]:
print(machine.execute(command)[1])
# The queue refuses every client when its responder cannot answer. nats and
# the responder run in the container; the units that fetch its keys and
# certificate run on the host.
@ -142,6 +150,11 @@ def unseal():
with subtest("step 4: bao operator unseal, with the shamir seal, from the saved keys"):
unseal()
machine.succeed("bao status")
# Unsealed is not active: the node takes a few seconds to elect itself, and a write before
# that is refused with "local node not active".
machine.wait_until_succeeds(
f'BAO_TOKEN="$(jq -r .root_token {INIT})" bao policy list', timeout=120
)
with subtest("step 1: the granter bootstrap"):
machine.succeed(