default the host's swarmctl to the gateway; login takes a callback port
This commit is contained in:
parent
ef817ed5a0
commit
58236e1b7f
2 changed files with 183 additions and 67 deletions
|
|
@ -142,6 +142,7 @@ test.overrideTestDerivation (old: {
|
|||
env = (old.env or { }) // {
|
||||
FULL_SETUP_SOCKET = deploy.swarm-controller.socketPath;
|
||||
FULL_SETUP_FORGE_DOMAIN = swarm.forge.domain;
|
||||
FULL_SETUP_SWARM_DOMAIN = swarm.domain;
|
||||
FULL_SETUP_HIVE = hive;
|
||||
FULL_SETUP_TOPLEVELS = builtins.toJSON (map toString (toplevels settingsJson));
|
||||
FULL_SETUP_META_SETTINGS = settingsJson;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@ TOPLEVELS = json.loads(os.environ["FULL_SETUP_TOPLEVELS"])
|
|||
REPO = os.environ["FULL_SETUP_HYPERHIVE_REPO"]
|
||||
CONTROL_NIX = os.environ["FULL_SETUP_CONTROL_NIX"]
|
||||
INIT = "/root/bao-init.json"
|
||||
# The host's swarmctl defaults to the swarm's gateway, where each controller verb needs a
|
||||
# `swarmctl login`, which a VM without a browser cannot do. An empty `SWARMCTL_SWARM` puts a
|
||||
# verb on the controller socket.
|
||||
VIA_SOCKET = "SWARMCTL_SWARM="
|
||||
SWARM_URL = "https://" + os.environ["FULL_SETUP_SWARM_DOMAIN"]
|
||||
FORGE_AUTH = "/root/forge-auth.header"
|
||||
NIX = "nix --extra-experimental-features nix-command"
|
||||
ARCHETYPE = {"source": "hyperhive", "name": "reviewer"}
|
||||
|
|
@ -297,7 +302,7 @@ with subtest("swarmctl setup status reports the steps done so far"):
|
|||
"✅ 10 another agent [optional]",
|
||||
]
|
||||
for _ in range(60):
|
||||
lines = machine.execute("swarmctl setup status")[1].splitlines()
|
||||
lines = machine.execute(f"{VIA_SOCKET} swarmctl setup status")[1].splitlines()
|
||||
if all(any(line.startswith(prefix) for line in lines) for prefix in reported):
|
||||
break
|
||||
machine.sleep(10)
|
||||
|
|
@ -306,7 +311,16 @@ with subtest("swarmctl setup status reports the steps done so far"):
|
|||
"swarmctl setup status did not report the steps done so far:\n"
|
||||
+ "\n".join(lines)
|
||||
)
|
||||
assert machine.execute("swarmctl setup status >/dev/null")[0] == 1
|
||||
assert machine.execute(f"{VIA_SOCKET} swarmctl setup status >/dev/null")[0] == 1
|
||||
|
||||
with subtest(
|
||||
"the host's swarmctl reaches the controller through the gateway by default"
|
||||
):
|
||||
# No login exists in the VM, so a verb that names the controller stops at the login, and
|
||||
# says which swarm it went to. Over the socket the same verb needs none.
|
||||
status, out = machine.execute("swarmctl schedule list 2>&1")
|
||||
assert status != 0 and f"not logged in to {SWARM_URL}" in out, (status, out)
|
||||
machine.succeed(f"{VIA_SOCKET} swarmctl schedule list")
|
||||
|
||||
with subtest("the agents are deployed and need a login"):
|
||||
settle(
|
||||
|
|
|
|||
Loading…
Reference in a new issue