Logging Artifacts from MlFlow on GCS Bucket

Viewed 2153

I have a running MlFlow server on GCS VM instance. I have created a bucket to log the artifacts. This is the command I'm running to start the server and for specifying bucket path-

mlflow server --default-artifact-root gs://gcs_bucket/artifacts --host x.x.x.x

But facing this error:

TypeError: stat: path should be string, bytes, os.PathLike or integer, not ElasticNet

Note- The mlflow server is running fine with the specified host alone. The problem is in the way when I'm specifying the storage bucket path. I have given permission of storage api by using these commands:

gcloud auth application-default login
gcloud auth login

Also, on printing the artifact URI, this is what I'm getting:

mlflow.get_artifact_uri()

Output:

gs://gcs_bucket/artifacts/0/122481bf990xxxxxxxxxxxxxxxxxxxxx/artifacts

So in the above path from where this is coming 0/122481bf990xxxxxxxxxxxxxxxxxxxxx/artifacts and why it's not getting auto-created at gs://gcs_bucket/artifacts

After debugging more, why it's not able to get the local path from VM: enter image description here

And this error I'm getting on VM:

ARNING:root:Malformed experiment 'mlruns'. Detailed error Yaml file './mlruns/mlruns/meta.yaml' does not exist.
Traceback (most recent call last):
 File "/usr/local/lib/python3.6/dist-packages/mlflow/store/tracking/file_store.py", line 197, in list_experiments
   experiment = self._get_experiment(exp_id, view_type)
 File "/usr/local/lib/python3.6/dist-packages/mlflow/store/tracking/file_store.py", line 256, in _get_experiment
   meta = read_yaml(experiment_dir, FileStore.META_DATA_FILE_NAME)
 File "/usr/local/lib/python3.6/dist-packages/mlflow/utils/file_utils.py", line 160, in read_yaml
   raise MissingConfigException("Yaml file '%s' does not exist." % file_path)
mlflow.exceptions.MissingConfigException: Yaml file './mlruns/mlruns/meta.yaml' does not exist.

Can I get a solution to this and what I'm missing?

1 Answers

I think the main error is from the structure that you want to deploy. For your use case, the structure is suitable that in here. So you miss the URI path which used to store backend metadata. So please install DB SQL(postgres,...) first, then add path to --backend-storage-uri.

In case you just want to use MlFlow like a model registries and store images on gcs. You can use this structure in here

Hope this can help you.

Related