Ethienne Marcelin
02/03/2023, 4:02 PMfrom prefect import flow
@flow
def myflow(x: int):
return x ** x
I want to run this flow with a deployment so i do the following:
from prefect.deployments import Deployment, run_deployment
from test import myflow
deployment = Deployment.build_from_flow(flow=myflow, name="test", version=1)
deployment_uuid = deployment.apply()
output = run_deployment(name=f"{deployment.flow_name}/{deployment.name}", parameters={"x": 3})
Everything works fine, but the program never returns ๐ข it's stuck on the "run_deployment"
When I do prefect flow-run ls
I see that my flow-run was created but is stuck in "scheduled" state.
I have the same problem if I run this code within a "if name == main" block, if I specify a work queue name, or add a schedule time in the future.
Do you have any idea ?
Thanks in advance for your precious help ๐Nate
02/03/2023, 4:26 PMEthienne Marcelin
02/03/2023, 4:27 PMNate
02/03/2023, 4:29 PMwork_queue_name="test"
to your build_from_flow
callEthienne Marcelin
02/03/2023, 4:30 PMNate
02/03/2023, 4:31 PMprefect deployment build test.py:myflow -n test -q test --apply
Ethienne Marcelin
02/03/2023, 4:35 PMNate
02/03/2023, 4:36 PMEthienne Marcelin
02/03/2023, 5:35 PMNate
02/03/2023, 5:38 PMEthienne Marcelin
02/03/2023, 5:48 PMNate
02/03/2023, 6:10 PMEthienne Marcelin
02/03/2023, 6:13 PMNate
02/03/2023, 6:23 PMEthienne Marcelin
02/03/2023, 6:26 PMNate
02/03/2023, 6:26 PM