Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Hi (Again... Sorry For Asking So Many Questions) Question About Using Google Cloud Storage In A Clearml Agent Running In Aws Ec2 Instance. My

Hi (again... sorry for asking so many questions)
Question about using google cloud storage in a clearml agent running in AWS ec2 instance.

my clearml.conf has:
files_server: in the api section. The sdk section has:
google.storage { # # Default project and credentials file # # Will be used when no bucket configuration is found project: <project name> credentials_json: <path to a local credentials file>I have code that performs
manager = StorageManager() path = manager.get_local_copy(f"gs://{data_path}")This setup works fine locally but not in agents running in AWS.

The error I get is:
2022-07-18 17:22:11,757 - clearml.storage - ERROR - Failed creating storage object Reason: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application. For more information, please seeand later
AttributeError: 'NoneType' object has no attribute 'base_url'
How do I pass a google cloud application credentials to my agents (running in aws)? Can ClearML take care of it for me?

  
  
Posted 2 years ago
Votes Newest

Answers 8


My local environment has clearml version 1.6.3rc0
and agents in aws were started with the AWS Autoscaler which has no explicit place for google credentials.

I see a place for Additional ClearML Configuration in the AWS autoscaler UI which I suspect may help but I don't see how I can pass a secrets file along with my agent.

  
  
Posted 2 years ago

in Your Additional ClearML Configuration (which is basically clearml.conf configuration)
Add the following:
environment { GOOGLE_APPLICATION_CREDENTIALS="~/gs.cred" } files { gsc { contents: "<this is your GCP storage credentials file>" path: "~/gs.cred" } }Reference:
https://github.com/allegroai/clearml-agent/blob/a5a797ec5e5e3e90b115213c0411a516cab60e83/docs/clearml.conf#L421
https://github.com/allegroai/clearml-agent/blob/a5a797ec5e5e3e90b115213c0411a516cab60e83/docs/clearml.conf#L440

🤞

  
  
Posted 2 years ago

Hi PanickyMoth78
Hmm yes, I think the StorageManager (i.e. the google storage pythonclinet) also needs a json file with the credentials.
Let me check something

  
  
Posted 2 years ago

For anyone following, you can "inject" a credentials json file for a google cloud service account so at to get access to your google cloud storage from agents on aws ec2 instances that are managed by the AWS autoscaler by providing the following in the ADDITIONAL CLEARML CONFIGURATION when starting the autoscaler:
sdk.google.storage.credentials_json: "/root/gs.cred" sdk.google.storage.project: "<my-gcp-project-id>" files { gsc { contents: """<copy-paste the contents of your service_credentials.json file here>""" path: "/root/gs.cred" } }This will create the file /root/gs.cred in the worker node with the contents of your service credentials json and tell your agent (or the sdk) about it.

Note that the contents of the service credentials file will be logged by the autoscaler and shown in its configuration tab under extra_clearml_conf

  
  
Posted 2 years ago

I think it should look something like:
files { gsc { contents: """{"type": "service_account", "project_id": "ai-platform", "private_key_id": "9999", "private_key": "-----BEGIN PRIVATE KEY-----==\n-----END PRIVATE KEY-----\n", "client_email": "a@ai.iam.gserviceaccount.com", "client_id": "111", "auth_uri": " ", "token_uri": " ", "auth_provider_x509_cert_url": " ", "client_x509_cert_url": " "}""" path: "~/gs.cred" } }

  
  
Posted 2 years ago

I now get this error:
2022-07-18 21:51:29,168 - clearml.storage - ERROR - Failed creating storage object Reason: [Errno 2] No such file or directory: '~/gs.cred'
to be clear, I replaced <this is your GCP storage credentials file> with the contents of that file, escaping every " with a \" and removing newlines.

  
  
Posted 2 years ago

Thanks AgitatedDove14 for all the guidance.

  
  
Posted 2 years ago

My pleasure 🙂

  
  
Posted 2 years ago