Our objective is to build a complete system for ML applications where we can track experiments and save artifacts, deploy ML models and monitor models.
I have used simple Banana dataset which is a binary dataset.
- mlflow server --backend-store-uri sqlite:///mlflow.db --default-artifact-root ./artifacts
- prefect orion start
- prefect storage create
- select local storage
- give path "./.prefect"
- prefect storage ls
- copy the id of storage
- prefect storage set-default 'id'
- prefect deployment create pipeline-deployment.py
- Create a worker with subprocess using the prefect ui
- prefect agent start 'workerid'
-
In docker-compose.yml file you can provide the env varibles with run id and exp_id for the best experiment. The webservice app will pick up the model from the artifacts and deploy it.
-
Prediction webservice will serve at "http://localhost:8000/prediction"
-
You can send json payload with your values to this service in the given format. {"AT_1": at_1, "AT_2": at_2}
-
You can also access the SwaggerUI for interactive usage and try out the API at "http://localhost:8000/docs"
-
For simulating production usage, run the send_data.py script. It will send continuous requests to the API and fill the MongoDB database with the parameters, that monitoring service will use to generate Data Drift reports.
-
In order to Fetch the DataDrift Dashboard from the monitoring service, Go to the url "http://127.0.0.1:8001/get_dashboard" , wait for sometime for the application to load the latest Dashboard.
** If you don't want to launch the training job, you can directly do docker-compose up to start the services.
On every push and pull request on main, Github CI pipelines starts , it builds the docker images and pushes them to DockerHub.
- FastAPI
- MLFLOW
- Prefect
- Docker
- Docker-compose
- Pytest
- Pylint
- Black
- Isort
- Pre-commit hooks
- Github actions CI
- EvidentlyAI