0
0
MLOpsdevops~5 mins

Multi-tenancy and isolation in MLOps - Commands & Configuration

Choose your learning style9 modes available
Introduction
When many users or teams share the same machine learning platform, their work must stay separate and safe. Multi-tenancy and isolation help keep each user's data and models private and prevent interference.
When multiple data science teams use the same ML platform but need their projects separated.
When running different ML experiments on shared hardware without affecting each other.
When deploying models for different clients on the same server but ensuring data privacy.
When you want to limit resource use per user to avoid one user slowing down others.
When managing access control so users only see their own models and data.
Commands
Start the MLflow tracking server with a local SQLite database and artifact storage. This server will handle multiple users' experiments in isolated runs.
Terminal
mlflow server --backend-store-uri sqlite:///mlflow.db --default-artifact-root ./mlruns --host 0.0.0.0 --port 5000
Expected OutputExpected
2024/06/01 12:00:00 INFO mlflow.server: Starting MLflow tracking server 2024/06/01 12:00:00 INFO mlflow.store.db.utils: Creating initial MLflow database tables... 2024/06/01 12:00:00 INFO mlflow.server: Listening at: http://0.0.0.0:5000
--backend-store-uri - Sets the database for experiment metadata
--default-artifact-root - Sets where model files and artifacts are stored
--host - Makes the server accessible on all network interfaces
Create a new experiment named 'team_alpha_project' to isolate this team's runs and data from others.
Terminal
mlflow experiments create --experiment-name team_alpha_project
Expected OutputExpected
Created experiment with ID 1
Run an MLflow project under the 'team_alpha_project' experiment to keep its runs separate from other teams.
Terminal
mlflow run . --experiment-name team_alpha_project
Expected OutputExpected
2024/06/01 12:05:00 INFO mlflow.projects: Running run with ID '1234567890abcdef' 2024/06/01 12:05:10 INFO mlflow.projects: Run succeeded
--experiment-name - Specifies which experiment to log this run under
List all experiments to verify that each team has its own isolated experiment space.
Terminal
mlflow experiments list
Expected OutputExpected
experiment_id name artifact_location 1 team_alpha_project ./mlruns/1 2 team_beta_project ./mlruns/2
Key Concept

If you remember nothing else, remember: separate experiments and artifact storage keep each user's ML work private and isolated on a shared platform.

Common Mistakes
Running all experiments under the default experiment without naming separate ones
This mixes all users' runs together, making it hard to separate or secure data per user.
Always create and use named experiments for each team or user to isolate their runs.
Using the same artifact storage path for all users without subfolders
Artifacts can overwrite each other or be accessible to unauthorized users.
Use separate artifact root paths or subfolders per experiment or user.
Summary
Start the MLflow server with a shared backend and artifact storage.
Create named experiments to isolate each team's or user's runs.
Run ML projects specifying the experiment to keep data separated.
List experiments to verify isolation and organization.