An end to end machine learning project that predicts a student's math exam score based on demographic and academic inputs, packaged as a Flask web app and deployed through a full CI/CD pipeline using Docker, AWS ECR, and AWS EC2.
This project implements a complete ML deployment pipeline, not just a model. It takes a trained machine learning model that predicts a student's exam performance from inputs like gender, parental education, lunch type, and prior test scores, and wraps it in a Flask web application. That application is containerized with Docker, and every code push automatically triggers a CI/CD pipeline that builds the image, pushes it to a private AWS ECR repository, and deploys it to a live AWS EC2 instance with zero manual intervention.
The goal of this project was to go beyond training a model in a notebook, and instead build the full path from code to a running, publicly accessible application, the way it would be done in a real production setting.
Machine Learning / Backend
- Python
- Flask
- Scikit-learn
- Pandas / NumPy
Containerization & Deployment
- Docker
- Amazon ECR (Elastic Container Registry) — private image registry
- Amazon EC2 — application hosting
CI/CD
- GitHub Actions
- Continuous Integration
- Continuous Delivery (build & push image to ECR)
- Continuous Deployment (self-hosted runner on EC2 pulls & runs the latest image)
Cloud / Infra
- AWS IAM (scoped access for CI/CD)
- AWS Security Groups (network access control)
- AWS EBS (instance storage)
Developer pushes code to GitHub
│
▼
GitHub Actions triggered
│
▼
CI: code checks (ubuntu-latest runner)
│
▼
CD (Delivery): Docker image built & pushed to Amazon ECR (ubuntu-latest runner)
│
▼
CD (Deployment): self-hosted runner on EC2 pulls latest image and runs container
│
▼
Flask app live on EC2, accessible via public IP
- A user fills out a form with student attributes (gender, ethnicity, parental education, lunch type, test preparation status, reading/writing scores).
- The Flask backend passes these inputs through a preprocessing pipeline and a trained ML model.
- The predicted math score is returned and displayed to the user.
git clone https://github.com/shubhijoshi/ML_PROJECT.git
cd ML_PROJECT
pip install -r requirements.txt
python app.pyApp will be available at http://localhost:5000.
docker build -t ml-project .
docker run -p 5000:5000 ml-projectThe GitHub Actions workflow (.github/workflows/aws.yml) runs on every push to main and consists of three stages:
| Stage | Runs on | Purpose |
|---|---|---|
| Continuous Integration | ubuntu-latest |
Code checks |
| Continuous Delivery | ubuntu-latest |
Build Docker image, push to Amazon ECR |
| Continuous Deployment | self-hosted (EC2) | Pull latest image from ECR, restart container |
- The EC2 instance may be stopped when not actively in use to conserve cloud resources — the public IP will change on restart.
- Production improvements not yet implemented: HTTPS/SSL, automated tests in the CI stage, restricted IAM permissions, monitoring/logging, and autoscaling.
Shubhi Joshi
GitHub: @shubhijoshi
Email: shubhijoshi4jw@gmail.com