Skip to content

Add Supabase status publisher and GitHub Pages dashboard#2

Merged
daharoni merged 5 commits intomainfrom
feat/supabase-dashboard
Mar 9, 2026
Merged

Add Supabase status publisher and GitHub Pages dashboard#2
daharoni merged 5 commits intomainfrom
feat/supabase-dashboard

Conversation

@daharoni
Copy link
Member

@daharoni daharoni commented Mar 9, 2026

Summary

  • Supabase schema (supabase/migrations/): benches, bench_status_current, bench_events tables with RLS policies and a bench_dashboard view with stale heartbeat detection
  • Publisher package (src/hilbench/publisher/): exception-safe Supabase client with lazy init, hook functions for flash/health events, and a systemd-compatible heartbeat loop
  • CLI (benchctl publish status|heartbeat|config): one-shot publish, continuous heartbeat, and config display subcommands
  • Hook integration: flash_cmd.py and health_cmd.py call publisher hooks wrapped in try/except (ImportError, Exception) — no-op without the supabase package
  • React dashboard (dashboard/): Vite + TypeScript + Pico CSS with email/password auth gate, bench table with color-coded status badges, 15s polling
  • GitHub Actions: dashboard-ci.yml (lint/typecheck/build on PR) and deploy-dashboard.yml (tag-based dashboard-v* GitHub Pages deployment)
  • Bootstrap: install_publisher.sh script; bootstrap_pi.sh accepts optional Supabase URL/key args (positions 3-4)
  • Docs: docs/dashboard-setup.md (setup guide) and docs/publisher-architecture.md (design overview)

Test plan

  • ruff check src/ tests/ — all checks passed
  • ruff format --check src/ tests/ — 37 files formatted
  • mypy src/hilbench/ — 24 source files, no issues
  • pytest tests/ -m "not hardware" — 75/75 tests pass (22 new publisher tests)
  • cd dashboard && npm run typecheck && npm run build — typecheck and build succeed
  • Run migration SQL against a test Supabase project
  • Create bench user, run benchctl publish status, verify row in bench_status_current
  • Run benchctl publish heartbeat, verify heartbeat updates
  • Log into dashboard, verify bench appears with state and health
  • Tag dashboard-v0.1.0, verify Pages deployment workflow

🤖 Generated with Claude Code

daharoni and others added 5 commits March 9, 2026 15:03
Adds remote bench monitoring via Supabase with a React dashboard so
operators can view bench health, state, and heartbeat freshness from
anywhere. The publisher is opt-in — benches without Supabase credentials
continue working unchanged.

- Supabase schema: benches, bench_status_current, bench_events tables
  with RLS policies and a bench_dashboard view
- Publisher package (hilbench.publisher): exception-safe client with
  lazy init, hook functions for flash/health events, heartbeat loop
- CLI: `benchctl publish status|heartbeat|config` subcommands
- Hook integration: flash_cmd and health_cmd call publisher hooks
  (import-guarded, no-op without supabase package)
- Dashboard: React + Vite + TypeScript + Pico CSS with auth gate,
  bench table, status badges, 15s polling
- GitHub Actions: dashboard-ci (lint/typecheck/build on PR) and
  deploy-dashboard (tag-based GitHub Pages deployment)
- Bootstrap: install_publisher.sh script, bootstrap_pi.sh accepts
  optional Supabase URL/key args
- 22 new tests (75 total), all passing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract results_to_dicts() helper to deduplicate CheckResult
serialization across 4 call sites. Move heartbeat import to module
level, narrow exception handling from Exception to ImportError in CLI
hooks, and stop mutating os.environ in config loader.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add explicit step for creating read-only viewer accounts in the
dashboard setup guide and fix stale exception reference in
architecture doc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@daharoni daharoni merged commit 73c22a3 into main Mar 9, 2026
3 checks passed
@daharoni daharoni deleted the feat/supabase-dashboard branch March 9, 2026 23:21
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