Ross
03/31/2021, 9:16 AMprefect.engine.flow_runner.FlowRunner
or prefect.engine.cloud.flow_runner.CloudFlowRunner
with a prefect server backend? I am wanting to run a flow and get task results so wanting to use the arg return_tasks=[task1,task2]
. But I don't think I can do this with prefect.Client().create_flow_run(version_group_id="redacted")
?nicholas
03/31/2021, 2:19 PMCloudFlowRunner
for this; CloudFlowRunner
existed before Prefect Server was a concept and so alludes to any Prefect API, rather than the Prefect Cloud product.Ross
03/31/2021, 3:01 PMfr = CloudFlowRunner(flow=flow)
flow_state = fr.run()
flow_state.result
I'm getting an error:
prefect.utilities.exceptions.ClientError('400 Client Error: Bad Request for url: <http://host>:port/graphql
(swapped out my host and port there)
That why I had stupidly assumed this class was cloud only.
I notice the url in the error is different to the one I use when successfully using prefect.Client(<http://host>:port).register(flow)
in that it has /graphql
added on the end... Not sure exactly where I am going wrong in the config file though. My simpified config just to the parts that I hope are relevant:
backend = "server"
[server]
host = "<http://host>"
port = "port"
host_port = "{server.port}"
endpoint = "${server.host}:${server.port}"
[cloud]
api = "${${backend}.endpoint}"
graphql = "${cloud.api}/graphql"
Any ideas?!nicholas
03/31/2021, 3:11 PMCloudFlowRunner
doesn't pass any arguments to the Client it creates, meaning the Client will take the endpoint directly from config.cloud.graphql
- try changing that in your config to your server endpoint./graphql
at the end, most likely)Jim Crist-Harif
03/31/2021, 3:12 PMResult
objects (which will write the outputs out elsewhere) and view them later. The only supported public api for running a flow locally in a script (and then interacting with the results) is flow.run()
.Ross
03/31/2021, 3:49 PMprefect.tasks.prefect.StartFlowRun
might be what I am after then for running/chaining flows. But that doesnt help me to get task results. Sounds like I need to do some more reading around the Result
objects....! Thank you both