mlflow: [SETUP-BUG] Mlflow is not writting to the s3 bucket

Thank you for submitting an issue. Please refer to our issue policy for information on what types of issues we address.

Please fill in this installation issue template to ensure a timely and thorough response.

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 20.04
  • MLflow installed from (source or binary): Source
  • MLflow version (run mlflow --version): mlflow, version 1.10.0
  • Python version: 3.7
  • Exact command to reproduce:

I am launching the ml server on an ec2 with a postgres database and a s3 bucket, and local host 0.0.0.0

Describe the problem

Provide the exact sequence of commands / steps that you executed before running into the problem.

When I create an experiment either on the command line or through the ui, it does not show up in the s3 at all. I am able to write to the s3 bucket through the aws cli.

Other info / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 34 (15 by maintainers)

Most upvoted comments

I have a similar issue with minio as S3:

import mlflow

mlflow.set_tracking_uri("sqlite:///sql.db")
mlflow.set_registry_uri("http://127.0.0.1:9000")   # replace
expr_name = "new_experiment_2"
s3_bucket = "S3://mlflow"  # replace

mlflow.create_experiment(expr_name, s3_bucket)
mlflow.set_experiment(expr_name)

with mlflow.start_run():
    # debug
    print(mlflow.get_artifact_uri())
    print(mlflow.get_tracking_uri())
    
    mlflow.log_param("foo", 0)
    mlflow.log_metric("bar", 1)
    
    with open("test.txt", "w") as f:
        f.write("test")

    mlflow.log_artifact("test.txt")

throws:

    raise HTTPClientError(error=e)
botocore.exceptions.HTTPClientError: An HTTP Client raised an unhandled exception: Not supported URL scheme s3

s3_bucket = “S3://127.0.0.1:9000” s3_bucket = “S3://127.0.0.1:9000/mlflow” both throw:

Invalid bucket name "127.0.0.1:9000": Bucket name must match the regex "^[a-zA-Z0-9.\-_]{1,255}$" or be an ARN matching the regex "^arn:(aws).*:(s3|s3-object-lambda):[a-z\-0-9]*:[0-9]{12}:accesspoint[/:][a-zA-Z0-9\-.]{1,63}$|^arn:(aws).*:s3-outposts:[a-z\-0-9]+:[0-9]{12}:outpost[/:][a-zA-Z0-9\-]{1,63}[/:]accesspoint[/:][a-zA-Z0-9\-]{1,63}$"

s3_bucket = “http://127.0.0.1:9000/mlflow” throws

mlflow.exceptions.MlflowException: Could not find a registered artifact repository for: http://127.0.0.1:9000/mlflow/b2c2ef8adb444db08de266a60ccdd3ff/artifacts. Currently registered schemes are: ['', 'file', 's3', 'gs', 'wasbs', 'ftp', 'sftp', 'dbfs', 'hdfs', 'viewfs', 'runs', 'models']

@rd16395p Can you try this?

import mlflow

expr_name = "new_experiment"  # create a new experiment (do not replace)
s3_bucket = "your_s3_bucket_uri"  # replace this value
mllfow.create_experiment(expr_name, s3_bucket)
mlflow.set_experiment(expr_name)

with mlflow.start_run():
    print(mlflow.get_artifact_uri())  # should print out an s3 bucket path
    
    # create a file to log
    with open("test.txt", "w") as f:
        f.write("test")

    mlflow.log_artifact("test.txt")