Environments & Dependency Strategy¶
Time2Bet uses a layered dependency approach to maximize reproducibility and minimize "works on my machine" issues across dev/CI/prod.
Goals¶
- deterministic and repeatable builds
- strict separation between runtime and development dependencies
- consistent dependency resolution across containers and local runs
Strategy (high level)¶
1) Base layer (system + Python runtime)
- managed via conda/mamba using environment.yml
- exported into a pinned requirements-mamba-base.txt
2) Python dependency layer - managed via PDM groups (api/ml/dev/prod) - exported into requirements for Docker build and deployment
3) Final pinned artifacts
- merged into requirements-*.txt to ensure reproducible container builds
Why this design?¶
- conda handles system-level dependencies reliably (e.g., compiled libs)
- PDM provides modern dependency resolution and environment grouping
- exporting requirements ensures deterministic and auditable Docker images
How to rebuild pinned requirements¶
This regenerates:
- PDM exports per environment
- base pip freeze from conda env
- merged final
requirements-*.txt
Operational note¶
The system treats pdm.lock and DVC versions as the primary reproducibility anchors.
All production deployments should be traceable to:
- git commit
- dataset version (DVC)
- model version (MLflow)
- dependency lock (pdm.lock)