1.1 KiB
1.1 KiB
Backend Architecture (MVP)
Stack
- FastAPI
- PostgreSQL + asyncpg
- Celery + Redis
- Jinja2 + HTMX-ready templates
Execution flow
- API receives a launch request and creates a job (
queued). - API starts an ephemeral runner runtime (
dockercontainer ork8spod/service) with mini FastAPI service. - API sends run payload directly to runner over HTTP (
/runs/*endpoints). - Runner executes
ansible-playbookormolecule test. - Main API monitors runner status with heartbeat/timeout and persists logs/status to DB.
- WebSocket clients subscribe to
/ws/jobs/{job_id}and/ws/tests/{test_id}; API proxies realtime logs from runner WS.
Test runs (Molecule)
- Test launch endpoint supports playbook tests and role tests.
- Runtime creates dynamic ephemeral inventory based on requested host blueprint.
- Each test run is isolated in its own dynamic runner runtime.
Security
- JWT access token + refresh token
- Password hash via
passlib - Password reset token flow
Runtime modes
docker: runner starts as ephemeral container over Docker socket.k8s: runner starts as ephemeral pod + ClusterIP service in configured namespace.