async pipeline execution #3342
-
Hello, I'm attempting to launch a pipeline asynchronously from a flask (user-facing) application. My goal is to launch the pipeline, and return the user to a status screen while the pipeline works. I have tried I decided to take a different approach, something like the following:
The problem I am seeing with this approach is that
Is there an example of how to achieve an async execution of a pipeline? Thanks much. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
cc: @gibsondan |
Beta Was this translation helpful? Give feedback.
-
Hi @ahoneycutt - we do have functionality that does this but it's a bit buried / not as intuitive as it should be at the moment. What you want is basically the 'dagster pipeline launch' command - there's a method in dagster.cli.pipeline called 'execute_launch_command' that is pretty much the exact code that that CLI command runs, and I believe is what you want - that currently takes in a kwargs map that's exactly the arguments you would pass into dagster pipeline launch (see the docs here: https://docs.dagster.io/_apidocs/cli or just run "dagster pipeline launch --help" in the command line to see what they are). For now what I would maybe recommend is just calling that execute_launch_command function directly, and once we have a 'launch_pipeline' method exposed publicly (which will probably take in similar arguments, just expressed more cleanly than just a kwargs map), then maybe you could switch to that? For example, you might write something like:
Let us know if that works for now! |
Beta Was this translation helpful? Give feedback.
Hi @ahoneycutt - we do have functionality that does this but it's a bit buried / not as intuitive as it should be at the moment.
What you want is basically the 'dagster pipeline launch' command - there's a method in dagster.cli.pipeline called 'execute_launch_command' that is pretty much the exact code that that CLI command runs, and I believe is what you want - that currently takes in a kwargs map that's exactly the arguments you would pass into dagster pipeline launch (see the docs here: https://docs.dagster.io/_apidocs/cli or just run "dagster pipeline launch --help" in the command line to see what they are).
For now what I would maybe recommend is just calling that execute_launch_comm…