broker: Copy from the builder's store #15

Merged
dev merged 1 commits from builder-remote-store into main 2026-11-28 18:13:36 +00:00

Stacked on #14 (and #13); its own commit is the last one. Merge those first.

The broker read what the builder built from its own store: deploys nix copy --to ssh://<node>, slop build copies --to ssh-ng://harmonia@object, and build approvals measure closure sizes locally. That only works while the builder shares the broker's box. nixfiles is moving it to a VM, nix-meister (plan on nixfiles branch nix-meister-plan, docs/plans/nix-meister.md).

  • Always from the builder's store: deploys and slop build copy --from ssh-ng://<builder user>@<builder host>:<port>?ssh-key=<broker key>, and closure sizes come from nix path-info --store that URL. There's no option. With the builder on the broker's box it's the same store over loopback SSH, so this can ship before the move. Nothing lands in the broker's store, and the builder never holds a key to the nodes or the cache.
  • The builder key's forced command serves nix-daemon --stdio when that's the SSH command; everything else is a build request as before.
  • Why the URL has the port and key: a copy from the builder to a node has one NIX_SSHOPTS for both connections. Every nixfiles node sets -p <port>, and the cache copy uses the cache's key. Nix puts the URL's -p and ssh-key after NIX_SSHOPTS, and for -p the last value wins. I checked the order with Nix 2.35 and a fake ssh. So the builder's sshOpts may only be [ "-p" "<port>" ], which is the module's default; config validation enforces it.
  • Tests: unit tests for the URL (port, IPv6, refused options and key paths) and for the cache copy's --from. The VM test reads the system path through ssh-ng://slop-broker-build@localhost, so through the forced command and the module's key setup. cargo test, clippy and checks.x86_64-linux.vm pass locally.
  • Docs: docs/design.md (build step) and docs/architecture.md (the NIX_SSHOPTS gotcha).

Not tested end to end: a real slop deploy or slop build through the new copy path. The first deploy on palace after this ships is the check; the demo exercises the node--p case too.

No version bump; the release PR comes after this set.

🤖 Generated with Claude Code

Stacked on #14 (and #13); its own commit is the last one. Merge those first. The broker read what the builder built from its own store: deploys `nix copy --to ssh://<node>`, `slop build` copies `--to ssh-ng://harmonia@object`, and build approvals measure closure sizes locally. That only works while the builder shares the broker's box. nixfiles is moving it to a VM, `nix-meister` (plan on nixfiles branch `nix-meister-plan`, `docs/plans/nix-meister.md`). - **Always from the builder's store:** deploys and `slop build` copy `--from ssh-ng://<builder user>@<builder host>:<port>?ssh-key=<broker key>`, and closure sizes come from `nix path-info --store` that URL. There's no option. With the builder on the broker's box it's the same store over loopback SSH, so this can ship before the move. Nothing lands in the broker's store, and the builder never holds a key to the nodes or the cache. - **The builder key's forced command** serves `nix-daemon --stdio` when that's the SSH command; everything else is a build request as before. - **Why the URL has the port and key:** a copy from the builder to a node has one `NIX_SSHOPTS` for both connections. Every nixfiles node sets `-p <port>`, and the cache copy uses the cache's key. Nix puts the URL's `-p` and `ssh-key` after `NIX_SSHOPTS`, and for `-p` the last value wins. I checked the order with Nix 2.35 and a fake `ssh`. So the builder's `sshOpts` may only be `[ "-p" "<port>" ]`, which is the module's default; config validation enforces it. - **Tests:** unit tests for the URL (port, IPv6, refused options and key paths) and for the cache copy's `--from`. The VM test reads the system path through `ssh-ng://slop-broker-build@localhost`, so through the forced command and the module's key setup. `cargo test`, clippy and `checks.x86_64-linux.vm` pass locally. - **Docs:** `docs/design.md` (build step) and `docs/architecture.md` (the `NIX_SSHOPTS` gotcha). Not tested end to end: a real `slop deploy` or `slop build` through the new copy path. The first deploy on `palace` after this ships is the check; the demo exercises the node-`-p` case too. No version bump; the release PR comes after this set. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
slop-cannon Bot added 2 commits 2026-11-28 17:57:49 +00:00
broker: Never block reading a requester's stdin
CI / Check (pull_request) Successful in 4m53s
CI / Check (push) Canceled after 3m47s
00d3c65cfd
The reader passed stdin to the operation through a channel 16 deep and
waited when it was full, so a requester sending stdin to an operation
that doesn't read it stopped the reader, and the broker no longer saw
it disconnect: the operation kept running.

Buffer stdin without waiting, up to 1 MiB (a requester sending more is
treated as gone), and drop it for operations that don't read it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
broker: Containers as targets
CI / Check (pull_request) Successful in 5m17s
CI / Check (push) Canceled after 0s
4b2c32636e
`slop status`, `logs`, `failed` and `ssh` take `node.container-<name>`,
the name `slop deploy` already takes, so agents can check a container
without asking for `slop ssh` on its host.

- The builder evaluates each node's profile names; its
  `container-<name>` profiles are the containers requests can name.
- Commands run on the node as root through its `sudo`:
  `systemctl --machine`, `journalctl --machine` and, for `ssh`,
  `systemd-run --machine --pipe --wait` with `/bin/sh -l`.
- A container's scope is its node as `target` plus `container`, so
  node rules apply to it while leases stay per target. Rules can
  match `container`.
- Remote commands are now quoted so `fish` reads them as POSIX shells
  do: it treats `\\` and `\'` as escapes inside single quotes.

`PROTOCOL_VERSION` 3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
slop-cannon Bot added 1 commit 2026-11-28 18:05:11 +00:00
broker: Copy from the builder's store
CI / Check (pull_request) Successful in 5m10s
CI / Check (push) Successful in 5m15s
5b7db9eaf9
The broker read what the builder built from its own store, which only
works while they share a box. Read it from the builder's store
instead, which also works when they do.

- Deploys and `slop build` copy `--from ssh-ng://` the builder's user,
  and closure sizes are read there.
- The builder key's forced command serves `nix-daemon --stdio` for it.
- The store URL carries the builder's port and the broker's key: one
  `NIX_SSHOPTS` serves both ends of a copy, and Nix puts the URL's
  `-p` after it. So the builder's SSH options can only set a port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
slop-cannon Bot force-pushed builder-remote-store from bb587c3e8b to 5b7db9eaf9 2026-11-28 18:05:11 +00:00 Compare
dev merged commit 5b7db9eaf9 into main 2026-11-28 18:13:36 +00:00
dev deleted branch builder-remote-store 2026-11-28 18:13:36 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dev/slop-broker#15