This is a microservice architecture built with Kubernetes. The purpose of this microservice is to enable machine learning training and prediction. This prediction evolve around house prices in boston. You can read about it from Kaggle, on the data source site.
run_docker.sh
: Deploy containerized application using Docker and make a predictionmake_prediction.sh
upload_docker.sh
: Upload container to Docker Hub.run_kubernetes.sh
: Run the deployed application in a Kubernetes cluster and make a predictionmake_prediction.sh
.circleci/config.yml
: Integrate with CircleCI to indicate code has been tested
Your 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. In this project you will:
- Test your project code using linting
- Complete a Dockerfile to containerize this application
- Deploy your 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 your code has been tested
You can find a detailed project rubric, here.
The final implementation of the project will showcase your abilities to operationalize production microservices.
- Create a virtualenv with Python 3.7 and activate it. Refer to this link for help on specifying the Python version in the virtualenv.
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
- Run
make install
to install the necessary dependencies
- Standalone:
python app.py
- Run in Docker:
./run_docker.sh
- Run in Kubernetes:
./run_kubernetes.sh
- Setup and Configure Docker locally
- Setup and Configure Kubernetes locally
- Create Flask app in Container
- Run via kubectl
Pre-Requisites: Python 3.7, Docker Desktop, Minikube
After Forking/Cloning, you can get up and running in just a few minutes. From the project's root folder:
- Setup the Environment
Create a virtualenv and activate it
python3 -m venv <your_venv>
source <your_venv>/bin/activate
- Install dependencies
Run make install
to install the necessary dependencies
- Run app.py
- Standalone:
python app.py
- Run in Docker:
./run_docker.sh
+make_prediction.sh
- Run in Kubernetes:
./run_kubernetes.sh
+make_prediction.sh