hyperhive: make the values the meta-flake render reads swarm-wide
Five host options whose values hive-c0re renders into every agent's build move under services.hyperhive.swarm, so the swarm states each of them once instead of every hive carrying its own copy: c0re.dashboardPort -> swarm.dashboardPort c0re.claudeCodePackage -> swarm.claudeCodePackage github.enable -> swarm.github.enable otel.collector.port -> swarm.hiveOtel.collectorPort otel.extraResourceAttributes -> swarm.hiveOtel.extraResourceAttributes Every old path is a mkRenamedOptionModule alias, so a host that sets one keeps its value and gets an eval warning naming the new path. Types and defaults are unchanged, so the rendered meta flake, serve.json and hive-c0re's environment are the same as before on a host that sets none of them. The readers move with them: serve.json and its gc-root assertion, the hive-c0re environment, the hive collector's listen address and bridge port, the swarm collector's port-collision assertion, and the claude-login and review-classifier containers' claude pin. The swarm-services-switch fixture sets the swarm path and now also checks that serve.json carries the pinned claude. Part of #4857 (slice 2).
This commit is contained in:
parent
af7114eb49
commit
fc32f57481
25 changed files with 189 additions and 138 deletions
|
|
@ -99,11 +99,11 @@ let
|
|||
deploy.builder.enable = false;
|
||||
};
|
||||
|
||||
# Same, with the claude-code build the agents run pinned on the hive. Any
|
||||
# Same, with the claude-code build the agents run pinned for the swarm. Any
|
||||
# package serves: only the path the containers are pointed at is read.
|
||||
swarmServicesPinnedClaude = hiveWithController {
|
||||
deploy.allSwarmServices = true;
|
||||
c0re.claudeCodePackage = pkgs.hello;
|
||||
swarm.claudeCodePackage = pkgs.hello;
|
||||
};
|
||||
|
||||
# Same, with one of those services placed on another host. Every derivation
|
||||
|
|
@ -283,16 +283,25 @@ let
|
|||
{
|
||||
# The CLI is the one the agents run, not the container's own nixpkgs'.
|
||||
# Unpinned is the control: it falls back to the container's own `claude-code`.
|
||||
name = "the claude login minter and the review classifier run the claude-code the hive pins";
|
||||
# serve.json is what hive-c0re renders every agent's `claudeCodePath` from.
|
||||
name = "the agents, the claude login minter and the review classifier run the claude-code the swarm pins";
|
||||
ok =
|
||||
let
|
||||
claudeOf =
|
||||
host: container: unit: var:
|
||||
host.containers.${container}.config.systemd.services.${unit}.environment.${var};
|
||||
pinned = "${pkgs.hello}/bin/claude";
|
||||
servedClaude =
|
||||
host:
|
||||
(builtins.fromJSON (
|
||||
builtins.unsafeDiscardStringContext host.environment.etc."hyperhive/serve.json".text
|
||||
)).claude_code_path;
|
||||
in
|
||||
claudeOf swarmServicesPinnedClaude "swarm-claude-login" "swarm-claude-login"
|
||||
"SWARM_CLAUDE_LOGIN_CLAUDE" == pinned
|
||||
servedClaude swarmServicesPinnedClaude == "${pkgs.hello}"
|
||||
&& servedClaude swarmServicesHere == null
|
||||
&&
|
||||
claudeOf swarmServicesPinnedClaude "swarm-claude-login" "swarm-claude-login"
|
||||
"SWARM_CLAUDE_LOGIN_CLAUDE" == pinned
|
||||
&&
|
||||
claudeOf swarmServicesPinnedClaude "swarm-review-classifier" "swarm-review-classifier"
|
||||
"SWARM_REVIEW_CLASSIFIER_CLAUDE" == pinned
|
||||
|
|
|
|||
Loading…
Reference in a new issue