Git Product home page Git Product logo

udacity-devops-project-4's Introduction

Udacity-DevOps-Project-4

CircleCI

Project Overview

This project is all about operationalizing a Machine Learning Microservice API app.py—that serves out predictions (inference) about housing prices through API calls.

Using 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 set is gotten from the data source site.

INSTRUCTIONS ON HOW TO RUN THE APP

Setup the Environment

  • Run make setup to setup python virtual environment. Just like below
python3 -m venv ~/.devops
# You should have Python 3.7 available in your host. 
# Check the Python path using `which python3`
source .devops/bin/activate

Installing Dependencies

  • Run make install to install the necessary dependencies
  • Install hadolint with these commands wget -O /bin/hadolint https://github.com/hadolint/hadolint/releases/download/v1.16.3/hadolint-Linux-x86_64 && chmod +x /bin/hadolint. This will help lint Dockerfile.
  • Install docker using this link.
  • Install minikube using this link. This will help to run Kubernetes locally.

Testing the source code and Dockerfile

  • Run make lint to check the source and Dockerfile

Running app.py

Running the app locally on local Machine:

  • Run python3 app.py

Running the app in Docker container:

  • Run ./run_docker.sh then run ./make_predicton.sh to make predictions.
  • Run ./upload_docker.sh to upload the docker image to docker hub.

Running the app in Kubernetes:

  1. Run ./run_kubernetes.sh then run ./make_predicton.sh to make predictions.

EXPLANATION OF THE FILES IN THE REPOSITORY

Folder Arrangement

.
├── Dockerfile
├── Makefile
├── README.md
├── app.py
├── hadolint
├── make_prediction.sh
├── model_data
│   ├── boston_housing_prediction.joblib
│   └── housing.csv
├── output_txt_files
│   ├── docker_out.txt
│   └── kubernetes_out.txt
├── requirements.txt
├── run_docker.sh
├── run_kubernetes.sh
└── upload_docker.sh
  • .circleci/config.yml contains the config file for cirleci for CI integration.
  • output_txt_files contains the prediction outputs for docker run and kubernates run after make_prediction.sh script was run.
  • app.py contains the source code of the application
  • Dockerfile contains the configuration for the docker container env. setup
  • Makefile basically contains the summary instruction on deploying the app
  • requirements.txt contains the dependencies to install

udacity-devops-project-4's People

Contributors

elokac avatar

Watchers

 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.