1.7 KiB
1.7 KiB
Runbook
Prerequisites
- Docker
- Docker Compose plugin
- GNU Make
No Python/Ansible/PostgreSQL/Redis installation is required on host machine.
Start
cp .env.example .env
make up
Stop
make down
Logs
make logs
Useful container shells
make api-shell
make db-shell
Dynamic workers
- There is no static
workerservice indocker-compose.yml. - When a job or test is launched, API starts an ephemeral runner runtime.
- Each runner contains a mini FastAPI service (
app/runner/main.py) for direct HTTP/WS communication. dockermode: API requires Docker socket access (/var/run/docker.sock).k8smode: API requires Kubernetes API access and RBAC rights to create Pod/Service inAPP_K8S_NAMESPACE.
Selecting runtime mode
- Jobs:
POST /api/v1/jobs/launchwithruntime_mode(dockerork8s). - Tests:
POST /api/v1/tests/launchwithruntime_mode(dockerork8s).
Runner lifecycle safety
- Runner is auto-stopped by API when run reaches terminal state.
- Heartbeat is updated while API can poll runner status.
- Timeout and fail-safe cleanup are controlled by:
APP_RUNNER_POLL_INTERVAL_SECAPP_RUNNER_TIMEOUT_SECAPP_RUNNER_MAX_POLL_ERRORS
- Active runner list endpoint:
GET /api/v1/runners/active. - Manual runner stop endpoint:
POST /api/v1/runners/{runner_name}/stopwith body{ "runtime_mode": "docker" | "k8s" }.
Realtime test logs
- Launch test via
POST /api/v1/tests/launch. - Follow logs via WebSocket endpoint
/ws/tests/{test_id}.
Database bootstrap
Schema bootstrap SQL file is stored in app/sql/001_init.sql and is mounted to PostgreSQL init directory by docker-compose.yml.
To apply it manually:
make migrate