https://prefect.io logo
Title
p

Pierre CORBEL

04/04/2020, 5:01 PM
Hello 👋, I register my flow to the cloud and start the agent directly from a python process. The flow is directly build in a docker container by my own. However, at each build and new invocation, a different agent is spinning up in the cloud UI. How can I tell the UI it's the same one which have disconnected and then reconnected?
c

Chris White

04/04/2020, 5:24 PM
Hi Pierre! This is a great question; right now agents are only tracked based on the labels they have so we don’t have a way of identifying agents across restarts. It is a very near term roadmap item to begin tracking them based on some form of stable ID (exact implementation TBD)
p

Pierre CORBEL

04/04/2020, 6:58 PM
Thanks Chris, is there any way to set a label through the
flow.start_agent()
method? (via virtual env or other)
Or do I have to start it via the CLI/supervisor?
c

Chris White

04/04/2020, 7:01 PM
we typically recommend
flow.start_agent()
only for quick testing /development of your flow, otherwise the CLI is preferred. That being said, you can set labels through environment variable using
PREFECT__CLOUD__AGENT__LABELS="['one', 'two']"
👍 1