GET /bootstrap returns the 8 sensors, hourly series for all of them, context, meta, and versions in the CONTRACT.md shape. Snapshot artifacts are projected to contract fields once at boot; incomplete artifacts return 503. Adds tests for shape, sensor count, hourly alignment, and versions. Dockerfile now creates UID/GID 10001, uses COPY --chown=10001:10001, and runs as USER 10001:10001. Adds make check and a minimal Gitea Actions workflow that runs the same local gate: uv sync --frozen, compileall, pytest.
38 lines
979 B
Makefile
38 lines
979 B
Makefile
UV ?= uv
|
|
|
|
.PHONY: help data train test check serve docker clean
|
|
|
|
help:
|
|
@printf '%s\n' \
|
|
'make data parse/clean the raw CSV, join weather + holidays, export JSON' \
|
|
'make train fit the 28-day holdout model, export metrics/forecasts/model' \
|
|
'make test run pytest' \
|
|
'make check CI gate: uv sync --frozen, compileall, pytest' \
|
|
'make serve run the FastAPI service on :8000' \
|
|
'make docker build the multi-stage image (pulsecast-ml:local)' \
|
|
'make clean remove caches and generated artifacts (keeps data/raw)'
|
|
|
|
data:
|
|
$(UV) run python -m pulsecast.pipeline
|
|
|
|
train:
|
|
$(UV) run python -m pulsecast.train
|
|
|
|
test:
|
|
$(UV) run pytest
|
|
|
|
check:
|
|
$(UV) sync --frozen
|
|
$(UV) run python -m compileall src
|
|
$(UV) run pytest -q
|
|
|
|
serve:
|
|
$(UV) run uvicorn pulsecast.server:app --host 0.0.0.0 --port 8000
|
|
|
|
docker:
|
|
docker build -t pulsecast-ml:local .
|
|
|
|
clean:
|
|
rm -rf data/cache artifacts .pytest_cache
|
|
find . -type d -name __pycache__ -prune -exec rm -rf {} +
|