Matthew Blau
04/13/2021, 6:47 PMenviornment=env_vars
in the CreateContainer() function but we need to have it inject updated values at runtime. I have had success with
flow.run_config = DockerRun(env={f"PREFECT__CONTEXT__SECRETS__{k}": v for k, v in config.context.secrets.items()})
but we are not utilizing prefect's config.toml for this project as well as the flow not being executed within a docker containerZanie
env
can be a callable that the agent will run at execution time but that has a lot of other implications.
Have you considered setting the secrets on the agent instead of the run config? I think you could also probably modify an agent to load your .env file (ie refresh the environment) each time it deploys a flow but I don't think we'd want to introduce something like that to the mainstream -- generally the environment is loaded once at process start only.Zanie
Matthew Blau
04/14/2021, 12:36 AMdavzucky
04/14/2021, 12:46 AM