Skip to content

feat(cli): add areno runs command to list active/recent runs - #297

Open
wtbdev wants to merge 2 commits into
inclusionAI:mainfrom
wtbdev:feat/areno-runs
Open

feat(cli): add areno runs command to list active/recent runs#297
wtbdev wants to merge 2 commits into
inclusionAI:mainfrom
wtbdev:feat/areno-runs

Conversation

@wtbdev

@wtbdev wtbdev commented Jul 28, 2026

Copy link
Copy Markdown

Closes #250

Summary

Add areno runs — a lightweight CLI command that lists active and recent AReno train/serve runs from the existing ~/.areno/dashboard-jobs.json registry. No database, no new dependencies, no GPU imports.

Usage

areno runs               # terminal table (default)
areno runs --json        # machine-readable JSON
areno runs --limit 10    # show last 10 entries
areno runs --all         # show all entries

Output (table mode)

STATUS     KIND    NAME                  PID    AGE        DURATION
rollout    train   gspo Qwen/Qwen3-0.6B  12345  3m 12s ago 3m 12s
exited     serve   serve my-model        12344  1h 20m ago 1h 20m
succeeded  train   sft my-checkpoint     12300  2d 5h ago  45m 30s

What changed

File Change
areno/cli/dashboard_registry.py +218: public read_registry(), pid_is_running(), read_dashboard_state(), derive_status(), compute_age(), compute_duration(), format_table()
areno/cli/runs.py New: runs_command click command
areno/cli/main.py +1 line: register "runs" in _COMMANDS
tests/test_cli_runs_cpu.py New: 29 CPU tests

Status derivation

Condition Status
PID alive + stage info Stage name (e.g. rollout, train)
PID alive, no stage running
PID dead, dashboard state status=succeeded succeeded
PID dead, dashboard state status=failed failed
PID dead, dashboard state status=stopped stopped
PID dead, no state file exited

Status uses the status field written by the dashboard server's job watcher (not returncode, which is never persisted to disk).

Design decisions

  • Zero heavy imports — the command only depends on stdlib + click; no torch/engine/GPU needed
  • Shared utilities in dashboard_registry.py — PID check, age/duration formatting, status derivation, and table formatting live alongside the existing registry I/O so that future CLI commands (e.g. Compare two training runs from the CLI #255 areno diff) can reuse them without duplication
  • Duration uses wall-clock time — since updated_at is initialized to created_at at registration and never updated for CLI-started jobs, compute_duration() falls back to time.time() unless updated_at > created_at

Tests (29 CPU)

  • Age/duration formatting (6)
  • Status derivation: running, running+stage, succeeded, failed, stopped, exited, unknown (8)
  • Registry I/O: empty, malformed, missing file, PID dedup (4)
  • CLI integration: --json, --limit, --all, sorting, help output, table output (9)
  • Edge cases: missing pid field, wrong pid type (2)

--
🤖 Generated with Claude Code

@wtbdev
wtbdev force-pushed the feat/areno-runs branch 2 times, most recently from e2d6d2e to 07e2638 Compare July 28, 2026 07:57
…sionAI#250)

Add a lightweight CLI command that lists train/serve runs from the
existing ~/.areno/dashboard-jobs.json registry. No database, no new
dependencies, no GPU imports.

- areno/cli/dashboard_registry.py: add public read_registry(),
  pid_is_running(), read_dashboard_state(), derive_status(),
  compute_age(), compute_duration(), format_table()
- areno/cli/runs.py: click command with table (default) and --json output
- areno/cli/main.py: register "runs" subcommand
- tests/test_cli_runs_cpu.py: 29 CPU tests covering all statuses,
  output formats, edge cases (malformed JSON, missing fields, empty
  registry, PID deduplication)

Co-Authored-By: Claude <noreply@anthropic.com>
@wtbdev
wtbdev force-pushed the feat/areno-runs branch from 07e2638 to 3cada45 Compare July 28, 2026 08:51
- Add missing trailing newlines (W292)
- Sort imports (I001)
- Remove unused  (F401)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

List active and recent AReno runs in the terminal

1 participant