Is it possible to start a local execution from a l...
# ask-the-community
r
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
you should be able to run dynamic locally as well right?
and ofcourse launchplans can be executed locally
r
Is there an example of executing a launchplan locally in the docs/would you be able to provide an example?
k
hmm
r
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
ah, so
get_or_create
just returns a callable?
k
yup
r
Cool! Thanks -- will give this a try
k
as you can even embed launchplans in workflows
its like subworkflows
and also call them locally
r
oh I didn't realize that, that's neat
k
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
Thanks @Ketan (kumare3), appreciate it
s
[flyte-docs]
r
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
@Samhita Alla gonna fold this into the new getting started guide
161 Views