{"id":17810761,"url":"https://github.com/favourdaniel/udacity-machine-learning-project","last_synced_at":"2026-04-20T03:34:22.962Z","repository":{"id":154650686,"uuid":"526990282","full_name":"FavourDaniel/Udacity-Machine-Learning-Project","owner":"FavourDaniel","description":"Operationalization of a machine learning microservice API using Docker and Kubernetes","archived":false,"fork":false,"pushed_at":"2022-11-02T07:12:39.000Z","size":47614,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-07T21:32:07.141Z","etag":null,"topics":["docker","kubernetes","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FavourDaniel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-20T17:09:09.000Z","updated_at":"2022-10-26T09:05:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"1fd84fc8-b023-4b52-9417-cb2b704f0843","html_url":"https://github.com/FavourDaniel/Udacity-Machine-Learning-Project","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FavourDaniel%2FUdacity-Machine-Learning-Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FavourDaniel%2FUdacity-Machine-Learning-Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FavourDaniel%2FUdacity-Machine-Learning-Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FavourDaniel%2FUdacity-Machine-Learning-Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FavourDaniel","download_url":"https://codeload.github.com/FavourDaniel/Udacity-Machine-Learning-Project/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246769982,"owners_count":20830769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","kubernetes","python"],"created_at":"2024-10-27T15:40:16.889Z","updated_at":"2025-10-15T21:40:32.572Z","avatar_url":"https://github.com/FavourDaniel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CircleCI](https://dl.circleci.com/status-badge/img/gh/FavourDaniel/udacity-machine-learning-project/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/FavourDaniel/udacity-machine-learning-project/tree/master)\n\n\nThis is my 4th project which I built during my Udacity Cloud DevOps Nanodegree program\n\n\n## Project Overview\n\nIn this project, you will apply the skills you have acquired in this course to operationalize a Machine Learning Microservice API. \n\nYou are given 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. You can read more about the data, which was initially taken from Kaggle, on [the data source site](https://www.kaggle.com/c/boston-housing). This project tests your 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.\n\n### Project Tasks\n\nYour project goal is to operationalize this working, machine learning microservice using [kubernetes](https://kubernetes.io/), which is an open-source system for automating the management of containerized applications. In this project you will:\n* Test your project code using linting\n* Complete a Dockerfile to containerize this application\n* Deploy your containerized application using Docker and make a prediction\n* Improve the log statements in the source code for this application\n* Configure Kubernetes and create a Kubernetes cluster\n* Deploy a container using Kubernetes and make a prediction\n* Upload a complete Github repo with CircleCI to indicate that your code has been tested\n\nYou can find a detailed [project rubric, here](https://review.udacity.com/#!/rubrics/2576/view).\n\n**The final implementation of the project will showcase your abilities to operationalize production microservices.**\n\n---\n\n## Setup the Environment\n\n* Create a virtualenv with Python 3.7 and activate it. Refer to this link for help on specifying the Python version in the virtualenv. \n```bash\npython3 -m pip install --user virtualenv\n# You should have Python 3.7 available in your host. \n# Check the Python path using `which python3`\n# Use a command similar to this one:\npython3 -m virtualenv --python=\u003cpath-to-Python3.7\u003e .devops\nsource .devops/bin/activate\n```\n* Run `make install` to install the necessary dependencies\n\n### Running `app.py`\n\n1. Standalone:  `python app.py`\n2. Run in Docker:  `./run_docker.sh`\n3. Run in Kubernetes:  `./run_kubernetes.sh`\n\n### Kubernetes Steps\n\n* Setup and Configure Docker locally\n* Setup and Configure Kubernetes locally\n* Create Flask app in Container\n* Run via kubectl\n=======\n## Cloud DevOps ND - C4- Microservices at Scale using AWS \u0026 Kubernetes - Supporting Material and Project Starter\n\nThis repository is associated with Cloud DevOps ND - Course 04 - Microservices at Scale using AWS \u0026 Kubernetes. In here, you'll find:\n1. Supporting material used in the video demonstration in the course \n1. Starting code for a project, in which you can containerize and deploy a machine learning srevice using Kubernetes.\n\n---\n\n### A. Dependencies\n#### A.1. Python\n[Download and install the python](https://www.python.org/downloads/). \n\n#### A.2. Docker Desktop\nYou would require you to install Docker Desktop to create containers for individual microservices. Refer the following links for instructions \n* [macOS](https://docs.docker.com/docker-for-mac/install/), \n* [Windows 10 64-bit: Pro, Enterprise, or Education](https://docs.docker.com/docker-for-windows/install/), \n* [Windows  10 64-bit Home](https://docs.docker.com/toolbox/toolbox_install_windows/). \n* You can find installation instructions for other operating systems at:  https://docs.docker.com/install/\n\n#### A.3. Kubernetes \nYou would need to install any one tool for creating a Kubernetes cluster - KubeOne / Minikube / kubectl on top of Docker Desktop:\n1. [Install and Set Up kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) directly on top of Docker desktop - For Windows/macOS\n2. [Install Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) - For Linux/macOS\n\n#### A.4. AWS account to access AWS Lambda\nYou'll need an [AWS account](https://aws.amazon.com/free/?all-free-tier.\u0026all-free-tier.sort-by=item.additionalFields.SortRank\u0026all-free-tier.sort-order=asc) to get started with [AWS Lambda](https://aws.amazon.com/lambda/), which is a serverless computing platform on cloud.  \n\n#### A.5. An account with Circle CI\nYou may sign up on [CircleCI.com](https://circleci.com/signup/) with your GitHub credentials. \n\n---\n\n### B. The Overarching Diagram\n\n![Overview](https://camo.githubusercontent.com/bb29cd924f9eb66730bbf7b0ed069a6ae03d2f1a/68747470733a2f2f757365722d696d616765732e67697468756275736572636f6e74656e742e636f6d2f35383739322f35353335343438332d62616537616638302d353437612d313165392d393930392d6135363231323531303635622e706e67)\n\n---\n\n### C. Tutorials\n\n#### C.1. AWS Lambda \u0026 Serverless\n\n* [Making Change](https://github.com/udacity/DevOps_Microservices/tree/master/lambda-functions/make-change-tutorial): Create and deploy a serverless lambda function that responds to an input request; this example creates the correct amount of change to make up a value in US dollars.\n* [Wikipedia Query](https://github.com/udacity/DevOps_Microservices/tree/master/lambda-functions/wikipedia-query): Deploy a lambda function that responds to an input, wikipedia page query; this example returns the first sentence of a specific wikipedia page upon being queried.\n\n\n### D. Project Instructions\n\n* [Operationalize a Machine Learning Microservice API](https://github.com/udacity/DevOps_Microservices/tree/master/project-ml-microservice-kubernetes): Deploy a containerized, machine learning application using Kubernetes.\n\nTo run any project code, you'll have to set up a virtual environment with the project dependencies. All of the following instructions are to be completed via a terminal/command line prompt. \n\n### E. Create and Activate an Environment\n\n#### E.1. Git and version control\nThese instructions also assume you have `git` installed for working with Github from a terminal window, but if you do not, you can download that first from this [Github installation page](https://www.atlassian.com/git/tutorials/install-git).\n\n**Now, you're ready to create your local environment!**\n\n1. If you haven't already done so, clone the project repository, and navigate to the main project folder. \n```bash\ngit clone https://github.com/udacity/DevOps_Microservices.git\ncd DevOps_Microservices/project-ml-microservice-kubernetes\n```\n\n2. Create (and activate) a new environment, named `.devops` with Python 3. If prompted to proceed with the install `(Proceed [y]/n)` type y.\n```bash\npython3 -m venv ~/.devops\nsource ~/.devops/bin/activate\n```\n\nAt this point your command line should look something like: `(.devops) \u003cUser\u003e:project-ml-microservice-kubernetes\u003cuser\u003e$`. The `(.devops)` indicates that your environment has been activated, and you can proceed with further package installations.\n\n3. Installing dependencies via project `Makefile`. Many of the project dependencies are listed in the file `requirements.txt`; these can be installed using `pip` commands in the provided `Makefile`. While in your project directory, type the following command to install these dependencies.\n```bash\nmake install\n```\n\nNow most of the `.devops` libraries are available to you. There are a couple of other libraries that we'll be using, which can be downloaded as specified, below. \n\n---\n\n#### E.2. Other Libraries\n\nWhile you still have your `.devops` environment activated, you will still need to install:\n* Docker\n* Hadolint\n* Kubernetes ([Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) if you want to run Kubernetes locally)\n\n#### E.3. Docker\n\nYou will need to use Docker to build and upload a containerized application. If you already have this installed and created a docker account, you may skip this step.\n\n1. You’ll need to [create a free docker account](https://hub.docker.com/signup), where you’ll choose a unique username and link your email to a docker account. **Your username is your unique docker ID.**\n\n2. To install the latest version of docker, choose the Community Edition (CE) for your operating system, [on docker’s installation site](https://docs.docker.com/v17.12/install/). It is also recommended that you install the latest, **stable** release:\n\n3. After installation, you can verify that you’ve successfully installed docker by printing its version in your terminal: `docker --version`\n\n#### E.4. Run Lint Checks\n\nThis project also must pass two lint checks; `hadolint` checks the Dockerfile for errors and `pylint` checks the `app.py` source code for errors.\n\n1. Install `hadolint` following the instructions, [on hadolint's page]( https://github.com/hadolint/hadolint): \n\n**For Mac:**\n```bash\nbrew install hadolint\n```\n**For Windows:**\n```bash\nscoop install hadolint\n```\n2. In your terminal, type: `make lint` to run lint checks on the project code. If you haven’t changed any code, all requirements should be satisfied, and you should see a printed statement that rates your code (and prints out any additional comments):\n\n```bash\n------------------------------------\nYour code has been rated at 10.00/10\n```\n\nThat's about it! When working with kubernetes, you may need to install some other libraries, but these instructions will set you up with an environment that can build and deploy Docker containers.\n\n\u003e\u003e\u003e\u003e\u003e\u003e\u003e 4f1e50422012863102d588991b52319a94e1a53f\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffavourdaniel%2Fudacity-machine-learning-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffavourdaniel%2Fudacity-machine-learning-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffavourdaniel%2Fudacity-machine-learning-project/lists"}