Skip to content

Commit b8645af

Browse files
committed
document KFP MLflow plugin
Signed-off-by: Alyssa Goins <agoins@redhat.com>
1 parent f9e5102 commit b8645af

3 files changed

Lines changed: 240 additions & 0 deletions

File tree

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
+++
2+
title = "MLflow Plugin Configuration"
3+
weight = 3
4+
+++
5+
6+
## KFP MLflow Plugin
7+
8+
Kubeflow Pipelines supports an MLflow plugin that enables automatic experiment tracking. When enabled, the plugin registers each KFP run with MLflow, allowing users to view and analyze their pipeline runs in the MLflow UI.
9+
10+
## Prerequisites
11+
12+
- Admin access to a Kubernetes cluster
13+
- Kubeflow Pipelines installed on your cluster
14+
- kubectl configured to access your cluster
15+
16+
## Deploying MLflow
17+
18+
You need an MLflow instance running on your Kubernetes cluster. One recommended option is the [OpenDataHub MLflow Operator](https://github.com/opendatahub-io/mlflow-operator), which simplifies MLflow deployment and management on Kubernetes.
19+
20+
To deploy using the MLflow Operator:
21+
22+
1. Follow the [deployment instructions](https://github.com/opendatahub-io/mlflow-operator#to-deploy-on-the-cluster) in the operator repository
23+
2. Note the MLflow service endpoint and port (typically `https://<service-name>:8443`)
24+
3. If using TLS, obtain the CA certificate for your MLflow deployment
25+
26+
## Security and TLS
27+
28+
The KFP MLflow plugin uses TLS to secure communication with the MLflow server. Configure the following TLS settings in your API server configuration:
29+
30+
- **caBundlePath**: Path to the CA certificate bundle used to verify the MLflow server's certificate
31+
- **insecureSkipVerify**: Set to `false` (default) to enforce certificate verification
32+
33+
For production deployments, always use valid TLS certificates and keep `insecureSkipVerify` set to `false`.
34+
35+
## MLflow Experiments
36+
37+
When the plugin is enabled, pipeline runs are logged to MLflow experiments:
38+
39+
- **Default experiment**: If no experiment is specified, runs are logged to an experiment named "default" (created automatically if it doesn't exist)
40+
- **Custom experiments**: Users can specify a custom experiment name when submitting a run. KFP will create the experiment if it doesn't already exist
41+
- **RBAC**: For enhanced security, you can enforce Kubernetes RBAC for MLflow requests using the [Kubeflow MLflow extension](https://github.com/kubeflow/mlflow-integration)
42+
43+
## MLflow Workspaces
44+
45+
MLflow workspaces provide an optional organizational layer and permission framework, similar to Kubernetes namespaces. A workspace can contain multiple experiments, but each experiment belongs to only one workspace.
46+
47+
**Configuration:**
48+
- When `authType` is set to `kubernetes`, workspaces are **enabled by default**
49+
- For other authentication types, workspaces are **disabled by default**
50+
- You can explicitly control this behavior by setting `workspacesEnabled` to `true` or `false` in the plugin configuration
51+
52+
**Requirements:**
53+
To use MLflow workspaces, you must deploy the [Kubeflow MLflow extension](https://github.com/kubeflow/mlflow-integration), which adds Kubernetes-native authentication and multi-tenancy support to MLflow.
54+
55+
## Configuring the KFP MLflow Plugin
56+
57+
To enable the MLflow plugin, add the following configuration to your KFP API server `config.json` file:
58+
59+
```json
60+
{
61+
"plugins": {
62+
"mlflow": {
63+
"endpoint": "https://<mlflow-service>:8443",
64+
"timeout": 30,
65+
"tls": {
66+
"insecureSkipVerify": <boolean>,
67+
"caBundlePath": "<path-to-ca-bundle>"
68+
},
69+
"settings": {
70+
"workspacesEnabled": true,
71+
"authType": "kubernetes",
72+
"defaultExperimentName": "default",
73+
"experimentDescription": "Created by Kubeflow Pipelines"
74+
}
75+
}
76+
}
77+
}
78+
```
79+
80+
### Configuration Values
81+
82+
Replace the placeholder values with your deployment-specific values:
83+
84+
- **endpoint**: The full URL of your MLflow server (e.g., `https://mlflow-service.mlflow.svc.cluster.local:8443`)
85+
- **timeout**: Timeout in seconds for MLflow API calls (default: `30`)
86+
- **tls**: TLS configuration for MLflow communication
87+
- **insecureSkipVerify**: Set to `true` to skip TLS certificate verification (not recommended for production)
88+
- **caBundlePath**: Path to the CA certificate for your MLflow server
89+
- **settings**: See the [user guide](/docs/components/pipelines/user-guides/integrations/mlflow-plugin/) for a complete list of MLflow plugin settings
90+
91+
## Restart the API Server
92+
93+
After updating the configuration, restart the KFP API server to apply the changes:
94+
95+
```bash
96+
kubectl rollout restart deployment/ml-pipeline -n kubeflow
97+
```
98+
99+
Verify the plugin is enabled by checking the API server logs:
100+
101+
```bash
102+
kubectl logs -n kubeflow deployment/ml-pipeline | grep mlflow
103+
```
104+
105+
You should see messages indicating the MLflow plugin has been initialized successfully.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
+++
2+
title = "KFP MLflow Integration Overview"
3+
description = "Learn about integrating MLflow with Kubeflow Pipelines for experiment tracking"
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. It provides tools for experiment tracking, model versioning, and deployment. The MLflow UI is a powerful interface for organizing, querying, and visualizing experiments and their corresponding runs, including run parameters, metrics, and artifacts.
10+
11+
## Integration Overview
12+
13+
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:
14+
15+
- Track pipeline runs as MLflow experiments
16+
- View pipeline parameters and metrics in the MLflow UI
17+
- Organize related runs under custom experiments
18+
- Maintain a complete audit trail of your ML workflows
19+
20+
This integration bridges the gap between pipeline orchestration and experiment tracking, giving you a unified view of your machine learning workflows.
21+
22+
## What's Next
23+
- **For Admins**: See the [operator guide](/docs/components/pipelines/operator-guides/mlflow-plugin/) to deploy and configure MLflow for your cluster
24+
- **For Users**: Learn how to [configure and use the MLflow plugin](../mlflow-plugin/) in your pipelines
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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 = 2
5+
+++
6+
7+
## Plugin Overview
8+
9+
The KFP MLflow plugin provides seamless integration between Kubeflow Pipelines and MLflow for experiment tracking. Once configured by your cluster administrator, the plugin automatically logs each pipeline run to MLflow, capturing:
10+
11+
- Pipeline run metadata and status
12+
- Input parameters
13+
- Scalar metrics and artifacts
14+
15+
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.
16+
17+
18+
## Prerequisites
19+
20+
Before using the MLflow plugin, ensure your cluster administrator has:
21+
- Deployed MLflow on your cluster
22+
- Enabled and configured the KFP MLflow plugin
23+
24+
See the [operator guide](/docs/components/pipelines/operator-guides/mlflow-plugin/) for setup instructions.
25+
26+
## User Configuration
27+
28+
To use the MLflow plugin with your pipelines, configure the plugin in your KFP API `config.json` file:
29+
30+
```json
31+
{
32+
"plugins": {
33+
"mlflow": {
34+
"endpoint": "https://<cluster-address>:8443",
35+
"timeout": 30,
36+
"tls": {
37+
"insecureSkipVerify": false,
38+
"caBundlePath": "/path/to/mlflow-ca-cert.pem"
39+
},
40+
"settings": {
41+
"workspacesEnabled": true,
42+
"authType": "kubernetes"
43+
}
44+
}
45+
}
46+
}
47+
```
48+
49+
## Configuration Reference
50+
51+
### Required Settings
52+
53+
#### endpoint
54+
The URL of your MLflow tracking server (e.g., `https://mlflow.example.com:8443`).
55+
56+
#### timeout
57+
Timeout in seconds for MLflow API calls. Default is `30`.
58+
59+
#### tls
60+
TLS configuration for secure connections:
61+
- `insecureSkipVerify`: Set to `false` to verify the MLflow server certificate (recommended)
62+
- `caBundlePath`: Path to the CA certificate bundle for the MLflow server
63+
64+
### Optional Settings
65+
66+
The `settings` field provides additional configuration options:
67+
68+
#### authType
69+
Authentication method for the MLflow server. Options:
70+
- `kubernetes` (default): Use Kubernetes-based authentication
71+
- `bearer`: Use bearer token authentication
72+
- `basic-auth`: Use username/password authentication
73+
- `none`: No authentication
74+
75+
#### credentialSecretRef
76+
When using `bearer` or `basic-auth` authentication, this field references a Kubernetes secret containing the credentials.
77+
78+
#### workspacesEnabled
79+
Enable MLflow workspaces for multi-tenant organization. When `authType` is `kubernetes`, this defaults to `true`. Otherwise, it defaults to `false`. Learn more in the [operator guide](/docs/components/pipelines/operator-guides/mlflow-plugin/).
80+
81+
#### defaultExperimentName
82+
The experiment name to use when none is specified for a pipeline run. Default is `"default"`.
83+
84+
#### experimentDescription
85+
Default description for newly created experiments. Default is `"Created by Kubeflow Pipelines"`.
86+
87+
#### kfpBaseURL
88+
If set, this URL is added as a tag to MLflow runs for traceability back to KFP.
89+
90+
#### mlflowBaseURL
91+
Base URL for linking to the MLflow UI from pipeline runs.
92+
93+
#### mlflowUIPathPrefix
94+
Path prefix for constructing MLflow UI links.
95+
96+
#### injectUserEnvVars
97+
When set to `true`, injects MLflow environment variables into pipeline containers, enabling components to interact with MLflow directly:
98+
99+
**General variables:**
100+
- `MLFLOW_RUN_ID`: The MLflow run ID for the pipeline
101+
- `MLFLOW_TRACKING_URI`: The MLflow endpoint URL
102+
- `MLFLOW_EXPERIMENT_ID`: The MLflow experiment ID
103+
- `MLFLOW_WORKSPACE`: The MLflow workspace name (if workspaces are enabled)
104+
105+
**Authentication variables:**
106+
- `MLFLOW_TRACKING_TOKEN`: Bearer token (when using bearer auth)
107+
- `MLFLOW_TRACKING_USERNAME` and `MLFLOW_TRACKING_PASSWORD`: Credentials (when using basic auth)
108+
109+
## Using the Plugin
110+
111+
Once configured, the MLflow plugin automatically tracks your pipeline runs. 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.

0 commit comments

Comments
 (0)