Based on <this> page, it looks like you can use en...
# ask-community
n
Based on this page, it looks like you can use environment variables to set values for agent options. Is there any documentation on which environment variables map to which agent options? The only page I can find is here which doesn’t mention the environment variable option. So far we’ve been creating our own image with a custom entrypoint for the agent to set all the option but it would be super neat if we could avoid that.
j
Hi @Noah Holm We go through agent configuration options and the different options for setting them here: https://docs.prefect.io/orchestration/agents/overview.html#usage
n
Thanks Jenny! So looking in the bottom I see that the
--agent-address
option corresponds to
PREFECT__CLOUD__AGENT__AGENT_ADDRESS
. Is that true for all config options when starting the agent? Can I use
PREFECT__CLOUD__AGENT__RUN_TASK_KWARGS
instead of
--run-task-kwargs
for example, or is it only a chosen few of the options?
j
That is a really good question. I suspect it's only the options that are available in the config.toml but I'm double checking that with the team. You can see more about config.toml and config options here: https://docs.prefect.io/orchestration/faq/config.html
n
Yeah that makes sense, thanks for checking though!
FWIW, for anyone looking in this thread while history is kept. I actually realised that we can invoke the agent with a custom command in our task definition, and also realised why we didn’t think that was possible in the beginning which sent us on the custom image with custom entrypoint. I.e., just define your flags you can’t use env vars for using the command in the agent’s task definition. Great simplification of our setup, good day in prefect land.
🙏 1
r
It has taken me quite a long time to stumble over this thread. It would be useful to add how to do this in https://docs.prefect.io/orchestration/agents/ecs.html#running-ecs-agent-in-production.