This project provides a complete setup for running an MLflow server, a backend service, and a frontend client using Docker Compose. It also integrates Prometheus and Grafana for monitoring, enabling seamless model tracking, training orchestration, user interaction, and real-time system observability.
| Service | Description |
|---|---|
| mlflow | MLflow Tracking Server to log experiments, metrics, parameters, and artifacts. |
| server | Custom backend API handling training, logging, forecasting, or model serving logic. |
| client | Frontend client (e.g., Streamlit or React app) for interaction and visualization. |
| prometheus | Time-series metrics monitoring tool scraping data from backend and client services. |
| grafana | Visual dashboard for Prometheus metrics, accessible via a browser. |
git clone https://github.com/Harsh-trivs/MLops_application.git
cd MLops_application
docker-compose up --build
This will spin up:
- MLflow server at http://localhost:5001
- Backend API at http://localhost:8000
- Client frontend at http://localhost:8502
Additional, configure prometheus using yaml file present in monitoring directory and connect it with grafana. Use the dashboard.json file to replicate intended monitoring dashboard.
- Prometheus at http://localhost:9090
- Grafana at http://localhost:3000 (login:
admin/admin)
.
├── docker-compose.yml
├── backend/ # Backend API source code and Dockerfile
├── client/ # Frontend app source code and Dockerfile
├── monitoring/
│ ├── prometheus.yml # Prometheus scrape configuration
│ └── dashboard.json
- Backend Store: SQLite database stored in
mlflow-datavolume (/mlflow/mlflow.db) - Artifacts: Stored in
/mlflow/artifacts - UI Port: Accessible at http://localhost:5001
MLFLOW_HOST=0.0.0.0
MLFLOW_PORT=5000
MLFLOW_BACKEND_STORE_URI=sqlite:////mlflow/mlflow.db
- Configured to scrape metrics from:
serverathttp://server:8000/metricsclientathttp://client:8502/metrics(if supported)
- Config file:
monitoring/prometheus.yml
- Comes preconfigured with:
- Prometheus data source (localhost:9090)
- Default dashboards can be added under
monitoring/grafana/provisioning/
- Username:
admin - Password:
admin(change after first login)
- mlflow-data (named volume)
- Stores:
- MLflow SQLite DB (
mlflow.db) - Artifact files (
artifacts/)
- MLflow SQLite DB (
- Stores:
- grafana-data
- Persists Grafana configuration and dashboards
All services use:
restart: unless-stopped
To automatically recover after crashes or system reboots.
All containers share the same Docker network: app-network, allowing seamless inter-service communication.
- Run ML experiments and log to MLflow
- Visualize metrics in MLflow UI
- Interact with backend and frontend services
- Monitor API & app performance in real time via Grafana dashboards
- Inspect metrics directly in Prometheus
docker-compose down
To remove all containers but retain volumes:
docker-compose down --volumes