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
Hello! I Faced An Issue With Environment Variables With Remote Agent I Set The In Clearml.Conf In Section:

Hello!
I faced an issue with environment variables with remote agent
I set the in clearml.conf in section: development.apply_environment
Like this:

apply_environment: true
environment {
       login : "usename"
       pass : "password"
}

And in my script I using python-dotenv

from dotenv import load_dotenv
load_dotenv()
login = os.getenv("login")
password = os.getenv("pass")

And in agent log I can see:

agent.environment.login = ****
agent.environment.pass = ****

But when executing it, looks like envs are not getting set and in the script in use blank variables

  
  
Posted 2 months ago
Votes Newest

Answers 19


@<1523701070390366208:profile|CostlyOstrich36> any updates here?

  
  
Posted 2 months ago

And where are these login/pass env vars are used?

  
  
Posted one month ago

Can you provide an information, how to do that?

  
  
Posted one month ago

Hi @<1706116294329241600:profile|MinuteMouse44> , you need to run in docker mode with --docker tag to be able to inject env variables

  
  
Posted 2 months ago

Then just use export

  
  
Posted one month ago

If on a linux, that's one option. Basically any way you see fit to make sure the env variable is available for the agent

  
  
Posted one month ago

Sorry, I didn’t really understand about top level
What do you mean?

  
  
Posted one month ago

It should be in top level, not environment or agent

  
  
Posted one month ago

Hi @<1706116294329241600:profile|MinuteMouse44> , are you running in docker mode?

  
  
Posted 2 months ago

But as I said before it seems that agent got them:

And in agent log I can see:

agent.environment.login = ****
agent.environment.pass = ****
  
  
Posted one month ago

for example EXPORT FOO=BAR clearml-agent daemon ...

  
  
Posted one month ago

@<1523701070390366208:profile|CostlyOstrich36>
And if I use docker mode, an agent will read env variables from clearml.conf file?

  
  
Posted one month ago

what if I can’t use the docker mode because the agent is already running inside docker

  
  
Posted 2 months ago

Yes, but then you need to manually inject those environment variables when running the agent

  
  
Posted one month ago

In my script:

And in my script I using

python-dotenv

from dotenv import load_dotenv
load_dotenv()
login = os.getenv("login")
password = os.getenv("pass")

I use them to connect to DB

  
  
Posted one month ago

So I need to use EXPORT before spinning up clearml-agent daemon?

  
  
Posted one month ago

Thank you this works 🙌

But by the way, why agent didn’t read env variables from clearml.conf file ?

  
  
Posted one month ago

@<1523701070390366208:profile|CostlyOstrich36> any updates?
Is it possible to avoid using docker mode?

  
  
Posted one month ago

no, without docker

  
  
Posted 2 months ago