This project demonstrates the deployment of a machine learning model using Docker and Kubernetes on Google Cloud Platform (GCP), highlighting skills in MLOps, containerization, and cloud infrastructure management. The process integrates a pre-trained PyCaret model into a Flask application, containerized with Docker, and orchestrated with Kubernetes for scalability and reliability.
Project Overview
- Objective: Deploy a machine learning model to predict insurance charges using Docker and Kubernetes on GCP.
- Technologies:
- Docker for containerization
- Kubernetes for orchestration
- Google Kubernetes Engine (GKE) and Artifact Registry on GCP
- Flask and Gunicorn for serving the model
- PyCaret for the pre-trained model
Key Steps
- Configured a GCP project, enabling Container Registry, Artifact Registry, and GKE.
- Cloned a GitHub repository containing a pre-trained PyCaret model and Flask app.
- Built and pushed a Docker image to Artifact Registry, ensuring consistent environments.
- Created a Kubernetes cluster using GKE and deployed the containerized app.
- Exposed the app via a load balancer, enabling public access for testing with sample data.
- Cleaned up resources to optimize costs.
Outcomes
- Successfully deployed a scalable ML application accessible via a public IP.
- Applied MLOps practices, ensuring consistency, scalability, and efficient resource management.
- Gained hands-on experience with Docker, Kubernetes, and GCP services.
Link: Read the full article on Medium
Code: https://github.com/shj37/Deploy-Machine-Learning-Pipeline-on-Google-Kubernetes-Engine
References
- The original repo: https://github.com/pycaret/pycaret-deployment-google
- DSwithBappy https://www.youtube.com/watch?v=67BT4lRyeXI&t=886s&ab_channel=DSwithBappy