Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel
Integration:  dvc git mlflow github
yahiaehab10 505b267411
Fix GitHub Actions DVC workflow - handle missing cache files gracefully
1 week ago
dba2f6291f
Enhance MLflow integration and update dependencies
2 weeks ago
2a93ab1d2b
Update DVC remote configuration with authentication
2 weeks ago
505b267411
Fix GitHub Actions DVC workflow - handle missing cache files gracefully
1 week ago
978ce64b24
Complete DVC pipeline setup with MLflow integration and DagsHub tracking
2 weeks ago
d61121074a
feat: Add MLflow model serving setup, training, and API testing scripts
2 weeks ago
6565b10233
Enhance MLflow integration: conditionally log artifacts and models based on DagsHub connection status
1 week ago
ef4ba86ee7
Add data processing pipeline for Iris dataset
2 weeks ago
135e5573eb
Fix model promotion script - remove interactive auth, add timeout
2 weeks ago
src
6565b10233
Enhance MLflow integration: conditionally log artifacts and models based on DagsHub connection status
1 week ago
37328dac83
Fix workflow order: pull DVC data before running tests
2 weeks ago
d61121074a
feat: Add MLflow model serving setup, training, and API testing scripts
2 weeks ago
3aac2c5579
Initialize DVC
2 weeks ago
7ffae0465a
Update environment configuration and pipeline improvements
2 weeks ago
f1884c085b
Update .gitignore for MLflow and DVC project
1 week ago
d61121074a
feat: Add MLflow model serving setup, training, and API testing scripts
2 weeks ago
d61121074a
feat: Add MLflow model serving setup, training, and API testing scripts
2 weeks ago
15886b352a
Update README.md
1 week ago
d61121074a
feat: Add MLflow model serving setup, training, and API testing scripts
2 weeks ago
d61121074a
feat: Add MLflow model serving setup, training, and API testing scripts
2 weeks ago
e33ab0e8bf
Update DVC pipeline after fixing metrics.json tracking
1 week ago
023ea4c95b
๐Ÿš€ Enable model evaluation and finalize MLOps pipeline
2 weeks ago
ef4ba86ee7
Add data processing pipeline for Iris dataset
2 weeks ago
d61121074a
feat: Add MLflow model serving setup, training, and API testing scripts
2 weeks ago
d61121074a
feat: Add MLflow model serving setup, training, and API testing scripts
2 weeks ago
d61121074a
feat: Add MLflow model serving setup, training, and API testing scripts
2 weeks ago
d61121074a
feat: Add MLflow model serving setup, training, and API testing scripts
2 weeks ago
Storage Buckets
Data Pipeline
Legend
DVC Managed File
Git Managed File
Metric
Stage File
External File

README.md

You have to be logged in to leave a comment. Sign In

MLFlow Demo Project

Python 3.11+ MLflow FastAPI Docker

A complete MLOps pipeline demonstrating production-ready machine learning workflows using MLflow, DagsHub, DVC, and Evidently for experiment tracking, model versioning, and drift detection.

๐Ÿš€ Features

  • ๐Ÿ”„ CI/CD Pipeline - Automated model training and deployment
  • ๐Ÿ“Š Experiment Tracking - MLflow integration with DagsHub
  • ๐Ÿ—ƒ๏ธ Data Versioning - DVC for dataset and artifact management
  • ๐Ÿ“ˆ Drift Detection - Evidently-based monitoring and alerts
  • ๐Ÿš€ Model Serving - FastAPI REST API with interactive docs
  • ๐Ÿณ Docker Ready - Containerized deployment

๐Ÿ“‹ Table of Contents

โšก Quick Start

# Install and run
pip install -r requirements.txt
python simple_train.py    # Train model (~30 seconds)
python app.py             # Start API server

# Test the API
curl -X POST "http://localhost:8000/predict" \
     -H "Content-Type: application/json" \
     -d '{"features": [5.1, 3.5, 1.4, 0.2]}'

๐ŸŒ Access: http://localhost:8000 | ๐Ÿ“š Docs: http://localhost:8000/docs

