https://flyte.org logo
#ask-the-community
Title
# ask-the-community
r

Rahul Mehta

01/24/2023, 10:12 PM
Is it possible to start a local execution from a launch plan (rather than directly invoking the workflow)? If so, is there a documentation link for this?
For context, we're trying to figure out how to get a tighter iteration loop when working on dynamic workflows. it's been a bit onerous to actually need to run it in the cluster to debug, and we can't take advantage of the full static type-checking since we're using dynamic to specify launch-plan dependent resource overrides
k

Ketan (kumare3)

01/24/2023, 11:46 PM
you should be able to run dynamic locally as well right?
and ofcourse launchplans can be executed locally
r

Rahul Mehta

01/24/2023, 11:46 PM
Is there an example of executing a launchplan locally in the docs/would you be able to provide an example?
k

Ketan (kumare3)

01/24/2023, 11:46 PM
hmm
r

Rahul Mehta

01/24/2023, 11:47 PM
I couldn't find anything when I looked recently, but certainly could have missed something
Copy code
my_fixed_lp = LaunchPlan.get_or_create(
    name="always_2_lp", workflow=my_wf, fixed_inputs={"val": 2}
)
square_2 = my_fixed_lp()
# error:
# square_1 = my_fixed_lp(val=1)
r

Rahul Mehta

01/24/2023, 11:47 PM
ah, so
get_or_create
just returns a callable?
k

Ketan (kumare3)

01/24/2023, 11:47 PM
yup
r

Rahul Mehta

01/24/2023, 11:47 PM
Cool! Thanks -- will give this a try
k

Ketan (kumare3)

01/24/2023, 11:47 PM
as you can even embed launchplans in workflows
its like subworkflows
and also call them locally
r

Rahul Mehta

01/24/2023, 11:48 PM
oh I didn't realize that, that's neat
k

Ketan (kumare3)

01/24/2023, 11:48 PM
ohh man and you are still a power user haha
please help improve docs
cc @Niels Bantilan / @Samhita Alla - Rahul did not realize that you can run launchplans locally and also use it in workflows
r

Rahul Mehta

01/24/2023, 11:49 PM
Thanks @Ketan (kumare3), appreciate it
s

Samhita Alla

01/25/2023, 7:54 AM
[flyte-docs]
r

Rahul Mehta

01/25/2023, 2:01 PM
This is really powerful - we're going to bake this into our bazel target so users can run the workflow locally to test, and then add the
--remote
flag to serialize/deploy to the cluster
Along with our typing improvements that solves most of our local devx concerns
n

Niels Bantilan

01/25/2023, 3:10 PM
@Samhita Alla gonna fold this into the new getting started guide
9 Views