Comments (2)
HI @jsshizhan, thanks for writing in! Yes, you can definitely run subflows on different machines from their initiating flows. It may help to break down a few Prefect concepts first:
- A flow represents the code you want to run (regardless of where you run it)
- A work pool (a pool of Prefect workers) represents where you want a flow to run (regardless of which flows they are)
- A deployment combines a flow that you want to run with the work pool that you want to run it on, along with default parameters, schedules, and other configuration that "instantiates" your flow
- The Prefect SDK provides a
run_deployment
function that creates a flow run from a deployment, thus creating a subflow that would be running on whatever infrastructure your work pool is on. You can optionally wait for the results of that flow, or just move on trusting that it will run concurrently
Putting that all together, I think what you'd want is to:
- create a work pool for your Kubernetes cluster
- create a work pool for the other group of machines you want to run on
- run least one worker on each work pool; if you're using plain VM instances or baremetal hosts, use the default
ProcessWorker
orDockerWorker
(see the available worker types) - create Prefect deployments for the flows you want to run
- from within flow A, call
run_deployment
to invoke flow B on the other infrastructure
I hope this helps, and please follow up with us in our Slack community or Discourse with any more questions you have.
from prefect.
@chrisguidry how to get return value from flow B
from prefect.
Related Issues (20)
- Add overviews to docs sections that don't yet have them
- Docker Image for 3.0 in Tutorial Missing Tag HOT 1
- Remove global pause/resume toggle from each deployment card on the deployments page
- Every code example in the Deploy docs should include a companion YAML example
- All store flow code examples should be consolidated into the same page
- Move global pause/resume toggle to schedule section of the deployment page HOT 1
- Update the 'Deployments overview' page with the framing from the 'Renaming the Task Server' notion doc
- Flow fails if nested task fails, even if it succeeds on retry HOT 1
- Type hinting with Block types causes incorrect data validation error HOT 1
- result_storage need Callable HOT 1
- how to get run_deployment result HOT 2
- Enforce PR Labeling
- Update RC release workflow to weekly
- Create nightly dev release workflow
- `prefect deploy` is executing flow code HOT 1
- TypeError raised during handling of Validation Error HOT 1
- Cached task raising tenacity exception crashes HOT 1
- support integration `NotificationBlock` types for automation actions
- Add documentation around the run_deployment method
- Faster import time HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prefect.