Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/topagrume/ml_flow_versionning
https://github.com/topagrume/ml_flow_versionning
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/topagrume/ml_flow_versionning
- Owner: TopAgrume
- Created: 2024-11-06T13:26:23.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-06T16:12:05.000Z (about 2 months ago)
- Last Synced: 2024-11-06T17:25:27.602Z (about 2 months ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Project usage guide
This guide provides instructions on how to use and test the project, including setting up the MLflow server, pushing the model, and testing the web service.
## 1. Launching the MLflow dockerized server
To start the MLflow server inside a Docker container, use the following command:
```sh
docker compose up mlflow-server -d
```This will:
- Start the MLflow server in detached mode (`-d`).
- Make the MLflow UI available at `http://localhost:8080`.## 2. Create and push the default model to MLflow
After launching the MLflow server, you need to create and register the default model and next model. Run the following Python script to train and push the model to the MLflow model registry:
```sh
python run_and_push_model.py
```This script:
- Trains a simple scikit-learn logistic regression model.
- Trains a simple scikit-learn random forest model.
- Pushes the models to the MLflow server for future use.## 3. Launch the web service
To start the web service (FastAPI), use this command:
```sh
docker compose up
```This will:
- Launch the FastAPI application.
- Make the web service available at `http://localhost:8000`.## How to test the project
### 1. Test predictions
To test the prediction functionality of the web service, run the following script:
```sh
./web_server/tests/test_predict.sh
```This script:
- Sends a POST request with sample input data to the `/predict` endpoint of the web service.
- Prints out the prediction response from the model.### 2. Test model updates
To test dynamic model updates (e.g., updating the model used by the web service), run:
```sh
./web_server/tests/test_update.sh
```This script:
- Sends a POST request to the `/update-model` endpoint of the web service to update the model version.
- Confirms that the model has been successfully updated and is being used for future predictions.