Hi @<1523701070390366208:profile|CostlyOstrich36>
FYI: I’m not using docker agent.
I set the env vars as you mentioned above in config. And I can see the those while starting agent using command: clearml-agent daemon --queue default
While running below code locally eg: python test.py
I’m loading the env vars that is working fine.
But my question is when we clone the same task from clearml UI and send it to default queue; So can below piece of code can use those envs?
I tried sending the cloned task to agent but looks like envs are not getting set as it is picking default values. Or is there something that I’m missing.
# test.py
import os
from clearml import Task
# Initialize a ClearML task
task = Task.init(project_name="pl-layoutlm", task_name="Task1", output_uri=False)
logger = task.get_logger()
env1 = os.getenv("MY_ENV1", 'default1')
env2 = os.getenv("MY_ENV2", 'default2')
print(env1)
print(env2)
@<1709740168430227456:profile|HomelyBluewhale47> @<1523701070390366208:profile|CostlyOstrich36> any updates here?
Also face same problem, envs that I set in clearml.conf can’t be used when I run agent
Hi @<1709740168430227456:profile|HomelyBluewhale47> , you can set it in clearml.conf
of the agent in agent.extra_docker_arguments
and there you can pass your secrets as env vars
and also take a look into development.apply_environment