How to Integrate with MLflow¶
If your Kedro project uses kedro-mlflow for experiment tracking, Kedro-Dagster automatically captures MLflow run information and displays it in the Dagster UI. See the Kedro-MLflow documentation for setting up MLflow tracking in Kedro.
What happens automatically¶
When a Kedro node executes within a Dagster context and an active MLflow run is detected, Kedro-Dagster:
- Captures run metadata: Extracts experiment ID, run ID, and tracking URI from the active MLflow run.
- Generates run URLs: Creates clickable links to view the MLflow run in the MLflow UI.
- Logs to Dagster: Records MLflow run information in Dagster logs, run tags, and asset materialization metadata.
No Dagster-specific MLflow code is needed; Kedro-MLflow hooks fire automatically during Dagster runs.
Configure MLflow for your project¶
Add an mlflow.yml to each environment's configuration directory (conf/<ENV>/mlflow.yml). Models and artifacts are tracked via Kedro-MLflow datasets in the catalog:
"{namespace}.{variant}.regressor":
type: kedro_mlflow.io.models.MlflowModelTrackingDataset
flavor: mlflow.sklearn
artifact_path: "{namespace}/{variant}/regressor"
See the Example Project for a complete multi-environment MLflow setup with Optuna integration.
See also¶
- Concepts: how hook preservation enables MLflow compatibility
- Architecture: details on which hooks fire during Dagster execution
- How to Use Dagster Partitions: note on hook limitations during backfills