You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(infra): Docker + compose packaging, and a home for the artifacts (#19, #20) (#272)
Flavormancer could only run on the machine it was built on. This makes it installable.
Dockerfile is deliberately a RUNTIME image. Training needs 32 cores and hours; serving needs
neither, so the ~1 GB of trained forests and parquet tables mount at run time instead of baking
into a layer that would go stale the moment a head is retrained. Base is slim-bookworm rather than
alpine because RDKit ships manylinux wheels that want glibc, and building it on musl is hours of
pain for nothing. Runs unprivileged; the health check allows a 180s start period because a cold
start genuinely loads 190 heads.
docker-compose.yml is Compose and not Kubernetes on purpose — one box, a handful of users, which
is the real shape of an on-prem install for a flavour house. Postgres is the pgvector image
because the substitution index is a nearest-neighbour search over the 177-dimension profile
vector, which is exactly what pgvector exists for (#20). The schema in infra/initdb keeps tox OUT
of that vector: safety is not a flavour-match dimension and must not steer "what tastes similar".
The interesting part is FLAVORMANCER_HOME. Every artifact path in predict.py and app.py was
relative to the working directory, because the systemd deployment has always had code and models
sharing one folder. That makes the obvious container mount impossible: any bind reaching the
models would also shadow app.py, and the container would start with no application code. I wrote
that exact bug into the first draft of the compose file and caught it reviewing the mount.
So artifacts now resolve through predict.artifact() under FLAVORMANCER_HOME, which defaults to "."
— the existing systemd deployment is byte-for-byte unaffected, and a container can bake the code
in while mounting the data. Verified both directions: unset resolves to the working directory,
set redirects, full suite passes either way.
Docker is not installed on the build box, so the image has NOT been built and run end to end.
The compose file parses and the schema is plain SQL, but the first real `docker compose up`
should be treated as the test. Called out in the PR rather than implied to be verified.
Signed-off-by: Austin L. <86896075+rvnminers-A-and-N@users.noreply.github.com>
0 commit comments