Now we want to manage the entire lifecycle of our ML model. In this step, you'll need to launch a tracking server. This way we will also have access to the model registry.
Your task is to:
launch the tracking server on your local machine,
select a SQLite db for the backend store and a folder called artifacts for the artifacts store.
You should keep the tracking server running to work on the next two exercises that use the server.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
To manage the lifecycle of your ML model, you'll need to launch an MLflow tracking server. This will also provide access to the model registry. Below are the steps to launch the tracking server on your local machine.
Prerequisites
You have MLflow installed. If not, you can install it using pip:
bash
pip install mlflow
code
### Launching the Tracking Server
To launch the tracking server, you can use the `mlflow server` command. You need to specify the backend store and the artifacts store.
1. **Backend Store**: You'll use a SQLite database as the backend store. SQLite is a self-contained, file-based database, making it a convenient choice for local development.
2. **Artifacts Store**: You'll use a directory named `artifacts` to store the artifacts.
Here's how you can launch the tracking server:
```bash
mlflow server --backend-store-uri sqlite:///mlflow.db --default-artifact-root ./artifacts --host 0.0.0.0 --port 5000
Let's break down the command:
--backend-store-uri sqlite:///mlflow.db: Specifies the SQLite database file (mlflow.db) as the backend store. If the file doesn't exist, MLflow will create it.
--default-artifact-root ./artifacts: Specifies the directory (artifacts) where MLflow will store artifacts. If the directory doesn't exist, MLflow will create it.
--host 0.0.0.0: Makes the tracking server accessible from any IP address. For a local setup, you can use 127.0.0.1 or localhost instead.
--port 5000: Specifies the port on which the tracking server will listen. You can choose any available port.
Running the Command
Open a terminal.
Navigate to the directory where you want to store the mlflow.db file and the artifacts directory.
Run the mlflow server command as shown above.
The tracking server will start, and you'll see output indicating that it's running. The server will continue to run until you stop it (e.g., by pressing Ctrl+C in the terminal).
Verifying the Tracking Server
To verify that the tracking server is running, you can open a web browser and navigate to http://localhost:5000. You should see the MLflow UI.
Next Steps
With the tracking server running, you're ready to proceed with the next exercises that utilize the server for model tracking and registry. Keep the tracking server running in the background.