allegroai / clearml

ClearML - Auto-Magical CI/CD to streamline your AI workload. Experiment Management, Data Management, Pipeline, Orchestration, Scheduling & Serving in one MLOps/LLMOps solution
https://clear.ml/docs
Apache License 2.0
5.69k stars 655 forks source link

S3 Connection setup with minIO: Cannot find credentials #1017

Closed tevintchuinkam closed 1 year ago

tevintchuinkam commented 1 year ago

I am trying to setup and use minIO s3 storage like so.

task = Task.init(project_name="my_project",
                     task_name="linear-regression-test",
                     tags="testing",
                     output_uri="s3://minio.api.example.io/clearml-artifacts"
                     )

and then upload and artifact like so:

    task.upload_artifact(name=model_file,
                         artifact_object=model_file,
                         delete_after_upload=True,
                         auto_pickle=True,
                         metadata=metadata)

I followed the steps in the documentation for setting up S3 Storage with minIO and added my credentials in my ~/clearml.conf like so:

aws {
        s3 {
            key: "<minio-key>"
            secret: "<minio-secret>"
            credentials: [
                {
                    host: "minio.api.example.io:9000"
                    bucket: "clearml-artifacts"
                    key: "<minio-key>"
                    secret: "<minio-secret>"
                    multipart: false
                    secure: true
                }
            ]
        } 
}

I've many different uris for "output_uri" similarly like in this issue, but the connection cannot be established.

This is the behavior for the various values for "output_uri" that I tried:

I also tried setting my credentials like so, which did not help:


sdk {
    aws {
        s3 {
            credentials: [
                {
          host: "minio.api.example.io:9000"
          bucket: "clearml-artifacts"
          key: "<minio-key>"
          secret: "<minio-secret>"
          multipart: false
          secure: true
                }
            ]
        }
    }
    development.default_output_uri: "s3://minio.api.cosmic-x.idcp.inovex.io:9000/clearml-artifacts"
}

Any suggestions?

Environment

jkhenning commented 1 year ago

Hi @tevintchuinkam, I think what you're looking for is:

task = Task.init(
  project_name="my_project",
  task_name="linear-regression-test",
  tags="testing",
  output_uri="s3://minio.api.example.io:9000/clearml-artifacts"
)

Assuming the minio port is 9000

tevintchuinkam commented 1 year ago

Hi @tevintchuinkam, I think what you're looking for is:

task = Task.init(
  project_name="my_project",
  task_name="linear-regression-test",
  tags="testing",
  output_uri="s3://minio.api.example.io:9000/clearml-artifacts"
)

Assuming the minio port is 9000

This does not fix it either sadly, I get the same error:

ValueError: Could not get access credentials for 's3://minio.api.example.io:9000/clearml-artifacts' , check configuration file ~/clearml.conf

jkhenning commented 1 year ago

And how did you set clearml.conf now?

tevintchuinkam commented 1 year ago

I tried both setups like above. I get the same error on both: ValueError: Could not get access credentials for 's3://minio.api.example.io:9000/clearml-artifacts' , check configuration file ~/clearml.conf Followed by clearml.storage - ERROR - Failed creating storage object s3://minio.api.example.io:9000/clearml-artifacts Reason: Missing key and secret for S3 storage access (s3://minio.api.example.io:9000/clearml-artifacts)

jkhenning commented 1 year ago

The second configuration you showed says host: "minio.api.example:9000" but the host in the error is minio.api.example.io?

jkhenning commented 1 year ago

I would expect it to be host: "minio.api.example.io:9000"

tevintchuinkam commented 1 year ago

I would expect it to be host: "minio.api.example.io:9000"

Sorry what was just a typo

jkhenning commented 1 year ago

Can you just try with:

sdk {
  aws {
    s3 {
      key: "<minio-key>"
      secret: "<minio-secret>"
    }
  }
}
tevintchuinkam commented 1 year ago

Hi @jkhenning, I just tried that (and still with output_uri="s3://minio.api.example.io:9000/clearml-artifacts" in python script) but I get the same "Could not get access credentials for 's3://minio.api.example.io:9000/clearml-artifacts'"

Just a quick sidenote: setting output_uri=True does successfully upload artifacts to the default fileserver. But this is not what I want.

jkhenning commented 1 year ago

It looks like the configuration file isn't loaded for some reason...

tevintchuinkam commented 1 year ago

It ended up working by removing the port number.

jkhenning commented 1 year ago

Removing from where?

jkhenning commented 1 year ago

Also 🔥

Rusteam commented 7 months ago

apparently sdk has to be a root level config. Can we update the docs here

jkhenning commented 7 months ago

Sure, thanks for the pointer!