Daniil Ponizov

09/17/2021, 9:37 AM
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?

Bastian Röhrig

09/17/2021, 9:46 AM
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 .

Daniil Ponizov

09/17/2021, 9:50 AM
I just want local or docker agent be able to see environment variables, because when I set it like
it visible only from current terminal process and none of any agents cant see this variable

Kevin Kho

09/17/2021, 2:07 PM
Bastian is right here. You would need the use the Prefect RunConfig to pass the environment variables.