Skip to content

Latest commit

 

History

History
73 lines (53 loc) · 3.06 KB

File metadata and controls

73 lines (53 loc) · 3.06 KB

Rootstock Admin

Admin backend for the Rootstock project. This is a Modal app that collects and displays environment manifests from Rootstock deployments across different clusters.

Overview

Rootstock Admin provides a central dashboard for monitoring Rootstock installations. Clusters periodically report their environment configurations via POST requests, and the dashboard displays this information in a web UI.

Endpoints

Environment Endpoint URL
Dev Dashboard https://garden-ai-dev--rootstock-admin-dashboard.modal.run
Dev Manifest API https://garden-ai-dev--rootstock-admin-manifest.modal.run
Dev Usage API https://garden-ai-dev--rootstock-admin-usage.modal.run
Prod Dashboard https://garden-ai-prod--rootstock-admin-dashboard.modal.run
Prod Manifest API https://garden-ai-prod--rootstock-admin-manifest.modal.run
Prod Usage API https://garden-ai-prod--rootstock-admin-usage.modal.run

Manifest API POST

Receives and stores environment manifests from Rootstock clusters. Requires proxy authentication.

Payload: JSON manifest containing cluster name, rootstock version, Python version, maintainer info, and environment details.

Usage API POST

Receives anonymous usage rollups from Rootstock clusters (rootstock#47). Requires proxy authentication.

Payload: {"cluster": "<name>", "rows": [...]} where each row is a monthly rollup row as produced by rootstock usage report — keyed by month/cluster/env/checkpoint/device/client with sessions, n_calculations, duration_s, and unique_users counts. Rollups are stored per cluster per month; a push replaces only the months it contains, so previously reported months persist even if the cluster's local spool has been purged. User hashes never leave the cluster — only derived counts — and any users field sent by mistake is dropped on ingest.

Dashboard GET

Public dashboard displaying all registered clusters and their environments. Shows:

  • Cluster metadata (name, version, root path, maintainer)
  • Environment status, dependencies, source code, and checkpoints

GET /usage returns every stored usage rollup: {"usage": [{"cluster": ..., "month": ..., "rows": [...]}, ...]}.

Development

Prerequisites

  • Python 3.12+
  • uv for dependency management
  • Modal account and CLI configured

Setup

uv sync

Run locally

modal serve modal_app.py

Deploy

# Development
modal deploy modal_app.py

# Production
modal deploy --env=prod modal_app.py

The app uses separate Modal volumes for dev and prod environments (rootstock-admin-dev and rootstock-admin-prod).

Project Structure

├── modal_app.py              # Modal app with manifest and dashboard endpoints
├── templates/
│   └── index.html.jinja      # Dashboard template
├── pyproject.toml
└── uv.lock