Git Product home page Git Product logo

ml-microservice-kubernetes's Introduction

CircleCI

Operationalize a Machine Learning Microservice API

"Boston House Price Prediction"

About

This is the final project for Udacity's Cloud DevOps Engineer Nanodegree. The project tests one's ability to operationalize a Python flask app, that serves out predictions (inference) about housing prices through API calls.

Scenario

You're given 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

Project Goal

The project goal is to operationalize this working, machine learning microservice using kubernetes, which is an open-source system for automating the management of containerized applications.

Tasks

  • Test the project code using linting
  • Complete a Dockerfile to containerize this application
  • Deploy the containerized application using Docker and make a prediction
  • Improve the log statements in the source code for this application
  • Configure Kubernetes and create a Kubernetes cluster
  • Deploy a container using Kubernetes and make a prediction
  • Upload a complete GitHub repo with CircleCI to indicate that the code has been tested

Submission Info

This submission satisfies the mentioned requirements. Here's a brief overview of some files:

  • app.py: Flask api server, exposes and endpoint /predict that will predict housing prices in Boston using a pre-trained model.

  • Dockerfile: Container building instructions for flask api.

  • run_docker.sh: A script that builds a Docker image of the app.

  • upload_docker.sh: A script that uploads the built Docker image to DockerHub.

  • run_kubernetes.sh A script to deploy the containerized app to a k8s cluster.

Running the Project

This project depends on python3.7, Docker, Make, and Kubernetes (or Minikube, locally.)

Running the app

Locally

# Create and activate a virtual python environment
python3.7 -m venv ~/.venv
source ~/.venv/bin/activate

# Install dependencies
make install

# Run app.py
python app.py

# When the api is running and ready to listen for connections
# run a simple test
./make_predictions.sh

With Docker

./run_docker.sh

With Kubernetes

./run_kubernetes.sh

ml-microservice-kubernetes's People

Contributors

dr8co avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.