End-to-end machine learning using FastAPI, Streamlit, Docker, GitHub Actions, Microsoft AZURE and EvidentlyAI
The Objective of the ML model is to predict a credit score fro historical loan application data to predict whether or not an applicant will be able to repay a loan.
We will create a model to predict credit scores and deploy that model as an API using FastAPI and use Streamlit to create a WebAPP. We use Github Actions to facilitate and automatize DevOps and MLOps (CI/CD).
VS Code — as the IDE of choice.
pipenv — to handle package dependencies, create virtual environments, and load environment variables.
FastAPI — Python API development framework for ML deployment
Uvicorn — ASGI server for FastAPI app.
Docker Desktop — build and run Docker container images on our local machine. (MacOS 11)
Containers are an isolated environment to run any code
Azure Container Registry — repository for storing our container image in Azure cloud.
Azure App Service — PaaS service to host our FastAPI app server.
Github Actions — automate continuous deployment workflow of model serving through FastAPI and dashboarding through Streamlit app.
Streamlit - Dashboard
PyTest - Testing of Web APP functionality through
EvidentlyAI - Data Drift detection
We will cover in the readme the below concepts:
- How to create dockerfile for ML API deployment using FastAPI?
- How to run different docker commands to build, run and debug and
- How to push docker image to Github using Github Actions
- How to test ML API endpoint which is exposed by the running ML API docker container?
The data is provided by Home Credit.
Open a terminal
mkdir project_name
cd project_name
code .
Install pipenv
sudo -H pip install -U pipenv
pipenv install fastapi uvicorn