Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Application with Backend and Frontend + Monitoring

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.


🚀 Services Overview

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.

🐳 Getting Started

1. Clone the repository

git clone https://github.com/Harsh-trivs/MLops_application.git
cd MLops_application

2. Build and run all services

docker-compose up --build

This will spin up:

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.


🗃️ Folder Structure

.
├── 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     


📦 MLflow Configuration

  • Backend Store: SQLite database stored in mlflow-data volume (/mlflow/mlflow.db)
  • Artifacts: Stored in /mlflow/artifacts
  • UI Port: Accessible at http://localhost:5001

Environment Variables (mlflow service):

MLFLOW_HOST=0.0.0.0
MLFLOW_PORT=5000
MLFLOW_BACKEND_STORE_URI=sqlite:////mlflow/mlflow.db


📊 Monitoring Setup (Prometheus + Grafana)

Prometheus

  • Configured to scrape metrics from:
    • server at http://server:8000/metrics
    • client at http://client:8502/metrics (if supported)
  • Config file: monitoring/prometheus.yml

Grafana

  • Comes preconfigured with:
    • Prometheus data source (localhost:9090)
    • Default dashboards can be added under monitoring/grafana/provisioning/

Login Info

  • Username: admin
  • Password: admin (change after first login)

📂 Volumes

  • mlflow-data (named volume)
    • Stores:
      • MLflow SQLite DB (mlflow.db)
      • Artifact files (artifacts/)
  • grafana-data
    • Persists Grafana configuration and dashboards

🔁 Restart Policy

All services use:

restart: unless-stopped

To automatically recover after crashes or system reboots.


📡 Networking

All containers share the same Docker network: app-network, allowing seamless inter-service communication.


✅ Prerequisites


🧪 Example Use Cases

  • 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

🧼 Stopping the Application

docker-compose down

To remove all containers but retain volumes:

docker-compose down --volumes

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages