Pedro Machado
10/01/2020, 8:35 PM.env
file but I don't see a way to pass this file in the cli. Alternatively, how do I tell the agent to use my config.toml
? I have one at ~/.prefect/config.toml
that is used when using flow.run()
Can I tell the agent running on the same machine to use this config file?nicholas
-e
or --env
flags as detailed here in the docs.Pedro Machado
10/01/2020, 9:12 PMnicholas
Pedro Machado
10/01/2020, 9:29 PMnicholas
env_vars
dict in which you can pass your desired environment variables from the build contextPedro Machado
10/01/2020, 11:22 PMenv_vars
at build time for flow-specific configuration. What do you recommend for things like db credentials? I am currently passing them to the agent as env variables and reading them via EnvVarSecret
. Is this the optimal way if we don't have access to a secret store?
Do you have any recommended patterns to set up the code so that it runs locally with flow.run()
and in a docker container? Unfortunately, we'll have to use the local file system for results and output and the paths are different than in the local environment. I got it to work using env variables like PREFECT_BASE_DIR
which points to the directory where the flows to read some sql templates and PREFECT__CONTEXT__LOCAL_RESULTS_DIR
to specify where the results will be written. Does this sound reasonable or can you think of a better approach?nicholas
EnvVarSecret
is the way to go in that case. You can always set environment variables during your docker's build step as well.
flow.run
will run in your local process so for that to happen you'd need to call that from within the container itself. Otherwise that sounds like a viable approach