William Grim
02/04/2022, 8:41 PM$ prefect run -n example --watch
Looking up flow metadata...Done
Creating run for flow 'example'...Done
└── Name: eccentric-groundhog
└── UUID: bc79f3ec-5525-4be6-b327-375624abb387
└── Labels: ['caretaker', 'input', 'output', 'prefect-agent-556bd57fdf-v74zj']
└── Parameters: {}
└── Context: {}
└── URL: <http://localhost:8080/default/flow-run/bc79f3ec-5525-4be6-b327-375624abb387>
Watching flow run execution...
└── 20:33:26 | INFO | Entered state <Scheduled>: Flow run scheduled.
── 20:33:43 | WARNING | It has been 15 seconds and your flow run has not been submitted by an agent. Agent 93e9ff4d-5fce-4b1d-ad1b-59925fd32f92 (agent) has matching labels and last queried a few seconds ago. It should deploy your flow run.
└── 20:34:16 | WARNING | It has been 50 seconds and your flow run has not been submitted by an agent. Agent 93e9ff4d-5fce-4b1d-ad1b-59925fd32f92 (agent) has matching labels and last queried a few seconds ago. It should deploy your flow run.
No agent is picking up any of our flows, and flow runs just stay in the "scheduled" state even though on a CLI run, it states that there is an agent with matching labels.Kevin Kho
Anna Geller
prefect run -n example --execute --watch
William Grim
02/04/2022, 8:46 PMexample
flow has an input
label, and the agents have that label and more.Anna Geller
William Grim
02/04/2022, 8:49 PMAnna Geller
flow = Flow("local-flow", storage=Local(add_default_labels=False))
and on the agent:
prefect agent local start --no-hostname-label
William Grim
02/04/2022, 8:54 PMAnna Geller
William Grim
02/04/2022, 8:56 PM── 21:01:25 | WARNING | It has been 50 seconds and your flow run has not been submitted by an agent. Found 5 healthy agents with matching labels. One of them should pick up your flow.
Anna Geller
William Grim
02/04/2022, 9:08 PM/usr/local/bin/python /usr/local/bin/prefect agent local start -l company_name -l input -l output -l caretaker --show-flow-logs
with Flow(
"example",
state_handlers=[save_activity],
run_config=LocalRun(labels=["input", "output", "caretaker"]),
storage=storage.Local(add_default_labels=False),
) as flow:
Anna Geller
prefect agent local start -l company_name -l input -l output -l caretaker --show-flow-logs --no-hostname-label
William Grim
02/04/2022, 9:17 PMAnna Geller
William Grim
02/04/2022, 9:18 PMAnna Geller
prefect agent local start -l company_name -l input -l output -l caretaker --show-flow-logs --no-hostname-label
flow:
with Flow(
"example",
state_handlers=[save_activity],
run_config=LocalRun(labels=["input", "output", "caretaker"]),
storage=storage.Local(add_default_labels=False),
) as flow:
and you need to make sure that you register this flow from the same machine as the agent, otherwise this won’t work because you specified that your storage is local to the agent atm.
If you run agents on a remote VM, you can explore other storage options like Git storage classes or cloud storage classesWilliam Grim
02/04/2022, 9:21 PMprefect run
say explicitly that an agent should pick up the flowAnna Geller
William Grim
02/04/2022, 9:23 PMAnna Geller
William Grim
02/04/2022, 9:24 PMAnna Geller
William Grim
02/04/2022, 9:25 PMAnna Geller
William Grim
02/04/2022, 9:29 PMAnna Geller
William Grim
02/04/2022, 9:29 PMAnna Geller
William Grim
02/04/2022, 9:32 PMAnna Geller
William Grim
02/04/2022, 9:34 PMAnna Geller
prefect agent kubernetes install > agent.yaml # adjust yaml and apply
kubectl apply -f agent.yaml
William Grim
02/04/2022, 9:35 PMAnna Geller
William Grim
02/04/2022, 9:35 PMAnna Geller