|
| 1 | ++++ |
| 2 | +title = "MLflow Plugin for KFP" |
| 3 | +description = "Deploy MLflow on your cluster and configure the KFP MLflow plugin to use it." |
| 4 | +weight = 1 |
| 5 | ++++ |
| 6 | + |
| 7 | +## MLflow & Experiment Tracking |
| 8 | + |
| 9 | +[MLflow](https://mlflow.org/) is an open-source platform for managing the end-to-end machine learning lifecycle. |
| 10 | +It provides tools for experiment tracking, model versioning, and deployment. |
| 11 | +The MLflow UI is a powerful interface for organizing, querying, and visualizing experiments and their corresponding runs, including run parameters and scalar metric artifacts. |
| 12 | + |
| 13 | + |
| 14 | +## Integration Overview |
| 15 | + |
| 16 | +The KFP MLflow integration enables automatic experiment tracking for your Kubeflow Pipelines. When enabled, each pipeline run is automatically registered in MLflow, allowing you to: |
| 17 | + |
| 18 | +- Track pipeline runs as MLflow experiments |
| 19 | +- View pipeline parameters and metrics in the MLflow UI |
| 20 | +- Organize related runs under custom experiments |
| 21 | +- Maintain a complete audit trail of your ML workflows |
| 22 | + |
| 23 | +This integration bridges the gap between pipeline orchestration and experiment tracking, giving you a unified view of your machine learning workflows. |
| 24 | +All tracked data is viewable in the MLflow UI, organized by experiments. You can specify a custom experiment name for each run, or use the default experiment configured by your administrator. |
| 25 | +This page provides detailed instructions on how to set up the MLflow plugin for Kubeflow Pipelines at the user level, once it has been deployed and configured at the [admin level](/docs/components/pipelines/operator-guides/mlflow-plugin/). |
| 26 | + |
| 27 | +## Prerequisites |
| 28 | + |
| 29 | +Before using the MLflow plugin, ensure your cluster administrator has: |
| 30 | +- Deployed MLflow on your cluster |
| 31 | +- Enabled and configured the KFP MLflow plugin |
| 32 | + |
| 33 | +See the [operator guide](/docs/components/pipelines/operator-guides/mlflow-plugin/) for setup instructions. |
| 34 | + |
| 35 | +## User Configuration |
| 36 | + |
| 37 | +To use the MLflow plugin with your pipelines, configure the plugin in your KFP API `config.json` file: |
| 38 | + |
| 39 | +```json |
| 40 | +{ |
| 41 | + "plugins": { |
| 42 | + "mlflow": { |
| 43 | + "endpoint": "<schema>://<mlflow-service>:<mlflow-port>", |
| 44 | + "timeout": 30, |
| 45 | + "tls": { |
| 46 | + "insecureSkipVerify": <boolean>, |
| 47 | + "caBundlePath": "<path-to-ca-bundle>" |
| 48 | + }, |
| 49 | + "settings": {} |
| 50 | + } |
| 51 | + } |
| 52 | +} |
| 53 | +``` |
| 54 | + |
| 55 | +## Configuring Plugin Settings |
| 56 | +See the [operator guide](/docs/components/pipelines/operator-guides/mlflow-plugin/#configuring-the-kfp-mlflow-plugin) for instructions on configuring the `endpoint`, `timeout` and `TLS` fields. |
| 57 | +The following `settings` fields are available for further configuration: |
| 58 | + |
| 59 | +#### authType |
| 60 | +Authentication method for the MLflow server. Options: |
| 61 | +- `kubernetes` (default): Use Kubernetes-based authentication |
| 62 | +- `bearer`: Use bearer token authentication |
| 63 | +- `basic-auth`: Use username/password authentication |
| 64 | +- `none`: No authentication |
| 65 | + |
| 66 | +#### credentialSecretRef |
| 67 | +When using `bearer` or `basic-auth` authentication, this field references a Kubernetes secret containing the credentials. |
| 68 | + |
| 69 | +#### workspacesEnabled |
| 70 | +Enable MLflow workspaces for multi-tenant organization. |
| 71 | +When `authType` is `kubernetes`, this defaults to `true`. Otherwise, it defaults to `false`. |
| 72 | +Learn more about workspaces in MLflow in the [operator guide](/docs/components/pipelines/operator-guides/mlflow-plugin/#mlflow-workspaces). |
| 73 | + |
| 74 | +#### defaultExperimentName |
| 75 | +Default experiment name when none is specified for a pipeline run. Default is `"default"`. |
| 76 | + |
| 77 | +#### experimentDescription |
| 78 | +Default description for newly created experiments. Default is `"Created by Kubeflow Pipelines"`. |
| 79 | + |
| 80 | +#### kfpBaseURL |
| 81 | +If set, this URL is added as a tag to MLflow runs for traceability back to KFP. |
| 82 | + |
| 83 | +#### mlflowBaseURL |
| 84 | +Base URL for linking to the MLflow UI from pipeline runs. |
| 85 | + |
| 86 | +#### mlflowUIPathPrefix |
| 87 | +Path prefix for constructing MLflow UI links. |
| 88 | + |
| 89 | +#### injectUserEnvVars |
| 90 | +When set to `true`, injects MLflow environment variables into user containers, enabling a component's user code to interact with MLflow directly: |
| 91 | + |
| 92 | +**General variables:** |
| 93 | +- `MLFLOW_RUN_ID`: The MLflow run ID for the pipeline |
| 94 | +- `MLFLOW_TRACKING_URI`: The MLflow endpoint URL |
| 95 | +- `MLFLOW_EXPERIMENT_ID`: The MLflow experiment ID |
| 96 | +- `MLFLOW_WORKSPACE`: The MLflow workspace name (if workspaces are enabled) |
| 97 | + |
| 98 | +**Authentication variables:** |
| 99 | +- `MLFLOW_TRACKING_TOKEN`: Bearer token (when using bearer auth) |
| 100 | +- `MLFLOW_TRACKING_USERNAME` and `MLFLOW_TRACKING_PASSWORD`: Credentials (when using basic auth) |
| 101 | + |
| 102 | +## Using the Plugin |
| 103 | + |
| 104 | +Once configured, pipeline runs are automatically registered in MLflow. You can optionally specify a custom experiment name when submitting a run through the KFP UI or SDK. If no experiment is specified, runs are logged to the default experiment. |
| 105 | + |
| 106 | +### Visualizing Pipeline Artifacts with MLflow |
| 107 | +Current plugin artifact support extends to scalar Metric artifacts, which are logged to MLflow runs and can be visualized in the MLflow console. |
| 108 | + |
| 109 | +### Visualizing Pipeline Parameters with MLflow |
| 110 | +Pipeline parameters are automatically logged to MLflow runs, making it easy to track and analyze the configuration of your pipeline runs. |
0 commit comments