Operationalize a Python flask app—in a provided file, app.py
—that serves out predictions (inference) about housing prices through API calls.
Main aim of the project is to containerize the python flask-app and deploy the container in Kubernetes cluster. This project could be extended to any pre-trained machine learning model, such as those for image recognition and data labeling.
- Test project code using linting
- Complete a Dockerfile to containerize this application
- Deploy 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
- Create a virtualenv and activate it
python3 -m venv <your_venv>
source <your_venv>/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
output_txt_files/docker_out.txt
contains logs returned after running the app with Dockeroutput_txt_files/kubernetes_out.txt
containes logs and the prediction returned after running the app with Kubernetes(run_kubernetes.sh
)run_docker.sh
contains the steps to get Docker running the app locallyrun_kubernetes.sh
contains the steps to get Kubernetes running the app locallyupload_docker.sh
contains the steps to upload the image to the Docker repository