diff --git a/CHANGELOG.md b/CHANGELOG.md index 27bb5e8d..5d26c4e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,17 @@ and listed with their assets on the ## [Unreleased] +## [0.48.0] - 2026-11-16 + +The dashboard opens on a start page with every stack as a tile, a service +marked `shortcut = true` gets a card of its own with a large button that +opens it, and a running job shows that it runs and what it uses. Fixed: a +lane no longer lands on ports another stack claims for its lane on a node, +whether it starts here or on a node; the stacks' registry keeps an entry it +meets while another daemon replaces it; a machine the pool provisioned is +not given back the moment it enrols, nor right after a lease on it began; +the start page's tiles follow starts and stops from other tabs. + ### Added - **A start page with every stack as a tile.** The dashboard opens on it, and @@ -73,6 +84,9 @@ and listed with their assets on the registry with its claims. It reads the entry again first, and does not write over one that is there and does not read. An entry that reads and is no entry is no longer waited for. +- **The stacks list's filter survives a reload**, and picking a stack or a + worktree from the filtered list ends the filter, scrolled to keep the + pick in view. ## [0.47.0] - 2026-11-13 @@ -3482,7 +3496,8 @@ before are refused now, and a pool needs its nodes granted. a paused log view keeps its line limit; the folder dialog no longer stays "open" after the page gave up waiting. -[Unreleased]: https://github.com/nuetzliches/devstack/compare/v0.47.0...HEAD +[Unreleased]: https://github.com/nuetzliches/devstack/compare/v0.48.0...HEAD +[0.48.0]: https://github.com/nuetzliches/devstack/compare/v0.47.0...v0.48.0 [0.47.0]: https://github.com/nuetzliches/devstack/compare/v0.46.0...v0.47.0 [0.46.0]: https://github.com/nuetzliches/devstack/compare/v0.45.1...v0.46.0 [0.45.1]: https://github.com/nuetzliches/devstack/compare/v0.45.0...v0.45.1 diff --git a/Cargo.lock b/Cargo.lock index 60279eee..deb9c4a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -729,7 +729,7 @@ checksum = "9e9de72ce2ad1f90dc62fa25f0f430ef85eb4b0d8fa0be4f30373bc40a21d28e" [[package]] name = "devstack" -version = "0.47.0" +version = "0.48.0" dependencies = [ "anyhow", "bytes", @@ -763,7 +763,7 @@ dependencies = [ [[package]] name = "devstack-build" -version = "0.47.0" +version = "0.48.0" dependencies = [ "blake3", "devstack-config", @@ -779,7 +779,7 @@ dependencies = [ [[package]] name = "devstack-compose" -version = "0.47.0" +version = "0.48.0" dependencies = [ "devstack-config", "devstack-desktop", @@ -792,7 +792,7 @@ dependencies = [ [[package]] name = "devstack-config" -version = "0.47.0" +version = "0.48.0" dependencies = [ "globset", "regex", @@ -806,7 +806,7 @@ dependencies = [ [[package]] name = "devstack-daemon" -version = "0.47.0" +version = "0.48.0" dependencies = [ "axum", "blake3", @@ -840,7 +840,7 @@ dependencies = [ [[package]] name = "devstack-desktop" -version = "0.47.0" +version = "0.48.0" dependencies = [ "devstack-proc", "libc", @@ -861,7 +861,7 @@ dependencies = [ [[package]] name = "devstack-env" -version = "0.47.0" +version = "0.48.0" dependencies = [ "devstack-config", "tempfile", @@ -870,7 +870,7 @@ dependencies = [ [[package]] name = "devstack-hub" -version = "0.47.0" +version = "0.48.0" dependencies = [ "axum", "base64 0.23.1", @@ -910,7 +910,7 @@ dependencies = [ [[package]] name = "devstack-node" -version = "0.47.0" +version = "0.48.0" dependencies = [ "axum", "base64 0.23.1", @@ -947,7 +947,7 @@ dependencies = [ [[package]] name = "devstack-proc" -version = "0.47.0" +version = "0.48.0" dependencies = [ "libc", "mach2", @@ -960,7 +960,7 @@ dependencies = [ [[package]] name = "devstack-skills" -version = "0.47.0" +version = "0.48.0" dependencies = [ "anyhow", "devstack-config", diff --git a/Cargo.toml b/Cargo.toml index 57807924..70946581 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ members = ["crates/*"] exclude = ["spikes"] [workspace.package] -version = "0.47.0" +version = "0.48.0" edition = "2024" rust-version = "1.98" license = "MIT OR Apache-2.0" diff --git a/devstack.toml b/devstack.toml index 41ebddbb..2ac0b1e2 100644 --- a/devstack.toml +++ b/devstack.toml @@ -7,7 +7,7 @@ version = 1 [stack] name = "devstack" requires = "0.20.0" -reviewed = "0.47.0" +reviewed = "0.48.0" # A lane on another machine of the pool runs in this image (ADR-0028): the # dashboard needs Node.js only (CI builds it with Node 24). diff --git a/docs/adr/0106-a-running-job-is-running-and-measured.md b/docs/adr/0106-a-running-job-is-running-and-measured.md new file mode 100644 index 00000000..27a58b52 --- /dev/null +++ b/docs/adr/0106-a-running-job-is-running-and-measured.md @@ -0,0 +1,70 @@ +# ADR-0106: A running job is `running` and measured; it counts as done only when it completed + +- **Status:** Accepted (card in the pull request); built +- **Date:** 2026-11-16 +- **Deciders:** project owner +- **Related:** [ADR-0059](0059-a-services-stop-command-ends-what-its-run-started.md) (a job's `stop`), issue #544, pull request #547 + +## Context + +A `kind = "job"` (a migration, a seed, a training run of hours in a lane on +a node) showed `starting` for its whole run, with no CPU or memory: its +instance never became the slot's `main` (`start_locked` waited for it in +`wait_instance` as a local and ended it there), so `tree_usage` had nothing +to measure, and `starting` for hours read as stuck. A service waiting for +its health check was unmeasured the same way, for a shorter while. + +## Decision + +The owner approved the review card in the conversation on **2026-11-16**, +points 1 and 2: + +| # | Category | Point | Beats | Reversing costs | +|---|---|---|---|---| +| 1 | contract | A job's state is `running` from the launch of its process until it ends (was `starting`), in the API, the events, `status` (CLI, MCP) and the dashboard. | A new state (`working`) every client would have to learn | Clients that read a job's state; the dashboard's mock showed `running` already | +| 2 | contract | `devstack up` and a command's `requires` count a job as done only at `completed`, never at `running`. | `running` as ready, as for other services | Low | + +As built: + +1. **Usage** (`supervisor/mod.rs`, `lifecycle.rs`): a slot keeps what the + instance being started uses (`starting_usage`), sampled by + `wait_instance` every `NATIVE_EVERY` (as the usage sampler asks) while a + job runs or a service waits for its health check; `tree_usage` takes + `main`, else that, and the start clears it when it is over. A + candidate's wait notes nothing: its service's main is measured. +2. **State:** `start_locked` sets a job `running` right after `starting`. + `set_status_of` keeps the start's time for a job's `running`, so the + start's duration in the diagnostic log is still its run. +3. **Done:** dependants (`after`) waited for `completed` already; a + command's `requires` (`commands.rs`) and `up`'s follow (`client.rs`) + now do the same for a job. + +## Alternatives considered + +- **A phase inside `starting`** (`{ state: "starting", phase: "running" }`): + every client keeps reading `starting`, the point of the issue. +- **The node's measurement of a lease's containers** for a lane on a node: + it would show a lane's load, not which service causes it; left for later. + +## Consequences + +- A script that waited for a job's `starting` waits for `running` now + (three integration tests did). +- A job that runs is green ("Running") in the dashboard, like a service + without a health check. + +## Enforced by + +- `crates/devstack-daemon/src/supervisor/lifecycle.rs` (`start_locked`, + `wait_instance`), `supervisor/mod.rs` (`Slot::starting_usage`, + `tree_usage`, `set_status_of`), `state.rs` (`Status::Running`) +- `crates/devstack-daemon/src/commands.rs` (`requires`), + `crates/devstack/src/client.rs` (`up`'s follow) +- `crates/devstack/tests/daemon_lifecycle.rs` (`a_hanging_job_or_step_ends` + measures the running job), `supervisor/lifecycle.rs` tests (Windows) +- `docs/dashboard-api.md` + +## What this ADR does not say + +- That a job's usage history survives its end: it is gone with the job, as + a stopped service's. diff --git a/docs/adr/README.md b/docs/adr/README.md index 159e943c..406a0579 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -188,3 +188,4 @@ stay. | [0103](0103-a-pool-lease-waits-for-the-lanes-starting-on-a-node-to-settle.md) | A pool lease waits for the lanes starting on a node to settle rather than be refused | Accepted (card in the pull request); built | | [0104](0104-the-start-page-shows-every-stack-as-a-tile.md) | The start page shows every stack as a tile, with the hub's figures and the favourite programs | Accepted (card in the pull request); built | | [0105](0105-a-service-can-be-a-shortcut-card-on-the-overview.md) | A service can be a shortcut card on the overview, marked in the stack file | Accepted (card in the pull request); built | +| [0106](0106-a-running-job-is-running-and-measured.md) | A running job is `running` and measured; it counts as done only when it completed | Accepted (card in the pull request); built | diff --git a/docs/plan.md b/docs/plan.md index 8cf4db64..ceb40e03 100644 --- a/docs/plan.md +++ b/docs/plan.md @@ -1,7 +1,7 @@ # devstack: plan - **Status:** Active: phases 0 to 2 done (0.4.0), phase 3 done (lanes per worktree 0.7.0, each with its own infrastructure since 0.8.0, ADR-0030), phase 4 under way; the pool since 0.9.0: lanes on other machines, moved, shared, given the main ports; node policies, several pools, capacity over time, telemetry with consent (ADR-0025 to ADR-0037, 0.9.0 to 0.9.8; [pool.md](pool.md), §7.4, backlog §13); 0.10.0 (2026-10-18) carries the fixes of the review of 0.9.8: lanes confined on a node, nodes granted by an admin, the promotion gate and restore of ADR-0013/0016 as written, the hub's origin rules; 0.11.0 (2026-10-19): lanes that outlive the main tree's stop, keep their data on a node, run with a profile, and can be viewed when shared; a server updated by an admin (ADR-0038 to ADR-0041); 0.12.0 (2026-10-20): sharing a lane includes viewing it (ADR-0040 amended), a remote lane's containers controlled through its node, a dev server's rebuilds shown like builds (ADR-0042), a node's own lines in the pool's telemetry; 0.13.0 (2026-10-20): a dev server's fixed port is devstack's, forwarded to its instance (ADR-0043); 0.14.0 (2026-10-21): the pool places a lane where it starts warm (ADR-0026 point 3), where a lane starts without `--on` is the machine's choice (ADR-0025 amended), a lane's start on a node shows its phases; 0.15.0 (2026-10-21) carries the fixes of a review of the whole code base: a node runs the Compose model it checked, several agents share one engine, the supervisor keeps edits and stops, stack file paths stay in the repository; 0.16.0 (2026-10-21): desktop notifications from the hub and lanes of other members shown (ADR-0045), winget on Windows, a stack's folder opened in one's own programs (ADR-0046), the share switch removed (ADR-0031 amended); 0.17.0 (2026-10-21): a lane made from a branch in the dashboard (ADR-0047), containers on the main ports (ADR-0048), a lane's need measured where it ran, disk included (ADR-0049); 0.18.0 (2026-10-21): notices for what no request reports (ADR-0050), a lane whose worktree is removed shown while it goes (ADR-0024 point 7 amended); 0.19.0 (2026-10-22): a restart of the stack carries its lanes over (ADR-0052), the agent skills where the stack file says, a node's policy says what part of what is free it offers (ADR-0031 amended); 0.20.0 (2026-10-23): macOS in preview with Homebrew (ADR-0054), UDP ports of a lane on a node relayed (ADR-0056), announced ports moved with their lane (ADR-0057); 0.21.0 (2026-10-23): a tray icon on every desktop, a client of the hub (ADR-0060), profiles that leave out containers (ADR-0058), a service's `stop` command (ADR-0059); 0.22.0 (2026-10-24): the dashboard opens in its installed app (ADR-0061); 0.23.0 (2026-10-26): what `prepare` makes kept in a store per machine (ADR-0062), Compose told the lane (ADR-0064); 0.24.0 (2026-10-26): a lane on a node gets its worktree linked and a store on its node (ADR-0062, ADR-0063), the store warmed ahead for a ref (ADR-0065) and shown in the dashboard, its own telemetry through its requester; 0.25.0 (2026-10-27): a stop takes the containers too (ADR-0068), who changed the stack at runtime on record (ADR-0067), a measured CPU need capped (ADR-0066); 0.26.0 (2026-10-27): devstack's MCP server offered at setup, a lane's workers on a node, the memory check against Docker Desktop's VM; 0.27.0 (2026-10-28): a pool grows by provisioned machines (ADR-0051), MCP upstreams through the hub (ADR-0069), one timeline of events and the journal (ADR-0067), the dashboard writes no repository file (ADR-0071), a faster start (builds during the containers' start, a node's artifact store), where a lane starts compared (ADR-0036 addendum); 0.27.1 (2026-10-28): 0.27.0 published, its release had stopped at new advisories ([CHANGELOG](../CHANGELOG.md)) -- **Date:** 2026-10-14, status updated 2026-11-13 (0.47.0) +- **Date:** 2026-10-14, status updated 2026-11-16 (0.48.0) - **Inputs:** [problem-statement.md](problem-statement.md), [ADR index](adr/README.md) This document is the planning artefact. Decisions it relies on are recorded as @@ -1075,6 +1075,18 @@ node keeps its profile's workers (#522); a build after a superseded one no longer keeps what that one left half written (#523). The details are in the [changelog](../CHANGELOG.md). +**0.48.0 (2026-11-16): a start page, shortcut cards, and jobs that show they run.** +The dashboard opens on a start page with every stack as a tile +([ADR-0104](adr/0104-the-start-page-shows-every-stack-as-a-tile.md)); a +service marked `shortcut = true` is a card of its own +([ADR-0105](adr/0105-a-service-can-be-a-shortcut-card-on-the-overview.md)); +a running job is `running` and measured +([ADR-0106](adr/0106-a-running-job-is-running-and-measured.md), #544). +Fixed: a lane avoids the ports another stack claims for its lane on a node, +started here or on a node (#535, #539); the stacks' registry keeps an entry +met while it is replaced; a provisioned machine is not given back as it +enrols (#542). The details are in the [changelog](../CHANGELOG.md). + ## 8. Open questions | # | Question | Where it is tracked | diff --git a/ui/package-lock.json b/ui/package-lock.json index 144e3f8f..04fad187 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "devstack-dashboard", - "version": "0.47.0", + "version": "0.48.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "devstack-dashboard", - "version": "0.47.0", + "version": "0.48.0", "license": "MIT OR Apache-2.0", "dependencies": { "pinia": "4.1.0", diff --git a/ui/package.json b/ui/package.json index 12f63213..d878cc1e 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,7 +1,7 @@ { "name": "devstack-dashboard", "private": true, - "version": "0.47.0", + "version": "0.48.0", "license": "MIT OR Apache-2.0", "type": "module", "description": "Web dashboard for devstack, served by the hub",