Day-two operations¶
Check status¶
docker compose -f compose.yaml -f compose.prod.yaml ps
docker compose -f compose.yaml -f compose.prod.yaml logs --tail=100 agent
curl --fail http://127.0.0.1:8080/ready
The container health status is the application readiness check. SQLite is
critical; optional memory is not. Use /live only to distinguish an alive
process from a dependency-readiness failure.
Follow logs¶
docker compose -f compose.yaml -f compose.prod.yaml logs --follow agent
Blacki also appends OpenTelemetry log records to logs/blacki-telemetry.log and
spans to logs/blacki-traces.log on the host. Blacki keeps the active file
and one rotated backup for each signal. The dashboard reads their recent
records. See observability retention
for the size limits and how upgrades handle existing oversized files.
Restart¶
docker compose -f compose.yaml -f compose.prod.yaml restart agent
HTTP and ADK web sessions are in memory and reset. SQLite-backed tool state and mounted local memory remain.
Back up¶
The state directories are:
.adk_state/for SQLite-backed application data; anddata/for local runtime data and any retained legacy files.
For a consistent filesystem copy, briefly stop the service:
docker compose -f compose.yaml -f compose.prod.yaml stop agent
tar -czf blacki-state-backup.tgz .adk_state data
docker compose -f compose.yaml -f compose.prod.yaml start agent
Store the archive away from the VPS. Back up .env separately in an encrypted
secrets system; it contains credentials and is intentionally excluded from the
state archive.
Legacy Mem0 and Qdrant records remain outside live recall. Before a separate migration or deletion, inventory the configured collection, endpoint or volume, and backups. Verify ownership independently of legacy user IDs. To roll back, disable the wiki and preserve its database. Use a build with Mem0 disabled.
The private wiki now stores Markdown pages. The first start after this upgrade
drops the claim-based tables from wiki.db and migrates nothing, so copy
wiki.db before deploying if its contents matter. Restoring an older copy
restores its pages as they were. The wiki has no forget command, so remove
text from a page with a chat edit instead.
Upgrade a source-built deployment¶
- Read
CHANGELOG.mdand compare.env.examplefor new settings. - Back up state.
- Pull with fast-forward-only and rebuild:
git pull --ff-only
docker compose -f compose.yaml -f compose.prod.yaml up --build -d
docker compose -f compose.yaml -f compose.prod.yaml ps
- Inspect logs and the health payload.
Compose recreates the container without deleting the mounted state directories.
Upgrade a prebuilt-image deployment¶
Only use this path when the configured image tag and registry access are verified:
docker compose -f compose.yaml -f compose.prod.yaml pull
docker compose -f compose.yaml -f compose.prod.yaml up --no-build -d
docker compose -f compose.yaml -f compose.prod.yaml ps
Pin a release tag for reproducible upgrades. A floating branch tag trades convenience for weaker rollback guarantees.
Automated deployment safeguards¶
Pull requests that change application source or deployment inputs build the
production image and start it with compose.smoke.yaml. The smoke service uses
disposable container state, publishes no host port, and forces Telegram off so
validation cannot poll the production bot or execute scheduled reminders. It
does exercise the image entrypoint, ADK instrumentation, application startup,
SQLite initialization, and /ready. Model-provider and Telegram credentials
remain separate integration checks.
The main deployment workflow repeats that isolated startup check against the
exact image digest before stopping the active service. If the active deployment
is healthy, the workflow preserves its revision, environment, and image. A
failed promoted /ready check automatically restores that captured deployment.
The successful image digest is persisted as IMAGE in .env so later Compose
commands keep using the verified artifact.
Deployment credentials are serialized without Compose interpolation and staged in unique, private transfer directories. The workflow removes those temporary files after both successful and failed deployment attempts.
Automatic rollback is unavailable when no healthy service is running at the start of deployment. The workflow reports that condition explicitly instead of treating an unhealthy container as a safe rollback target.
Roll back¶
For a source build, switch to a known release tag or commit and rebuild. Restore the state archive only if the application data format changed or state was damaged; code rollback and data rollback are separate decisions.
For a prebuilt image, restore the previous image tag in .env and run:
docker compose -f compose.yaml -f compose.prod.yaml pull
docker compose -f compose.yaml -f compose.prod.yaml up --no-build -d
Remove containers without removing state¶
docker compose -f compose.yaml -f compose.prod.yaml down
This removes the service container and network. The bind-mounted
.adk_state/, data/, and logs/ directories remain on the host.