Watch
0
0
Fork
You've already forked hyperhive
0

dashboard: the hive UI no longer shows container load

The cpu, memory and disk figures are exported as OTEL metrics and graphed in Grafana, and the caps are set in the swarm UI, so the C0NT41N3R L04D tab on the C0R3 page only duplicated both. C0R3 is now the kept-state page alone, without a tab strip.
This commit is contained in:
iris 2026-10-14 23:27:57 +02:00 • committed by mara
commit a2540be98b
11 changed files with 52 additions and 515 deletions

View file

@ -74,13 +74,17 @@ agent is stale.
Passive / rare-interaction state, reached from the **Core** tile on the
H0M3 hub (served at
`/core.html`), with the same minimal chrome as `/builds.html`: a `← home`
back-link + a `createTabStrip` sub-tab nav (**K3PT ST4T3** default,
then **C0NT41N3R L04D**). The page is its own esbuild bundle (`core.js`)
that cold-loads `/api/state` and subscribes to `/api/dashboard/stream` for
`tombstones_changed`, `capabilities_changed`, and `tool_groups_changed`
(the latter two re-render the stale-perms sub-section when permission
data changes). (Rebuild queue and meta inputs live on the BU1LDS
page — see below.)
back-link and a single pane, **K3PT ST4T3**. The page is its own esbuild
bundle (`core.js`) that cold-loads `/api/state` and subscribes to
`/api/dashboard/stream` for `tombstones_changed`, `capabilities_changed`,
and `tool_groups_changed` (the latter two re-render the stale-perms
sub-section when permission data changes). (Rebuild queue and meta inputs
live on the BU1LDS page — see below.)
Per-container CPU, memory and disk load is not shown in the hive UI. The
same figures are exported as OTEL metrics and graphed in Grafana (see
[observability](../scheduler/observability.md)). An agent's CPU and memory
caps are set per agent in the swarm UI.
**K3PT ST4T3** — two sub-sections on one pane:
@ -102,32 +106,11 @@ snapshot-storage rework where the problem changes shape.
*Stale permission entries*: agents with explicit capability or
tool-group JSON entries but no live container — typically renamed or
deleted agents whose entries persisted in `capabilities.json` /
`tool-groups.json`. Lazy-loaded on first K3PT ST4T3 tab activation;
`tool-groups.json`. Loaded when the page opens;
autorefreshes on `capabilities_changed` + `tool_groups_changed` SSE
events. Each ghost agent gets a `✕ clear perms` button
(`DELETE /api/permissions/{name}`).
**C0NT41N3R L04D** — live CPU + memory per agent container, read
straight from cgroup v2 on the host (`cpu.stat`, `memory.current`,
`memory.peak`, `memory.max` under
`/sys/fs/cgroup/machine.slice/machine-h\x2d<name>.scope/`). CPU is a
host-normalised percentage (0..100 across all cores) sampled over a
short (~200 ms) two-read interval; memory shows current + peak with a
bar against the `memory.max` quota. Backed by
`GET /api/container-resources` (`container_stats.rs`), which reads the
files read-only (world-readable; no `hive-priv`) and skips agents whose
scope dir is absent (= not running). Pull-only: `core.js` polls every
5 s **only while the C0NT41N3R L04D sub-tab is active** (CPU needs a fresh
sample each refresh), and stops on sub-tab change. Disk size (`disk_bytes`)
rides the same row, but a separate background sampler feeds it every
30 min: `hive-priv` runs one bounded `du -x` as root over the agent's
`state/` + `work/` + container writable rootfs (shared nix store excluded),
so the 5 s poll stays cheap cgroup-only reads. The row carries the last
measured value; the column shows "unknown" (`null`) before the first
measurement and whenever the last one failed, never 0. Network isn't tracked
per container — see `docs/networking/network.md` for the current
per-agent netns model.
## BU1LDS page (`/builds.html`)
The build lifecycle hub — rebuild queue, live build log, meta inputs,
@ -765,17 +748,6 @@ below — some endpoints aren't in it yet.
zero-turn dbs); returns swarm totals, a busiest-first per-agent
rollup, swarm model mix, and a labelled `est_cost_usd`. Window
defaults to `24h`.
- `GET /api/container-resources` — live per-agent-container CPU +
memory from cgroup v2 (C0R3 › C0NT41N3R L04D panel). Returns one
row per running agent (`name`, `cpu_pct`, `mem_current_bytes`,
`mem_peak_bytes`, `mem_max_bytes`, `disk_bytes`); samples CPU over
~200 ms so the call briefly awaits. Skips non-running agents (no scope
dir). No network field — agents share the host netns. `disk_bytes` is
the last value from a **separate slow sampler** (not this hot path):
every 30 min `hive-priv` runs a bounded `du -sxb` as root over the agent's
`state/` + `work/` + container writable rootfs, `-x` excluding the shared
read-only nix store (`PrivRequest::MeasureAgentDisk`). `null` means
unknown: not measured yet, or the last measurement failed.
- `POST /api/cancel-reminder/{id}` — hard-delete a pending reminder.
- `POST /api/retry-reminder/{id}` — re-arm a reminder whose delivery
failed (clears the failure state so the scheduler retries).