Skip to content

Zakaria-laktati/MLOps-project-template

Repository files navigation

MLOps Skeleton Project

This repository contains a skeleton project for implementing Machine Learning Operations (MLOps) practices. It serves as a template for building, deploying, and monitoring machine learning models in a production environment.

Project Structure

mlops-skeleton-project
├── data
│   ├── raw                # Raw data files
│   ├── interim            # Intermediate processed data
│   └── processed          # Final processed data for modeling
├── notebooks
│   └── exploration.ipynb  # Jupyter notebook for exploratory data analysis
├── src
│   ├── data
│   │   └── make_dataset.py  # Script for loading and transforming raw data
│   ├── features
│   │   └── build_features.py  # Script for feature generation
│   ├── models
│   │   ├── train_model.py      # Script for training models
│   │   ├── predict_model.py     # Script for making predictions
│   │   └── evaluate_model.py    # Script for model evaluation
│   ├── pipelines
│   │   └── training_pipeline.py  # Orchestrates the training process
│   ├── monitoring
│   │   ├── data_drift_monitor.py  # Monitors data drift
│   │   └── model_performance_monitor.py  # Monitors model performance
│   ├── serving
│   │   └── api.py                # REST API for serving the model
│   └── utils
│       └── io.py                 # Utility functions for I/O operations
├── configs
│   ├── config.yaml               # General configuration settings
│   ├── params.yaml               # Hyperparameters for model training
│   └── logging.yaml              # Logging configuration
├── docker
│   ├── Dockerfile.training        # Dockerfile for training environment
│   ├── Dockerfile.serving         # Dockerfile for serving environment
│   └── docker-compose.yml         # Docker Compose file for multi-container applications
├── ci-cd
│   ├── github-actions
│   │   └── mlops-pipeline.yml     # CI/CD pipeline definition
│   └── scripts
│       ├── run_tests.sh           # Script to run unit tests
│       ├── run_lint.sh            # Script to check code style
│       └── build_and_push_docker.sh  # Script to build and push Docker images
├── experiment_tracking
│   ├── mlflow
│   │   └── mlflow_config.yaml     # MLflow configuration for experiment tracking
│   └── metadata
│       └── README.md              # Documentation for experiment tracking metadata
├── infrastructure
│   ├── terraform
│   │   ├── main.tf                # Terraform configuration for infrastructure
│   │   └── variables.tf           # Variables for Terraform configuration
│   └── k8s
│       ├── deployment.yaml         # Kubernetes deployment configuration
│       ├── service.yaml            # Service configuration for the application
│       └── ingress.yaml            # Ingress configuration for routing traffic
├── tests
│   ├── unit
│   │   └── test_train_model.py     # Unit tests for model training
│   ├── integration
│   │   └── test_training_pipeline.py  # Integration tests for training pipeline
│   └── e2e
│       └── test_api_e2e.py        # End-to-end tests for the API
├── monitoring
│   ├── prometheus
│   │   └── prometheus.yml         # Prometheus configuration for monitoring
│   └── grafana
│       └── dashboards
│           └── model_dashboard.json  # Grafana dashboard for model performance
├── .github
│   └── workflows
│       └── ci-cd.yml              # GitHub Actions workflow for CI/CD
├── .dvc
│   └── config                      # DVC configuration files
├── .gitignore                      # Files and directories to ignore by Git
├── dvc.yaml                        # DVC pipeline definition
├── requirements.txt                # Python dependencies
├── pyproject.toml                 # Python project configuration
├── setup.cfg                       # Packaging and distribution configuration
├── Dockerfile                      # Main Dockerfile for application environment
├── docker-compose.yml              # Docker Compose file for services
├── Makefile                        # Automation commands for the project
└── README.md                       # Project documentation

Getting Started

  1. Clone the repository:

    git clone https://github.com/yourusername/mlops-skeleton-project.git
    cd mlops-skeleton-project
    
  2. Set up the environment:

    • Ensure you have Docker and Docker Compose installed.
    • Install Python dependencies:
      pip install -r requirements.txt
      
  3. Run the project:

    • Use Docker Compose to build and run the services:
      docker-compose up --build
      
  4. Explore the notebooks:

    • Open notebooks/exploration.ipynb for exploratory data analysis.
  5. Contribute:

    • Feel free to fork the repository and submit pull requests for improvements or additional features.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Support

If you find this project helpful, consider supporting the developer by buying them a coffee!

Buy Me A Coffee

About

Minimal MLOps regression skeleton (California Housing) with training pipeline, Evidently drift/performance report, FastAPI prediction service, Dockerized training/serving environments, ready for CI/CD extension

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors