Skip to content
This repository has been archived by the owner on Jun 15, 2020. It is now read-only.

Repo for Udacity Operationalize a ML Microservice API project

Notifications You must be signed in to change notification settings

softveda/udacity-microservices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 

Repository files navigation

CircleCI

Housing Price Predictor App

This is a Python flask app that serves out predictions (inference) about housing prices in Boston through API calls.

The app uses a pre-trained, sklearn model that has been trained to predict housing prices in Boston according to several features, such as average rooms in a home and data about highway access, teacher-to-pupil ratios, and so on. The data was initially taken from Kaggle, on the data source site.


Running the App

  1. Open a terminal and clone the project repository, then navigate to the project folder.
git clone https://github.com/softveda/udacity-microservices.git
cd udacity-microservices/project-ml-microservice-kubernetes
  1. Create (and activate) a new virtual environment with Python
make setup
  1. Install dependencies
make install
  1. Run the app
 python3 app.py

This should write some logs to terminal like

* Serving Flask app "app" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 202-879-013

Note: You have to change the hosting port of the app from 80 to 8000

  1. Make a prediction
    Open another terminal and run
./make_prediction.sh

This should log the Prediction value returned from the app

Port: 8000
{
  "prediction": [
    20.35373177134412
  ]
}

Project Files

  • Makefile - This is Makefile that has the setup and installation tasks that can be run using the make utility
  • requirments.txt - This is the list of dependencies (Python libraies) that are isntalled using the pip utility
  • app.py - This is the Python Flask web application
  • Dockerfile - This is thr docker build file to containerize the app inside Docker
  • Shell scripts
    • run_docker.sh - This script will build the Docker image of the app and run the app inside the container
    • upload_docker.sh - This script upload the Docker image to Docker hub repository
    • run_kubernetes.sh - This script deploys the Docker image to a Kubernetes cluster and runs the app in pods.

About

Repo for Udacity Operationalize a ML Microservice API project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published