Repository: mlflow/mlflow

Issue:
creating model version for model registry throws an error on Databricks when using relative path
Thank you for submitting an issue. Please refer to our [issue policy](https://www.github.com/mlflow/mlflow/blob/master/ISSUE_POLICY.md) for additional information about bug reports. For help with debugging your code, please refer to [Stack Overflow](https://stackoverflow.com/questions/tagged/mlflow).

**Please fill in this bug report template to ensure a timely and thorough response.**

### Willingness to contribute
The MLflow Community encourages bug fix contributions. Would you or another member of your organization be willing to contribute a fix for this bug to the MLflow code base?

- [ ] Yes. I can contribute a fix for this bug independently.
- [ ] Yes. I would be willing to contribute a fix for this bug with guidance from the MLflow community.
- [x] No. I cannot contribute a bug fix at this time.

### System information
- **Have I written custom code (as opposed to using a stock example script provided in MLflow)**: No
- **MLflow version (run ``mlflow --version``)**: 1.13.1
- **Python version**: 3.7.5

### Describe the problem
I am following the example for creating the model version described [here](https://www.mlflow.org/docs/latest/python_api/mlflow.tracking.html#mlflow.tracking.MlflowClient.create_model_version) on the DataBricks runtime version 7.4 but facing an error as : `RestException: INVALID_PARAMETER_VALUE: Got an invalid source 'runs:/b10b131f7deb4094a42c8261a930de40/sklearn-model'. Only DBFS locations are currently supported.`

But, when I tried other example: [register_model](https://www.mlflow.org/docs/latest/python_api/mlflow.html#mlflow.register_model), I could successfully register in the model registry (using relative path example :` model_uri = "runs:/{}/sklearn-model".format(run.info.run_id))`.

I am trying to use the relative path of that run as model uri, to [create_model_version](https://www.mlflow.org/docs/latest/python_api/mlflow.tracking.html#mlflow.tracking.MlflowClient.create_model_version) (as described in documentation example) on DataBricks. But, could not register version of the model.

### Code to reproduce issue
Code to reproduce is the example for [create_model_version](https://www.mlflow.org/docs/latest/python_api/mlflow.tracking.html#mlflow.tracking.MlflowClient.create_model_version) in mlflow.tracking , the code is posted below (only set_tracking_uri is commented out from original example): 
```
import mlflow.sklearn
from mlflow.tracking import MlflowClient
from sklearn.ensemble import RandomForestRegressor

# mlflow.set_tracking_uri("sqlite:///mlruns.db")
params = {"n_estimators": 3, "random_state": 42}
name = "RandomForestRegression"
rfr = RandomForestRegressor(**params).fit([[0, 1]], [1])
# Log MLflow entities
with mlflow.start_run() as run:
    mlflow.log_params(params)
    mlflow.sklearn.log_model(rfr, artifact_path="sklearn-model")

# Register model name in the model registry
client = MlflowClient()
client.create_registered_model(name)

# Create a new version of the rfr model under the registered model name
desc = "A new version of the model"
model_uri = "runs:/{}/sklearn-model".format(run.info.run_id)
mv = client.create_model_version(name, model_uri, run.info.run_id, description=desc)
print("Name: {}".format(mv.name))
print("Version: {}".format(mv.version))
print("Description: {}".format(mv.description))
print("Status: {}".format(mv.status))
print("Stage: {}".format(mv.current_stage))
```

### Other info / logs

![mlflow](https://user-images.githubusercontent.com/40804906/109122645-2c086e00-7749-11eb-860f-50e686bcaa4d.PNG)


The error faced:
```
RestException: INVALID_PARAMETER_VALUE: Got an invalid source 'runs:/b10b131f7deb4094a42c8261a930de40/sklearn-model'. Only DBFS locations are currently supported.
---------------------------------------------------------------------------
RestException                             Traceback (most recent call last)
<command-3390063603017977> in <module>
     19 desc = "A new version of the model"
     20 model_uri = "runs:/{}/sklearn-model".format(run.info.run_id)
---> 21 mv = client.create_model_version(name, model_uri, run.info.run_id, description=desc)
     22 print("Name: {}".format(mv.name))
     23 print("Version: {}".format(mv.version))

/databricks/python/lib/python3.7/site-packages/mlflow/tracking/client.py in create_model_version(self, name, source, run_id, tags, run_link, description)
    619             tags=tags,
    620             run_link=run_link,
--> 621             description=description,
    622         )
    623 

/databricks/python/lib/python3.7/site-packages/mlflow/tracking/_model_registry/client.py in create_model_version(self, name, source, run_id, tags, run_link, description)
    178         tags = tags if tags else {}
    179         tags = [ModelVersionTag(key, str(value)) for key, value in tags.items()]
--> 180         return self.store.create_model_version(name, source, run_id, tags, run_link, description)
```


### What component(s), interfaces, languages, and integrations does this bug affect?
Components 
- [x] `area/artifacts`: Artifact stores and artifact logging
- [x] `area/examples`: Example code
- [x] `area/model-registry`: Model Registry service, APIs, and the fluent client calls for Model Registry
- [x] `area/tracking`: Tracking Service, tracking client APIs, autologging

Integrations
- [x] `integrations/databricks`: Databricks integrations



Discussion:

Resolving patch:
diff --git a/mlflow/tracking/client.py b/mlflow/tracking/client.py
--- a/mlflow/tracking/client.py
+++ b/mlflow/tracking/client.py
@@ -2152,6 +2152,7 @@ def create_model_version(
             :caption: Example
 
             import mlflow.sklearn
+            from mlflow.store.artifact.runs_artifact_repo import RunsArtifactRepository
             from mlflow.tracking import MlflowClient
             from sklearn.ensemble import RandomForestRegressor
 
@@ -2170,8 +2171,9 @@ def create_model_version(
 
             # Create a new version of the rfr model under the registered model name
             desc = "A new version of the model"
-            model_uri = "runs:/{}/sklearn-model".format(run.info.run_id)
-            mv = client.create_model_version(name, model_uri, run.info.run_id, description=desc)
+            runs_uri = "runs:/{}/sklearn-model".format(run.info.run_id)
+            model_src = RunsArtifactRepository.get_underlying_uri(runs_uri)
+            mv = client.create_model_version(name, model_src, run.info.run_id, description=desc)
             print("Name: {}".format(mv.name))
             print("Version: {}".format(mv.version))
             print("Description: {}".format(mv.description))


Test patch: