Greg
12/13/2023, 7:10 PMNate
12/13/2023, 7:18 PMGreg
12/13/2023, 7:22 PMflow_run.state.result()
Nate
12/13/2023, 7:22 PMGreg
12/13/2023, 7:27 PMpersist_result=True
and result_storage=GCS(bucket_path="xyz")
and created a deployment. I'm then running that deployment from another deployment where I use from prefect.deployments import run_deployment
to get the completed FlowRun object. It seems like prefect automatically stores the ref to the bucket when its saved and correctly loads the result from that bucket without having to configure the bucket location anywhere in the parent deployment that is calling run_deployment. Is my understanding correct?Nate
12/13/2023, 7:29 PMresult_storage=GCS.load("some-existing-gcs-block-with-defined-bucket-path")
and once you have that
> It seems like prefect automatically stores the ref to the bucket when its saved and correctly loads the result from that bucket without having to configure the bucket location anywhere in the parent deployment that is calling run_deployment. Is my understanding correct?
then yesGreg
12/13/2023, 7:34 PMgcs_storage = GCS(bucket_path="xyz")
@flow(log_prints=True, persist_result=True, result_storage=gcs_storage)
def flow_b():
return 'some value'
And that gets served as a deployment. Then in another deployment I have a flow that doesn't pass any parameters for persist_result or result storage, but is able to retrieve the result using flow_run.state.result()
Greg
12/13/2023, 7:36 PMNate
12/13/2023, 7:36 PMGreg
12/13/2023, 7:40 PMrun_deployment
which returns the FlowRun
object that I plan on using to fetch the results. Those sub-deployments will have result_storage configured to GCS. The parent flow will also make calls to subflows, but we use deployments when the python environments differ so we can maintain dependency isolation across job types and serviesNate
12/13/2023, 7:41 PMprefect blocks ls
but that seems like a matter of preference / use case 👍Greg
12/13/2023, 7:45 PMNate
12/13/2023, 7:50 PMMarvin
12/13/2023, 7:50 PMGreg
12/13/2023, 7:53 PMNate
12/13/2023, 7:53 PM