Option 2: Docker Deployment

docker build -t iris-model-api .
docker run -p 8000:8000 iris-model-api

Option 3: Full MLOps Pipeline

# Complete pipeline with tracking
dvc repro                 # Run DVC pipeline
# OR
python -m src.pipeline    # Direct execution

๐Ÿ”Œ API Usage

Endpoints

  • GET / - API status and welcome
  • POST /predict - Make predictions (iris classification)

Example Request

import requests

response = requests.post(
    "http://localhost:8000/predict",
    json={"features": [5.1, 3.5, 1.4, 0.2]}
)
print(response.json())
# Output: {"prediction": 0, "probability": 0.95, "class": "setosa"}

๐Ÿ“ Project Structure

MLflow_demo/
โ”œโ”€โ”€ app.py                    # FastAPI model serving
โ”œโ”€โ”€ simple_train.py           # Quick model training
โ”œโ”€โ”€ test_api.py              # API testing suite
โ”œโ”€โ”€ Dockerfile               # Container configuration
โ”‚
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ raw/                    # Original datasets (DVC tracked)
โ”‚   โ”œโ”€โ”€ processed/              # Cleaned data
โ”‚   โ””โ”€โ”€ drift_baseline/         # Drift reports
โ”‚
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ pipeline.py             # End-to-end ML pipeline
โ”‚   โ”œโ”€โ”€ train.py               # Model training with MLflow
โ”‚   โ”œโ”€โ”€ data_preprocessing.py   # Data cleaning
โ”‚   โ””โ”€โ”€ drift_detection.py     # Evidently monitoring
โ”‚
โ”œโ”€โ”€ scripts/                 # Utility scripts
โ”œโ”€โ”€ dvc.yaml                 # Pipeline configuration
โ””โ”€โ”€ requirements.txt

๐Ÿ”„ MLOps Pipeline

What It Does

  1. ๐Ÿ“ฅ Data Loading - Iris dataset ingestion
  2. ๐Ÿงน Data Preprocessing - Cleaning and validation
  3. ๐Ÿ“Š Drift Detection - Baseline creation and monitoring
  4. ๐Ÿค– Model Training - RandomForest with hyperparameter tracking
  5. ๐Ÿ“ Model Registry - MLflow model versioning
  6. ๐Ÿ“ˆ Evaluation - Performance metrics logging

Tracking & Monitoring

  • ๐ŸŒ DagsHub MLflow: View Experiments
  • ๐Ÿ’ป Local MLflow: Run mlflow ui โ†’ http://localhost:5000
  • ๐Ÿ“Š Drift Reports: Interactive HTML reports in data/drift_baseline/

Logged Artifacts

  • โœ… Model performance metrics (accuracy, precision, recall)
  • โœ… Hyperparameters and training configuration
  • โœ… Data drift analysis reports
  • โœ… Model artifacts and dependencies

๐Ÿ› ๏ธ Setup & Configuration

Prerequisites

  • Python 3.11+
  • Git
  • Docker (optional)
  • DagsHub account (for full pipeline)

Environment Setup

# Clone repository
git clone https://github.com/yahiaehab10/MLFlow_demo.git
cd MLFlow_demo

# Install dependencies
pip install -r requirements.txt

# Configure DagsHub (optional)
dvc remote modify origin password <your-dagshub-token>

๐Ÿงช Testing

# Run API tests
python test_api.py

# Test pipeline
dvc repro --dry

# Manual testing
python -c "
import requests
r = requests.post('http://localhost:8000/predict', 
                 json={'features': [5.1, 3.5, 1.4, 0.2]})
print(r.json())
"

๐Ÿšจ Troubleshooting

Issue Solution
DVC authentication error dvc remote modify origin password <token>
MLflow connection timeout Check internet connection and DagsHub access
Missing dependencies pip install -r requirements.txt
Docker build fails Ensure Docker daemon is running

๐Ÿ“š Documentation

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Tip!

Press p or to see the previous file or, n or to see the next file

About

Demo Projects for Money Fellows to use MLFlow for MLOps

Collaborators 1

Comments

Loading...