Skip to content

10sharmashivam/Automated_model_deployment_flyte

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI-Driven End-to-End Data Science Platform with Automated Model Deployment and Continuous Monitoring

Scalable Data Science Platform with Flyte

Overview

This project builds a comprehensive, scalable data science platform that leverages Flyte to orchestrate the entire machine learning lifecycle. The platform automates various stages, including data ingestion, preprocessing, model training, deployment, monitoring, and auto-retraining, creating a robust and fully automated end-to-end pipeline.

By using Flyte for orchestration, this project demonstrates advanced MLOps practices and automation, integrating AI-powered decision-making to adapt to new data and adjust the system’s behavior over time.

Key Features

  • Automated Data Pipeline Orchestration: Automates data ingestion, preprocessing, and data splitting for training, validation, and testing.
  • AI-Powered Model Selection & Hyperparameter Tuning: Automatically selects the best model and fine-tunes hyperparameters using Bayesian Optimization.
  • End-to-End Model Deployment: Automates model deployment with continuous integration and continuous delivery (CI/CD) pipelines.
  • Auto-Scaling Model Serving: Scales the model serving infrastructure based on traffic load using Kubernetes.
  • Continuous Model Monitoring & Retraining: Monitors model performance and triggers auto-retraining when performance drops.
  • Real-Time Data Feedback Loop: Automatically collects new data for continual learning and model refinement.
  • Visualization Dashboard & Reporting: Real-time monitoring with dashboards for model performance, data processing metrics, and deployment health.
  • Serverless Infrastructure: Uses Flyte’s serverless capabilities to optimize resource usage.

Technologies Used

  • Flyte: Workflow orchestration platform for managing and automating the entire ML lifecycle.
  • Python: Primary language for data processing, machine learning, and APIs.
  • Machine Learning: scikit-learn, XGBoost, TensorFlow, PyTorch.
  • Cloud: AWS, GCP for infrastructure and model deployment.
  • Kubernetes: Container orchestration for scalable model serving.
  • Docker: Containerization of model and pipeline environments.
  • Grafana/Tableau: Visualization and monitoring.
  • GitHub Actions: CI/CD pipelines for continuous deployment.

Project Structure

├── README.md                  # Project overview, instructions
├── flyte_config/               # Flyte-specific configurations and custom plugins
│   ├── flyte.yaml              # Flyte configuration file for project setup
│   ├── workflows/              # Custom Flyte workflows
│   │   ├── data_ingestion.py   # Workflow for automating data ingestion
│   │   ├── preprocessing.py    # Workflow for data preprocessing
│   │   ├── model_training.py   # Workflow for model training and tuning
│   │   ├── model_deployment.py # Workflow for deploying models
│   │   ├── monitoring.py       # Workflow for performance monitoring and retraining
│   │   └── auto_scaling.py     # Workflow for auto-scaling model serving
│   └── tasks/                  # Reusable Flyte tasks
│       ├── data_ingestion.py   # Task for data pulling and processing
│       ├── feature_engineering.py # Feature engineering tasks
│       ├── hyperparameter_tuning.py # Task for hyperparameter optimization
│       └── model_serving.py    # Task for model inference
├── src/                        # Main source code for machine learning components
│   ├── preprocessing/          # Preprocessing pipeline scripts
│   │   ├── clean_data.py       # Data cleaning
│   │   └── feature_extraction.py # Feature extraction
│   ├── model_training/         # Training scripts and model code
│   │   ├── train_model.py      # Model training code
│   │   ├── hyperparameter_search.py # Hyperparameter optimization code
│   │   └── evaluation.py       # Model evaluation script
│   ├── deployment/             # Deployment related code (API, CI/CD)
│   │   ├── deploy_model.py     # Deployment pipeline script
│   │   └── api_inference.py    # REST API for model inference
│   ├── monitoring/             # Scripts for monitoring and feedback loop
│   │   ├── performance_monitor.py # Script for model monitoring
│   │   └── retrain.py          # Trigger retraining based on performance
├── config/                     # Config files for cloud, Kubernetes, etc.
│   ├── aws_config.yaml         # AWS/GCP configurations (for deployment)
│   ├── kubernetes_config.yaml  # Kubernetes config for auto-scaling
│   └── flyte_config.yaml       # Flyte-specific configuration
├── Dockerfile                  # Dockerfile to containerize the environment
├── .github/                    # GitHub Actions for CI/CD
│   ├── workflows/              # GitHub Actions workflows for CI/CD
│   │   └── ci_cd.yaml          # Define CI/CD pipeline for deployment
├── notebooks/                  # Jupyter notebooks for experimentation
│   ├── data_exploration.ipynb  # Notebook for initial data exploration
│   └── model_tuning.ipynb      # Notebook for tuning and model testing
└── requirements.txt            # List of Python dependencies

Getting Started

Prerequisites

  1. Flyte Installation:

    • Install Flyte on your local machine or cloud environment using Flyte’s documentation.
    • Install Flyte CLI: pip install flytekit
    • Install Flyte sandbox for local development (optional): flytekit-sandbox
  2. Cloud Configuration:

    • Set up AWS/GCP credentials for cloud-based deployment.
  3. Docker:

    • Ensure Docker is installed and configured to containerize the models and pipelines.

Installation

  1. Clone this repository to your local machine:
   git clone https://github.com/10sharmashivam/Automated_model_deployment_flyte.git
   cd FlyteMLOpsPipelineDesign
  1. Install the required Python packages:
    pip install -r requirements.txt
  1. Set up your Flyte environment by configuring Flyte with cloud credentials:
    flyte-cli register --project <your-flyte-project> --domain <your-flyte-domain>

Running the Project

  1. Data Pipeline Workflow: Run the Flyte workflows for data ingestion and preprocessing:

    flyte-cli run workflow data_ingestion
    flyte-cli run workflow data_preprocessing
  2. Model Training and Deployment: Execute the model training and deployment workflows:

    flyte-cli run workflow model_training
    flyte-cli run workflow model_deployment
  3. Model Monitoring and Retraining: Start monitoring the deployed model and trigger retraining if necessary:

    flyte-cli run workflow performance_monitoring
    flyte-cli run workflow model_retraining
  1. Auto-scaling: Kubernetes will automatically scale the model serving based on the load, as configured in the auto_scaling.py workflow.

CI/CD with GitHub Actions

The project includes pre-configured CI/CD pipelines for continuous integration and deployment. Ensure you have set up GitHub Actions in the .github/workflows directory to trigger on commits to your repository.

Contribution

Feel free to contribute by opening issues, suggesting features, or submitting pull requests. For any help, open an issue or reach out to the project maintainers.

About

AI-Driven End-to-End Data Science Platform with Automated Model Deployment and Continuous Monitoring

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages