Git Product home page Git Product logo

Comments (2)

chrisguidry avatar chrisguidry commented on June 30, 2024

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 or DockerWorker (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.

jsshizhan avatar jsshizhan commented on June 30, 2024

@chrisguidry how to get return value from flow B

from prefect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.