Skip to content

feat(pool): a lane's need is measured where it ran, disk included (ADR-0049) - #193

Merged
7schmiede merged 6 commits into
mainfrom
feat/lane-need
Oct 21, 2026
Merged

7schmiede merged 6 commits into
mainfrom
feat/lane-need

Conversation

@7schmiede

@7schmiede 7schmiede commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Implements ADR-0049 (accepted; point 9 amended): a lane's need is measured where it ran, disk included, and the stack file sets a floor.

What changes

  • A need has four parts (share::Need): CPU, memory, disk (split into the repository's images and the lane's slot) and GPUs. On the wire it is a superset of Amount, so older peers read its CPU and memory.
  • A node measures each lease's run (runs.rs): memory and CPU (averaged over a minute) each round, slot, volumes and images every five minutes and at the lease's end. A run counts once its lane ran three minutes; it goes to the coordinator with the node's report.
  • The coordinator keeps a footprint (footprint.rs, footprints.json): the last five runs per repository and profile. The need is the most of each part over those runs, else the requester's estimate, raised to [lanes.need] / [profiles.<name>.need]. The lease offer says the need and where it came from.
  • Disk counts per candidate node: a node keeping the lane's slot needs nothing more, one with the repository's slot the lane's part, any other both. It is checked against free disk plus kept slots no lease uses (disk_room), with 5 GiB to spare. Each lease holds its disk until it has written it, so nothing counts twice. A node removes kept slots (least recently used first) before a lane that needs their room starts. A named node (--on) is checked the same way as a placed one.
  • GPUs asked for in the stack file go only to nodes that offer them. Handing a GPU over (--gpus) is still open (ADR-0036 point 4).
  • The requester estimates from its main tree (Sampler::estimate): the peaks of the last ten minutes, plus as disk the tree without .git and its state, the snapshot, artifacts, logs, volumes and Compose images. It sends that estimate with the floor and its profile.
  • A node short of disk says so with every renewal. The lane shows it, and the requester logs remote_lane_disk. A local lane checks the disk of its worktree's drive (--force skips the check).
  • The dashboard shows the disk a lane needs on each node, and the placement preview follows the chosen profile.
  • Docs: stack-file.md, pool.md, dashboard-api.md, CHANGELOG, the devstack-config skill, and ADR-0049's as-built note (what is not built yet is listed there).

Compatibility

All fields are additive. An older node ignores the disk need and admits by CPU and memory; an older coordinator places by disk_free. Stack files load as before; a file with need should say requires = "0.17.0".

Lanes may now fit fewer nodes than before: the need is the measured or estimated peak, where it used to be the main tree's memory at that moment and 0.5 CPU for every stack. A node also needs the lane's disk plus 5 GiB.

Tests

cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace (416), UI typecheck and vitest all pass locally on Windows. The Linux-only ignored tests (remote_lane, lanerun) run in CI. Not yet tried against a real pool.

🤖 Generated with Claude Code

7schmiede and others added 6 commits October 21, 2026 17:54
…d (Proposed)

A lane's need gets disk (split into the repository's images and the
lane's slot) and a GPU ask. The node measures each run; the coordinator
keeps the maximum of the last five runs per repository and profile.
Without a footprint the requester estimates from its main tree. The
stack file's [lanes.need] is a floor, not an override. Disk is counted
per candidate (what its slots already hold), against free plus
prunable space, and held per lease like memory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R-0048)

ADR-0048 accepted, point 9 amended (a lane here checks what it adds).

- A need is CPU, memory, disk (the repository's images, the lane's slot)
  and GPUs (`share::Need`, a superset of `Amount` on the wire).
- A node measures each lease's run (memory and CPU over a minute each
  round, slot, volumes and images every five minutes and at its end) and
  reports it; a run counts after three minutes.
- The coordinator keeps the last five runs per repository and profile
  (`footprints.json`); the need is the most of them, else the requester's
  estimate, raised to the stack file's floor.
- Disk counts per node (nothing where the lane is kept, its own part
  where the repository ran), against free plus what kept lanes take,
  held per lease until written; kept lanes go before a lane needing
  their room starts. A named node is checked like a placed one.
- GPUs asked for go to nodes that offer them.
- The requester estimates from the main tree (peaks of the last ten
  minutes, tree, state, volumes and Compose images) and sends the floor
  of `[lanes.need]` / `[profiles.<name>.need]` and its profile.
- A node short of disk says so with each renewal (`remote_lane_disk`);
  a local lane checks the disk of its worktree's drive.
- The lease offer says the need and where it came from; the dashboard
  shows the disk a lane needs on each node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sion locks them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… first

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	CHANGELOG.md
#	docs/adr/README.md
@7schmiede 7schmiede changed the title feat(pool): a lane's need is measured where it ran, disk included (ADR-0048) feat(pool): a lane's need is measured where it ran, disk included (ADR-0049) Oct 21, 2026
@7schmiede
7schmiede merged commit fb3ab40 into main Oct 21, 2026
@7schmiede
7schmiede deleted the feat/lane-need branch October 21, 2026 16:59
@7schmiede 7schmiede mentioned this pull request Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant