f7a262ac9a
Build & push images / images (push) Successful in 6m31s
apps/trainer (parking-trainer): inspect / train / evaluate / publish. Reads the wash collector's SQLite + crops read-only off its volume; time split (validation = newest slice); thin classes dropped; damped class weights; `features` mode (frozen ImageNet backbone, on-disk feature cache, seconds to retrain) and `finetune` mode (light augmentation). CPU-only torch from PyTorch's wheel index. ONNX export checked against the torch model; NO model file below the validation floor (exit 3, report still written); exit 2 = not enough labels. `evaluate` scores a shipped model on labels reviewed after training + the unlabelled pile; `publish` PUTs a version folder to a Gitea generic package. Light core deps; the `train` extra is heavy — CI syncs without it, torch tests skip. apps/vision: BodyTypeClassifier (bodytype.onnx + sidecar = the preprocessing contract: crop margin, input size, RGB 0-255, normalisation inside the graph) and RefinedVehicleDetector over YOLOX — refines only `car` or a class the classifier trained on, min-confidence, `detector_class` on the result; path set but no file = phase B off without an error; a broken file is a health detail. models/bodytype.version (tracked, empty) pins the published version the Dockerfile fetches at build (BuildKit secret; a pin that cannot be fetched fails the build). Verified: a trainer model gives identical probabilities inside the vision service; both images built and smoke-tested. Delivery: parking-trainer image in build-images.yml, the `trainer` compose profile on the collector stack (CPU, read-only data, TRAINER_OUT), commented TRAINER_OUT/PUBLISH_TOKEN in the wash-collector stack, .dockerignore for both Python contexts, trainer deps synced in CI. Wiki: bodytype-classifier-training rewritten as built (+ one fleet model not per site, secrets/access, where the crops live), opencv-anpr-service §Phase B, vision-review-outbox, vision-service-packaging, fleet-deployment-komodo, index, log. Claude-Session: https://claude.ai/code/session_01FWncR69HgGPuei1dLrW3cU
63 lines
2.3 KiB
YAML
63 lines
2.3 KiB
YAML
name: CI
|
|
|
|
# Lint/typecheck/test the whole Turborepo on every push/PR to dev. Mirrors the
|
|
# house pattern (cf. trm/processor): setup-node + corepack pnpm + frozen install.
|
|
# No Docker, no signing — pure checks. The desktop bundle is a separate, tag-only
|
|
# pipeline (see release.yml).
|
|
|
|
on:
|
|
push:
|
|
branches: [dev]
|
|
pull_request:
|
|
branches: [dev, main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node 22
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Enable pnpm
|
|
# Pin to the repo's packageManager version (pnpm 10), not latest.
|
|
run: corepack enable && corepack prepare pnpm@10.24.0 --activate
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Set up uv (Python toolchain for @parking/vision)
|
|
# The vision service is a Python package wired into the Turbo graph via a
|
|
# package.json shim; its lint/typecheck/test scripts shell to `uv run …`. CI
|
|
# has no Python by default, so `uv run` would fail with "uv: not found" and
|
|
# break the whole Turbo run. Install uv via its official standalone script
|
|
# (the Gitea runner can't reliably resolve astral-sh/setup-uv); uv provisions the
|
|
# pinned Python (.python-version) itself. See wiki/decisions/vision-service-packaging.md.
|
|
run: |
|
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Sync vision deps
|
|
# Light deps + the dev group (ruff/mypy/pytest) only — NOT the optional `alpr`
|
|
# extra (heavy onnx/model stack), which isn't needed to lint/typecheck/test.
|
|
working-directory: apps/vision
|
|
run: uv sync --frozen
|
|
|
|
- name: Sync trainer deps
|
|
# Same rule: light core only, not the `train` extra (CPU torch); torch tests skip.
|
|
working-directory: apps/trainer
|
|
run: uv sync --frozen
|
|
|
|
- name: Build + lint (Turbo)
|
|
# Covers tsc typecheck, vite build, i18n catalog type-parity (a missing sq/en
|
|
# key fails the build), AND the vision service's ruff lint via uv.
|
|
run: pnpm turbo run build lint
|
|
|
|
- name: Test
|
|
run: pnpm turbo run test
|