https://prefect.io logo
f

Farhood Etaati

07/23/2023, 1:41 PM
Can you run another independent deployment when a flow run finishes? I have 2 flows that use different pools of workers, one is cpu heavy and another is gpu heavy. I want to run the first one on my cpu nodes, and if they were successful, run the second flow on a different worker.
d

Deceivious

07/23/2023, 3:41 PM
Why not just use the
run_deployment
method?
f

Farhood Etaati

07/23/2023, 3:45 PM
Running the deployment in another flow?
d

Deceivious

07/23/2023, 3:46 PM
U can call prefect to run a deployment from within a flow
f

Farhood Etaati

07/23/2023, 3:46 PM
This is doable (by doing this in
on_completion
) of the first flow.
But this tightly couples my flows together.
I have to pass parameters to my first flow to give to the second flow.
f

Farhood Etaati

07/23/2023, 3:49 PM
I have used
run_deployment
extensively in my project. The problem is that calling the orchestrator in a flow to run another flow seems like the least viable option. It's both a security risk (my flows are running client code) and also I have to tightly couple the flows together, so
flow_a
has to have some unneeded information that only
flow_b
needs to have to be executable.
If I could chain multiple deployments together conditionally making DAGS would have been a lot easier.
d

Deceivious

07/23/2023, 3:51 PM
Write
flow_c
that takes input of both
flow_a
and
flow_b
. 😄
f

Farhood Etaati

07/23/2023, 3:52 PM
😄 The main problem is that the infrastructure for both flows are separate and I have to run them sequentially.
d

Deceivious

07/23/2023, 3:52 PM
Thats not an issue
U can deploy flow1 on a queue that is queied by agent with high CPU. Deploy flow2 on a queune that isqueried by agent with GPU.
At the end of flow1
run_deployment
, deployment of flow2.
4 Views