Aniruddha Sengupta
03/02/2022, 12:42 PM["aniruddhas", "parallel_example"]
. I have an Agent whose label's are dynamically updated every time a flow is registered so that any new labels on flows are added to the agent. So now my Agent contains these labels : ["aniruddhas", "prefect_spider", "simple_news_spider", "parallel_example"]
.
I have now experimented with it and found that when my flow has just the label ["aniruddhas"]
, the Agent is able to pick them up and run them. But if the flow run has its original labels: ["aniruddhas", "parallel_example"]
, the Agent is not able to pick them up. Why is this the case?
Thanks,
AniruddhaAnna Geller
03/02/2022, 12:55 PMprefect agent local start --no-hostname-label
and your flow with local storage does have it, causing that this agent cannot pick up flow runs of this flow?
To disable adding the hostname label to your flow, you can set it either directly on your Local storage or on `flow.register()`:
flow.storage = Local(..., add_default_labels=False)
# or during registration
flow.register(add_default_labels=False)
Aniruddha Sengupta
03/02/2022, 6:11 PM["aniruddhas"]
.
When I restarted the agent in the terminal with the labels ["aniruddhas", "parallel_example"]
the agent is then able to pick it up and schedule it.
So the interesting point I learned here is that you are able to use GraphQL mutations to change flow runs, labels on flows, flow_runs and agents. But the underleying agent itself, which was started in the terminal, needs to be restarted with the relevant labels in order to pick up flows.Anna Geller
03/02/2022, 6:22 PM