Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import_model_version.py fails to import a model from local enviroment #194

Open
jiropardo opened this issue Aug 21, 2024 · 0 comments
Open

Comments

@jiropardo
Copy link

When trying to import a model from a local environment to Databricks UC using the import_model_version function, the import fails with AWS zone related issues

line 89, in _get_region_name
head_bucket_resp = temp_client.head_bucket(Bucket=self.bucket)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

MLflow version used:
mlflow-skinny==2.14.3

Function used
https://github.com/mlflow/mlflow-export-import/blob/a572e944ebee82fe9b37c5e7b35541d01c26253b/mlflow_export_import/model_version/import_model_version.py

Code for importing the model

import_model_version(
model_name=f"model_catalog.model_schema.Model_12",
experiment_name=f"/test/EXPERIMENTS/Testing_model",
input_dir=model_migration/resources/01/,
create_model=True,
import_stages_and_aliases=True,
)

The workaround to make this work is to manually specify the s3 bucket in boto3 like below

import boto3
boto3.setup_default_session(region_name='region-of-workspace')

However, this error does not occur within Databricks on a cluster with MLflow 2.14.3 or latter but when running this import function from local. The error is coming from the client code and not the server code as the import_model_version does not set the region when running it locally

Please review this and clarify whether this function needs the region to be passed explicitly as a parameter or if the current client code will be updated to set the region when run in a local environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant