Package: datarobot-mlflow
mlflow-integrationProvide means of exporting a model from MLFlow model registry and pushing it to DataRobot model registryKey-values are created from training parameters, metrics, tags,
and artifacts in the MLflow model.SetupPython 3.7 or laterDataRobot 9.0 or laterpip install datarobot-mlflowif using Azure:pip install "datarobot-mlflow[azure]"ConsiderationsThis integration library uses an API endpoint under Public Preview.
The DataRobot user owning the API token used below must have:Enable Extended Compliance DocumentationsetOwnerorUserpermission for the DataRobot model packageDataRobot information neededURL of DataRobot instance, example:https://app.datarobot.comID of the model package to receive key-values; example:64227b4bf82db411c90c3209API token for DataRobot:export MLOPS_API_TOKEN=<API token from DataRobot Developer Tools>Local MLflow information neededMLflow tracking URI; example"file:///Users/me/mlflow/examples/mlruns"Model name; example"cost-model"Model version; example"2"Azure DataBricks MLFlow with Service Principal information neededMLflow tracking URI; example"azureml://region.api.azureml.ms/mlflow/v1.0/subscriptions/subscription-id/resourceGroups/resource-group-name/providers/Microsoft.MachineLearningServices/workspaces/azure-ml-workspace-name"Model name; example"cost-model"Model version; example"2"Provide service principal details in environment:export AZURE_TENANT_ID="<tenant-id>"export AZURE_CLIENT_ID="<client-id>"export AZURE_CLIENT_SECRET="<secret>"Example: Import from MLflowDR_MODEL_ID="<MODEL_PACKAGE_ID>"envPYTHONPATH=./\pythondatarobot_mlflow/drflow_cli.py\--mlflow-urlhttp://localhost:8080\--mlflow-modelcost-model\--mlflow-model-version2\--dr-model$DR_MODEL_ID\--dr-urlhttps://app.datarobot.com\--with-artifacts\--verbose\--actionsyncExample: validate Azure credentialsexportMLOPS_API_TOKEN="n/a"# not used for Azure auth check, but must be presentenvPYTHONPATH=./\pythondatarobot_mlflow/drflow_cli.py\--verbose\--auth-typeazure-service-principal\--service-provider-typeazure-databricks\--actionvalidate-auth# example output for missing environment variables:Requiredenvironmentvariableisnotdefined:AZURE_TENANT_ID
Requiredenvironmentvariableisnotdefined:AZURE_CLIENT_ID
Requiredenvironmentvariableisnotdefined:AZURE_CLIENT_SECRET
AzureADServicePrincipalcredentialsarenotvalid;checkenvironmentvariables# example output for successful authentication:AzureADServicePrincipalcredentialsarevalidforobtainingaccesstokenActionsThe following operations are available for--action:sync: import parameters, tags, metrics, and artifacts from MLflow model.list-mlflow-keys: list parameters, tags, metrics, and artifacts in an MLflow model. Requires--mlflow-url,--mlflow-model, and--mlflow-model-version.validate-auth: see "validate Azure credentials" example above.OptionsThe following options can be added to thedrflow_clicommand line:--mlflow-url: MLflow Tracking URI--mlflow-model: MLflow model name--mlflow-model-version: MLflow model version--dr-url: Main URL of the DataRobot instance--dr-model: DataRobot Model Package ID. Registered Model Versions are also supported.--prefix: a string to prepend to the names of all key-values posted to DataRobot. Default is empty.--debug: set Python logging level tologging.DEBUG. Default level islogging.WARNING.--verbose: prints to stdout information about the following:retrieving model from MLflow; prints model informationsetting model data in DataRobot: prints each key-value posted--with-artifacts: download MLflow model artifacts to/tmp/model--service-provider-type: service provider to use forvalidate-auth. Supported values are:azure-databricks: for Databricks MLflow within Azure--auth-type: authentication type forvalidate-auth. Supported values are:azure-service-principal: for Azure Service Principal