Skip to content

feat(selfhost): run maintenance jobs inside the API container - #21

Open
jiashuoz wants to merge 2 commits into
mainfrom
feat/selfhost-maintenance
Open

jiashuoz wants to merge 2 commits into
mainfrom
feat/selfhost-maintenance

Conversation

@jiashuoz

@jiashuoz jiashuoz commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Self-hosted installs currently run no maintenance, so deleted content is never reclaimed. Start the scheduler inside the API container using the API's database, object store, and environment. Run the four maintenance jobs serially on their UTC cadence, persist catch-up state, and bound child execution with process-group shutdown.

The quickstart smoke now proves the scheduler records a tick and executes every scheduled job. README and operator commands describe the behavior.

Validation:

  • uv sync --frozen
  • NO_PROXY='*' no_proxy='*' .venv/bin/pytest -q tests/test_jobs_scheduler.py tests/test_selfhost_compose.py tests/test_supervisor_local_env.py — 71 passed
  • .venv/bin/ruff check — passed
  • python3 scripts/check_public_snapshot.py — clean
  • git diff --cached --check — passed

The Docker quickstart and full matrix require CI; the local Docker daemon cannot reach registries. Independent and adversarial reviews are complete. Both identified premature batch checkpointing; the adversarial pass also identified missing cancellation handlers for manual runs. Both are fixed in a separate commit, with regression tests observed failing before the fixes and passing afterward. An independent reviewer reran the scheduler suite (56 passed). This carries the existing scheduler implementation into the public source tree ahead of v0.1.0; no API/schema changes. The carry-over is byte-identical to the filtered snapshot except the two review fixes. Governing extraction design: §4.9 and rollout §5; release/tag approval remains separate.

Run garbage collection and usage maintenance on a persisted UTC schedule alongside the API, with bounded catch-up and process-group shutdown. Extend the quickstart smoke to prove the scheduler and all four jobs.
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.

2 participants