Facility-aware placement: racks, PDUs, holds and power caps

Nodes say where they are with llmgw.io/site, room, row, rack and pdu labels,
from agent.yaml or `llmgw ctl label` (kept in the store, over the agent's).
Placement spreads a model's replicas across racks and PDUs, keeps a
multi-node replica within one domain when its profile says keep_within,
places nothing in a domain held with `llmgw ctl facility hold` (optionally
draining it), and refuses a shard that would take a domain past its power
cap from facility.budgets, counting declared, derived and measured draw.
Explain-placement names the domain, and keeps the rejections of a placed
replica; `ctl nodes` gains LOCATION and --domain; `ctl facility` lists the
domains; the console's Nodes view shows and sets location and holds.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-05 01:17:49 +02:00
1 parent d41104a452
commit 0d3eb82b9b
42 files changed
+3510 -63

No files matched your search

+15 -3
View File
@@ -1041,11 +1041,11 @@ func (m consoleModel) panel() (title, body, keys string) {
if n.Load != nil {
cpu, mem = fmt.Sprintf("%.0f%%", n.Load.CPUPercent), fmt.Sprintf("%.0f%%", n.Load.MemPercent)
}
state := n.State
state := stateColumn(n)
if state != "ready" {
state = sWarn.Render(state)
}
rows = append(rows, []string{n.ID, state, cpu, mem, fmt.Sprintf("%d/%d", n.GPUFree, n.GPUTotal),
rows = append(rows, []string{n.ID, state, locationColumn(n), cpu, mem, fmt.Sprintf("%d/%d", n.GPUFree, n.GPUTotal),
strconv.Itoa(n.Replicas), fmt.Sprintf("%d/%d GB", n.DiskFreeGB, n.DiskTotalGB), n.AgentVersion, n.LastSeenAgo})
}
t := "Nodes"
@@ -1055,7 +1055,7 @@ func (m consoleModel) panel() (title, body, keys string) {
if m.inPanel {
keys = rowKeys
}
return t, "\n" + table([]string{"NODE", "STATE", "CPU", "MEM", "GPU FREE", "REPLICAS", "DISK FREE", "AGENT", "SEEN"},
return t, "\n" + table([]string{"NODE", "STATE", "WHERE", "CPU", "MEM", "GPU FREE", "REPLICAS", "DISK FREE", "AGENT", "SEEN"},
rows, m.row, pw, m.inPanel), keys
case cGPUs:
if m.inPanel {
@@ -1299,6 +1299,18 @@ func (m consoleModel) nodeDetail(n adminapi.NodeView) string {
kv := func(k, v string) { fmt.Fprintf(&b, " %-14s %s\n", sDim.Render(k), v) }
b.WriteString("\n")
kv("state", n.State)
if n.Location != nil {
where := []string{}
for _, d := range n.Location.Domains() {
where = append(where, d.Human())
}
kv("location", strings.Join(where, " · "))
} else {
kv("location", sDim.Render("not labelled: Enter, then Location…"))
}
if n.Held != "" {
kv("held", sWarn.Render(n.Held))
}
kv("address", n.MgmtAddr)
kv("system", n.OS)
kv("agent", n.AgentVersion+", seen "+n.LastSeenAgo+" ago")