Hi, I have created sample python code with flow an...
# prefect-ui
m
Hi, I have created sample python code with flow and task in VS code editor. Also I have started server using "prefect orion start" using CLI in windows. I am not seeing the running flow in the prefect UI (http://127.0.0.1:4200/). Could any one help me on this? Thanks in Advance.
1
j
Are you running the flow by running a Python script or via a deployment?
m
Hi @Jeff Hale, I'm running the flow by using a Python script(VS code) locally.
I am able to see the deployments and flow runs. I have keep a scheduler for a flow which should run every 6 mins. But it is not execute the flow. I meant I do not see any logs in the prefect UI.
j
Looks like you need to start an agent that will pull from that work pool.
prefect agent start --pool default-agent-pool
m
Hi @Jeff Hale I was running the command "prefect agent start -q 'testqueue' ". I tried as you suggested "prefect agent start --pool default-agent-pool" and I am getting the following exception. Also attached the code.txt file which I used for flow.
j
No need to send to channel.
m
OK. Got you. 🙂
j
Copy code
Agent started! Looking for work from work pool ''default-agent-pool''...
Maybe there is an extra single quotes in there? Try this
prefect agent start -p default-agent-pool
You are running this with prefect 2.8.0?
m
YES @Jeff Hale. I am running with prefect 2.8.0
j
ok. does copy pasting and running without the quotes work?
m
Thanks @Jeff Hale. I have moved a step ahead with your suggestion. 🙂 feel good. Agent successfully submit the flow_run. But flow run failed while validating the flow parameters. I have passed value 5(in the code) to the flow as a parameter. Could you help me on this?
j
How did you pass it?
m
HI @Jeff Hale, In python script I directly called the function like as shown below-- I have hardcoded the value 5 to the my_flow(5) function. @flow(name="my_flow", task_runner=SequentialTaskRunner(), ) def my_flow(num): plusnum = first_task.submit(5) sqnum = second_task.submit(plusnum) print(f"add: {plusnum.result()}, square: {sqnum.result()}") # if name == "main": my_flow(5) Also, I have tried by updating parameters section in the description page of deployment in the server(localhost).