Code Monkey home page Code Monkey logo

housepriceai_operationalizing's Introduction

HousePriceAI

HousePriceAI is a machine learning microservice API project that predicts housing prices in Boston. The API utilizes a pre-trained sklearn model, considering various features like average rooms, highway access, and teacher-to-pupil ratios to estimate house prices. The project focuses on containerizing the Python Flask application, app.py, which serves predictions through API calls.

Project Tasks

The main objectives of this project are:

  • Perform code testing using linting to ensure code quality.
  • Complete a Dockerfile for containerizing the application.
  • Deploy the containerized application using Docker and make predictions.
  • Configure Terraform to create Kubernetes infrastructure on AWS.
  • Deploy a container using Kubernetes and validate the predictions.
  • Automate the deployment process using GitHub workflow.
  • Monitor and manage logs using Prometheus, Loki, and Grafana.
  • Utilize Rancher for efficient cluster management.

This project aims to showcase the seamless deployment of operationalized production microservices using Terraform, AWS EKS, and other AWS resources..


Installation

  1. Clone the repository:
git clone [email protected]:dev-luqman/HousePriceAI_operationalizing.git
  1. Navigate to the project directory:
cd HousePriceAI
  1. Set up the Python virtual environment:
bash
python3 -m pip install --user virtualenv
# You should have Python 3.7 available in your host.
# Check the Python path using `which python3`
# Use a command similar to this one:
python3 -m virtualenv --python=<path-to-Python3.7> .devops
source .devops/bin/activate
  1. Install the project dependencies:
  • Run make install to install the necessary dependencies
  1. Start the Flask application:
  • Standalone: python app.py
  • Run in Docker: ./run_docker.sh

Kubernetes Steps

  • Create the necessary AWS EKS infrastructure using Terraform.
  • Set up an AWS account.
  • Build the Flask app within a container.
  • Deploy the application using kubectl in conjunction with the GitHub workflow.

Usage

To use the HousePriceAI microservice API for predicting housing prices in Boston, follow these steps:

./ml_app/make_prediction

Github workflow

Infrastructure Flow

Project folders/files description

.
├── .github
│   └── workflows
│       ├── deployment.yml       # Application deployment using kubectl commands
│       └── infrastructure       # Linting and infrastructural deployment using Terraform
│
├── assets                       # Asset management folder
│
├── ingress_routing
│   ├── ingress_controller.yml   # EKS ingress controller
│   └── ingress.yml              # Ingress routing to services
│
├── ml_app                       # Application folder
│   ├── assets
│   ├── app.py
│   ├── Dockerfile
│   ├── requirement.txt
│   ├── run_docker
│   ├── prediction
│   ├── upload_docker
│   └── More ...
│
├── Monitoring
│   └── README.yml               # HelmChart command for Loki and Prometheus setup
│
├── rancher                      # Cluster Management
│   ├── aws
│   └── rancher-common
│
├── terraform
│   ├── aws_backend              # Terraform backend for statement
│   └── eks_infrastructure       # EKS cluster infrastructure
│
├── pre-commit-config.yaml       # Terraform pre-commit
│
└── README.yml

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.