Skip to content

DX: local-dev safety + launched_by tier + pending status#28

Merged
robmsmt merged 1 commit into
mainfrom
dx-local-safety-and-pending-status
May 20, 2026
Merged

DX: local-dev safety + launched_by tier + pending status#28
robmsmt merged 1 commit into
mainfrom
dx-local-safety-and-pending-status

Conversation

@robmsmt
Copy link
Copy Markdown
Contributor

@robmsmt robmsmt commented May 20, 2026

Summary

  • Tier badge now data-driven: getTierFromLaunchedBy(launched_by) replaces the hardcoded modelMetrics.ts model list. launched_by ∈ {k8s, cscs_L1} → 24/7, anything else → Slurm. Same logic backs the badge in ModelCard and the filter pills in ModelList.
  • Pending status visible at a glance: traffic-light dot (green/amber-pulsing/grey) next to the model name + muted-grey tile (grayscale logo & badges, gray-500/400 text, faint bg) on cards where any replica is pending. Amber dot stays vivid against the greyed body.
  • Local-dev guards in Makefile: _guard-local-db and _guard-local-api refuse make run / make dummy-run / make migrate if .env's DATABASE_URL or frontend/.env's VITE_API_URL points at a non-localhost host. Closes the foot-gun where prod creds in .env let make dummy-run attempt alembic upgrade head against prod Neon (which is what triggered this PR).
  • .env.example templates committed (with !.env.example exemption in .gitignore) so a fresh clone bootstraps cleanly. frontend/.env.example is VITE_*-only — backend secrets no longer belong there.
  • Dummy-run fixture: 6 real k8s peer entries pulled from prod DNT added to dnt_table_dev_live.json, alongside the existing Slurm jobs (one pending), so the UI shows the full badge / dot / greyed-tile matrix offline.

Test plan

  • make check passes (ruff clean)
  • pytest backend/tests/ — 35 passing
  • make dummy-run succeeds (used to fail at the guard against prod URL in .env)
  • In make dummy-run UI: 24/7 badge on k8s entries, Slurm badge on rosmith/ahadinia entries, amber pulsing dot + greyed tile on the pending one
  • Swap frontend/.env's VITE_API_URL to prod → make dummy-run refused by _guard-local-api
  • Swap .env's DATABASE_URL to prod → make dummy-run refused by _guard-local-db

🤖 Generated with Claude Code

Frontend
- Tier (24/7 vs Slurm badge) now derived from the peer's launched_by
  label instead of a hardcoded model list. Persistent launchers
  (k8s, cscs_L1) → 24/7; anything else (username from model-launch,
  empty) → Slurm. New helper getTierFromLaunchedBy replaces
  getModelTier in ModelCard and ModelList.
- Pending status surfaces on the collapsed card via a traffic-light
  dot (green/amber+pulsing/grey) AND a muted-grey tile treatment
  (grayscale logo+badges, gray-500/400 text, faint background wash).
  Amber dot stays vivid against the grey card.

Local-dev safety
- Makefile guards _guard-local-db and _guard-local-api refuse to run
  if .env DATABASE_URL or frontend/.env VITE_API_URL points at a
  non-localhost host. Closes a foot-gun where prod creds in .env let
  `make dummy-run` attempt alembic upgrade head against prod Neon.
- Committed .env.example and frontend/.env.example templates (with
  !.env.example in .gitignore so the un-ignore actually works) so a
  fresh clone bootstraps cleanly via `make run`.

Fixture
- dnt_table_dev_live.json gains 6 real k8s peer entries pulled from
  prod DNT, so `make dummy-run` shows a representative mix of k8s
  24/7 models + Slurm jobs (incl. a pending one) for UI iteration.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@robmsmt robmsmt merged commit 1d0ac10 into main May 20, 2026
2 checks passed
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