status
status
¶
Status service - reads job metadata from status_dir.
The status directory structure (created by bootstrap.py): status_dir/ {project}/ {group}/ {job_name}/ {run_id}/ metadata.json output.log
StatusService(status_dir: Path)
¶
Service for reading job status from the filesystem.
When a JobCache is attached (via set_cache), list operations are served
from the in-memory cache instead of walking the filesystem on every request.
Single-job lookups still hit the filesystem for maximum freshness.
set_cache(cache) -> None
¶
Attach a JobCache instance to serve list queries from memory.
list_all_jobs(project: Optional[str] = None, group: Optional[str] = None, status: Optional[JobStatus] = None, limit: int = 100) -> list[JobMetadata]
¶
List all jobs, optionally filtered by project/group/status.
Jobs are returned sorted by start_time (most recent first).
get_job(project: str, group: str, name: str, run_id: str) -> Optional[JobMetadata]
¶
Get a specific job by its identifiers.
Always reads from filesystem for maximum freshness on detail pages. Falls back to cache if the filesystem read fails or file is missing.
get_job_runs(project: str, group: str, name: str) -> list[JobMetadata]
¶
Get all runs for a specific job name.
list_projects() -> list[ProjectSummary]
¶
List all projects with summary stats.
get_running_jobs() -> list[JobMetadata]
¶
Get all currently running jobs, excluding stale ones (no heartbeat >5min).
get_recent_jobs(hours: int = 24, limit: int = 50) -> list[JobMetadata]
¶
Get jobs started within the last N hours.
get_dashboard_stats() -> DashboardStats
¶
Get aggregated stats for the dashboard.
delete_job(project: str, group: str, name: str, run_id: str) -> bool
¶
Delete a specific job run. Returns True if successful.