Skip to content

Repository files navigation

Student Exam Performance Indicator: End to End ML Deployment

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.


About

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.


Tech Stack

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)

Architecture

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

How It Works

  1. A user fills out a form with student attributes (gender, ethnicity, parental education, lunch type, test preparation status, reading/writing scores).
  2. The Flask backend passes these inputs through a preprocessing pipeline and a trained ML model.
  3. The predicted math score is returned and displayed to the user.

Running Locally

git clone https://github.com/shubhijoshi/ML_PROJECT.git
cd ML_PROJECT
pip install -r requirements.txt
python app.py

App will be available at http://localhost:5000.

Running with Docker

docker build -t ml-project .
docker run -p 5000:5000 ml-project

CI/CD Pipeline

The 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

Notes

  • 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.

Author

Shubhi Joshi GitHub: @shubhijoshi
Email: shubhijoshi4jw@gmail.com

About

End to end ML deployment project, a Flask app predicting student exam performance, containerized with Docker and deployed via a CI/CD pipeline using GitHub Actions, AWS ECR, and AWS EC2.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages