| 
									
										
										
										
											2024-06-18 15:53:06 +02:00
										 |  |  | --- | 
					
						
							|  |  |  | title: Run the MLflow Connector Externally | 
					
						
							|  |  |  | slug: /connectors/ml-model/mlflow/yaml | 
					
						
							|  |  |  | --- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {% connectorDetailsHeader | 
					
						
							| 
									
										
										
										
											2025-02-03 18:58:13 +05:30
										 |  |  | name="MLflow" | 
					
						
							| 
									
										
										
										
											2024-06-18 15:53:06 +02:00
										 |  |  | stage="PROD" | 
					
						
							|  |  |  | platform="OpenMetadata" | 
					
						
							|  |  |  | availableFeatures=["ML Features", "Hyperparameters", "ML Store"] | 
					
						
							|  |  |  | unavailableFeatures=[] | 
					
						
							|  |  |  | / %} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | In this section, we provide guides and references to use the MLflow connector. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Configure and schedule MLflow metadata and profiler workflows from the OpenMetadata UI: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | - [Requirements](#requirements) | 
					
						
							|  |  |  | - [Metadata Ingestion](#metadata-ingestion) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-18 08:42:17 +02:00
										 |  |  | {% partial file="/v1.8/connectors/external-ingestion-deployment.md" /%} | 
					
						
							| 
									
										
										
										
											2024-06-18 15:53:06 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | ## Requirements
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### Python Requirements
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-18 08:42:17 +02:00
										 |  |  | {% partial file="/v1.8/connectors/python-requirements.md" /%} | 
					
						
							| 
									
										
										
										
											2024-06-18 15:53:06 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | To run the MLflow ingestion, you will need to install: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ```bash | 
					
						
							|  |  |  | pip3 install "openmetadata-ingestion[mlflow]" | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## Metadata Ingestion
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | All connectors are defined as JSON Schemas. | 
					
						
							|  |  |  | [Here](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-spec/src/main/resources/json/schema/entity/services/connections/mlmodel/mlflowConnection.json) | 
					
						
							|  |  |  | you can find the structure to create a connection to MLflow. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | In order to create and run a Metadata Ingestion workflow, we will follow | 
					
						
							|  |  |  | the steps to create a YAML configuration able to connect to the source, | 
					
						
							|  |  |  | process the Entities if needed, and reach the OpenMetadata server. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The workflow is modeled around the following | 
					
						
							|  |  |  | [JSON Schema](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-spec/src/main/resources/json/schema/metadataIngestion/mlmodelServiceMetadataPipeline.json) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### 1. Define the YAML Config
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | This is a sample config for MLflow: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {% codePreview %} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {% codeInfoContainer %} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #### Source Configuration - Service Connection
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {% codeInfo srNumber=1 %} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | **trackingUri**: MLflow Experiment tracking URI. E.g., http://localhost:5000 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {% /codeInfo %} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {% codeInfo srNumber=2 %} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | **registryUri**: MLflow Model registry backend. E.g., mysql+pymysql://mlflow:password@localhost:3307/experiments | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {% /codeInfo %} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-18 08:42:17 +02:00
										 |  |  | {% partial file="/v1.8/connectors/yaml/ml-model/source-config-def.md" /%} | 
					
						
							| 
									
										
										
										
											2024-06-18 15:53:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-18 08:42:17 +02:00
										 |  |  | {% partial file="/v1.8/connectors/yaml/ingestion-sink-def.md" /%} | 
					
						
							| 
									
										
										
										
											2024-06-18 15:53:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-18 08:42:17 +02:00
										 |  |  | {% partial file="/v1.8/connectors/yaml/workflow-config-def.md" /%} | 
					
						
							| 
									
										
										
										
											2024-06-18 15:53:06 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | {% /codeInfoContainer %} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {% codeBlock fileName="filename.yaml" %} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ```yaml {% isCodeBlock=true %} | 
					
						
							|  |  |  | source: | 
					
						
							|  |  |  |   type: mlflow | 
					
						
							|  |  |  |   serviceName: local_mlflow | 
					
						
							|  |  |  |   serviceConnection: | 
					
						
							|  |  |  |     config: | 
					
						
							|  |  |  |       type: Mlflow | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | ```yaml {% srNumber=1 %} | 
					
						
							|  |  |  |       trackingUri: http://localhost:5000 | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | ```yaml {% srNumber=2 %} | 
					
						
							|  |  |  |       registryUri: mysql+pymysql://mlflow:password@localhost:3307/experiments | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-18 08:42:17 +02:00
										 |  |  | {% partial file="/v1.8/connectors/yaml/ml-model/source-config.md" /%} | 
					
						
							| 
									
										
										
										
											2024-06-18 15:53:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-18 08:42:17 +02:00
										 |  |  | {% partial file="/v1.8/connectors/yaml/ingestion-sink.md" /%} | 
					
						
							| 
									
										
										
										
											2024-06-18 15:53:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-18 08:42:17 +02:00
										 |  |  | {% partial file="/v1.8/connectors/yaml/workflow-config.md" /%} | 
					
						
							| 
									
										
										
										
											2024-06-18 15:53:06 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | {% /codeBlock %} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {% /codePreview %} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-18 08:42:17 +02:00
										 |  |  | {% partial file="/v1.8/connectors/yaml/ingestion-cli.md" /%} |