Hi, how can I pass environment variables to Docker agent without restarting? is there any options to...
d
Hi, how can I pass environment variables to Docker agent without restarting? is there any options to set it in flow, for example pass the path for *.env file or make visible variables from current terminal session to Local agent?
b
I don't know what exactly you want to achieve, but maybe you could try something like
flow.run_config = DockerRun(env={"SOME_VAR": "value"})
. This will make the env variable SOME_VAR available to your flow when it's running on a docker agent. I took that snippet from https://docs.prefect.io/orchestration/flow_config/run_configs.html#dockerrun .
d
I just want local or docker agent be able to see environment variables, because when I set it like
Copy code
export PREFECT__CONTEXT__SECRETS__SOME_VAR
it visible only from current terminal process and none of any agents cant see this variable
k
Bastian is right here. You would need the use the Prefect RunConfig to pass the environment variables.
360 Views