Skip to content

Fix the local stack: compose file and make test - #18

Merged
sahilkalgutkar merged 2 commits into
mainfrom
fix/local-stack
Sep 1, 2026
Merged

sahilkalgutkar merged 2 commits into
mainfrom
fix/local-stack

Conversation

@sahilkalgutkar

Copy link
Copy Markdown
Owner

The repo built and CI was green, but nothing in the local quickstart actually ran. Two separate breaks, both outside the code CI exercises.

deploy/docker-compose.yml was invalid. Prometheus and Grafana were appended after the top-level volumes: key, so compose parsed them as volume definitions and rejected the file:

volumes.grafana additional properties 'depends_on', 'environment', 'image', 'ports', 'volumes' not allowed

Validation fails before anything starts, so make db, make up and the whole quickstart were down — and make test with them, since it needs the database make db brings up. This has been true since the observability stack landed in ad3834b. CI never caught it because CI uses a service container rather than this file.

make test could not reach that database anyway. TEST_DB was declared in the Makefile and never used, so make db && make test — exactly what the README says to run — failed with MODELFORGE_TEST_DATABASE_URL is not set unless you already knew to export it by hand.

Also documents the non-Docker path: DB and TEST_DB now fall back to MODELFORGE_DATABASE_URL / MODELFORGE_TEST_DATABASE_URL, so pointing everything at a Postgres you already have is one export. Port 5432 already being taken is the ordinary case, not the exception.

Verified end to end against the fixed file, with the server on :8080:

  • docker compose config validates; prometheus, grafana and postgres all resolve as services
  • Prometheus comes up, loads the modelforge alert rule group, and scrapes the server with its read token — up{job="modelforge"} = 1
  • Grafana provisions the modelforge dashboard and the Prometheus datasource
  • make tokens → create → push → deploy → predict returns a prediction; a 90/10 canary split 56/5 across 61 requests; shadow, policy, stats, baseline, drift and rollback all behave as documented; the dashboard renders at /
  • make test now runs the full suite off TEST_DB alone: all packages pass, coverage 89.9%, matching the figure in the README

The two services were appended after the top-level volumes: key, so compose
parsed them as volume definitions and refused the file outright:

  volumes.grafana additional properties 'depends_on', 'environment', 'image',
  'ports', 'volumes' not allowed

That is a validation error, not a partial failure, so every compose command
failed and took `make db`, `make up` and the quickstart down with them —
including `make test`, which needs the database `make db` starts. The volumes
block now sits at the end of the file where it cannot swallow a service.
TEST_DB was declared and never used, so `make db && make test` — what the
README tells you to run — failed with "MODELFORGE_TEST_DATABASE_URL is not
set" unless you already knew to export it yourself. The test target now passes
TEST_DB through under the name the suite reads.

DB and TEST_DB both fall back to MODELFORGE_DATABASE_URL and
MODELFORGE_TEST_DATABASE_URL when those are set, so pointing the whole thing at
a Postgres you already have is one export rather than an argument on every
target. The quickstart documents that path, since 5432 being taken is the
ordinary case on a machine that has run any other project.
@sahilkalgutkar
sahilkalgutkar merged commit a316fa9 into main Sep 1, 2026
2 checks passed
@sahilkalgutkar
sahilkalgutkar deleted the fix/local-stack branch September 1, 2026 17:18
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant