-
feat(douanier): CPU deploy image + conform to the nech.pl platform contract (#37) · 722daded
The SRE edge is live (api.nech.pl returns 503 warming_up); the only thing blocking a green healthz was a CPU-deployable image. This ships it, and folds in the SRE's platform reframe that landed in the same letter. Baseline image - Dockerfile: python:3.12-slim + ffmpeg/libsndfile, the LIGHT torch-free stack only (requirements-deploy.txt: fastapi/uvicorn/librosa/numpy/soundfile). Builds to ~1 GB, runs well under the 2 GB-RAM erable budget. Default engine = light. - Validated in-container end to end: healthz green, emotion miss->hit cache, 401/403/200 auth gating, /metrics, /separate 503. Platform contract (SRE update: api.nech.pl is a multi-API gateway; we're the `audio` sub-API) - Public path is /audio/v1/...; the gateway strips the prefix and proxies to us at root. Routes moved off the /v1 router to root; root_path=/audio/v1 so OpenAPI/docs advertise the real public paths (verified servers=[{/audio/v1}]). - Central auth: dropped our own bearer verification in the request path. We now trust the gateway-injected X-Tenant / X-Scopes (loopback-only bind = only the gateway can reach us). Local-dev keeps a DOUANIER_DEV_TOKEN bearer fallback. Supersedes #23/#24 (the SQLite token store + CLI remain for dev only). - /metrics: Prometheus text (douanier_up, requests_total{path,status}, cache_rows/hits{kind}) for the erable scraper. - /separate: deliberate 503 compute_unavailable (retriable) — no GPU path on erable; route exists so hexa can code against it now. GPU backend is env-selected later. Docs + tests - DEPLOY.md rewritten as the erable container contract (build, /data volume, env-file, loopback publish, cache cap, central-auth onboarding). README reframed to the platform shape. 32/32 tests pass (smoke retargeted to root paths + header auth; added /separate, /metrics, openapi-root-path coverage).PLN (Algolia) authored722daded
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| engines | Loading commit data... | |
| tests | Loading commit data... | |
| .dockerignore | Loading commit data... | |
| .gitignore | Loading commit data... | |
| DEPLOY.md | Loading commit data... | |
| Dockerfile | Loading commit data... | |
| README.md | Loading commit data... | |
| SRE.md | Loading commit data... | |
| app.py | Loading commit data... | |
| auth.py | Loading commit data... | |
| cache.py | Loading commit data... | |
| config.py | Loading commit data... | |
| db.py | Loading commit data... | |
| douanier.py | Loading commit data... | |
| requirements-deploy.txt | Loading commit data... | |
| requirements.txt | Loading commit data... |