4ff31557a8
Trainer: `parking-trainer serve` — a stdlib HTTP job API on the compose network (never
published): /health, /readiness, /versions, /versions/<v>/report, /jobs. One job at a
time; each job runs the CLI as a subprocess with its output captured, state + log
persisted under /out/jobs/ so a restart keeps history. `publish` takes its URL from
TRAINER_PUBLISH_URL. Dockerfile: CMD serve, EXPOSE 8091, healthcheck.
Collector: COLLECTOR_TRAINER_URL + /api/training/{status,jobs,jobs/:id,versions/:v/report}
— a reviewer-gated proxy that forwards a fixed set of paths and whitelisted knobs and
passes the trainer's status codes through (409 while a job runs; 503 unconfigured, 502
unreachable). /review gains the Training section: labels per class vs the minimum with
Train disabled until two classes clear it, mode / backbone / floor, the running job's
live log, the versions with Report / Evaluate / Publish (publish confirms), and the
reminder that pinning stays a git commit. Fixed on the way: an apostrophe in the page's
inline script broke the whole page — a test now parses the script.
Compose: `trainer` is a service (restart: unless-stopped, read-only data volume, its own
trainer-out volume), the `train` profile and TRAINER_OUT are gone; the Docker-socket
route was rejected (root on the host for a service booths upload to). Verified with both
images running together: a Train started through the proxy finished, version and report
came back, the page rendered.
Wiki: bodytype-classifier-training (loop, running it, operating notes superseded),
vision-review-outbox, fleet-deployment-komodo, log.
Claude-Session: https://claude.ai/code/session_01FWncR69HgGPuei1dLrW3cU
52 lines
2.7 KiB
YAML
52 lines
2.7 KiB
YAML
# The Car Wash REVIEW COLLECTOR — deployed on the REVIEWER's host (art-docker-station), NOT
|
|
# on a booth. Its own Komodo stack ("wash-collector" in komodo/resources.toml) points at this
|
|
# file alone, so nothing here reaches a booth and nothing of the booth stack reaches this
|
|
# host. See wiki/concepts/vision-review-outbox.md.
|
|
#
|
|
# Reachability: booths POST to /ingest over the Netbird overlay only. Bind the published
|
|
# port to the host's OVERLAY address (COLLECTOR_BIND), never 0.0.0.0 on a host that also
|
|
# has a public interface. The Netbird policy should allow booths → this host:8090 and
|
|
# nothing else on it.
|
|
|
|
services:
|
|
collector:
|
|
image: ${REGISTRY:-git.infra.msai.al/mca/parking_solution}/parking-collector:${TAG:-dev}
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${COLLECTOR_BIND:-127.0.0.1}:8090:8090"
|
|
environment:
|
|
# "<boothId>:<token>" pairs — one per booth, the booth's CARWASH_REVIEW_TOKEN under its
|
|
# pseudonymous CARWASH_REVIEW_BOOTH_ID. A Komodo secret reference in the stack env.
|
|
COLLECTOR_BOOTH_TOKENS: ${COLLECTOR_BOOTH_TOKENS:?set COLLECTOR_BOOTH_TOKENS in the stack env}
|
|
# The single reviewer login (HTTP Basic over the overlay).
|
|
COLLECTOR_REVIEWER_USER: ${COLLECTOR_REVIEWER_USER:-reviewer}
|
|
COLLECTOR_REVIEWER_PASS: ${COLLECTOR_REVIEWER_PASS:?set COLLECTOR_REVIEWER_PASS in the stack env}
|
|
LOG_LEVEL: ${LOG_LEVEL:-info}
|
|
# The trainer's job API (sibling service above). Unset = no Training section.
|
|
COLLECTOR_TRAINER_URL: ${COLLECTOR_TRAINER_URL-http://trainer:8091}
|
|
volumes:
|
|
- collector-data:/data
|
|
|
|
# Phase B trainer — a small always-on job service beside the collector (CPU-only torch;
|
|
# idle it is a tiny Python HTTP server, torch loads only when a job runs). It reads the
|
|
# collector's SQLite + crops off the same volume (read-only) and keeps models, reports and
|
|
# job logs in its own volume. NOT published: only the collector reaches it, on this compose
|
|
# network, and the reviewer's login on the collector is the gate. The Training section of
|
|
# /review is its UI (readiness, Train / Evaluate / Publish, reports, logs).
|
|
# See wiki/decisions/bodytype-classifier-training.md.
|
|
trainer:
|
|
image: ${REGISTRY:-git.infra.msai.al/mca/parking_solution}/parking-trainer:${TAG:-dev}
|
|
restart: unless-stopped
|
|
environment:
|
|
# Where `publish` PUTs a passing model (a Gitea generic package) and the token it uses
|
|
# (package:write). Only publishing needs the token; training runs without it.
|
|
TRAINER_PUBLISH_URL: ${TRAINER_PUBLISH_URL:-https://git.infra.msai.al/api/packages/mca/generic/parking-bodytype}
|
|
TRAINER_PUBLISH_TOKEN: ${TRAINER_PUBLISH_TOKEN:-}
|
|
volumes:
|
|
- collector-data:/data:ro
|
|
- trainer-out:/out
|
|
|
|
volumes:
|
|
collector-data:
|
|
trainer-out:
|