Contanerizing 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. Data was initially taken from Kaggle,the data source site. This project tests our ability to operationalize a Python flask app—in a provided file, app.py—that serves out predictions (inference) about housing prices through API calls. This project could be extended to any pre-trained machine learning model, such as those for image recognition and data labeling. The app is containerized via docker desktop and kubernetes cluster. It is verified by circleci.
- cloned devops udacity repo (starter code)
- created .circleci/config.yml
- set up virtual environment - python3 -m venv ~/.devops - source ~/.devops/bin/activate
- installed dependencies via makefile - make install
- linting project (hadolint for Dockerfile / pylint for Python) -make lint
- Completed steps in Dockerfile
- Completed run_docker.sh
- Running run_docker.sh - ./run_docker.sh
- Running predictions via make_predictons.sh in another terminal. - ./make_predictions.sh
- Added log statement in app.py
- Repeat steps 8 and 9
- Added the logs in docker_out.txt
- Completed upload_docker.sh
- Uploaded image on dockerhub via upload_docker.sh - ./upload_docker.sh
- Configure Kubernetes to run locally - kubectl config view
- Completed run_kubernetes.sh
- Running run_kubernetes.sh - ./run_kubernetes.sh
- checking status of kubernetes pod - kubectl get pod
- Repeat step 17 once status is running.
- Making a Prediction via make_predictions.sh - ./make_prediction.sh
- Add the logs in kubernetes_out.txt
- Delete the kubernetes cluster
- Pushed project directory to github
- Set up Circleci project
- Added a status badge.
- .circleci
- .circleci/config.yml for circleci configuration
- model_data
- contains data for machine learning app.
- output_txt_files
- docker_out.txt
- contains log info of prediction in docker container. -kubernetes_out.txt
- contains log info of prediction in kubernetes cluster.
- docker_out.txt
- app.py -application source code
- Dockerfile
- configuration for Docker image
- make_prediction.sh
- bash file to get prediction from app
- Makefile
- commands to setup environment and linting
- requirements.txt
- contains dependencies
- run_docker.sh
- bash file to build and run docker image.
- run_kubernetes.sh
- bash file to build and run kubernetes cluster.
- upload_docker.sh
- bash file to upload docker to dockerhub.
- README.md
- Project summary, steps and repository overview