Some questions re. launch plans: 1. Is there any ...
# ask-the-community
c
Some questions re. launch plans: 1. Is there any flytectl command to create or register a launch plan? 2. Why does
pyflyte --pkgs src package
command starts executing the given launch plan and workflow from the local setup itself instead of just packaging the launch plan, workflow and tasks? 3. Is there any flytectl command to see details of the launch plan? For example - how frequently a particular launch plan is scheduled to execute?
t
Hey @Chandrashekhar Kotekar I'm not sure what you're seeing with #2, but the rest of what you are asking about is documented on this page.
c
Thanks @Thomas Blom for the quick help but
Activating a Schedule
comes AFTER initializing launch plan. my 1st question was around the same thing. How to register / initialize the launch plan?
t
@Chandrashekhar Kotekar This is documented on the same page I linked above. When you register your workflow with the flyte backend, the launchplan is registered at that time, the same as any other launchplan - you must define this LaunchPlan in your code along with your workflow. See under Fixed Rate Intervals the example given that calls
LaunchPlan.get_or_create()
You tell it what workflow to run, how often, and what the inputs should be.
c
If I execute
pyflyte package
command from my laptop, is it expected that launch plan will start running workflow from my laptop itself?
y
packaging is just the first step. this will walk through the python files that you give it, and pick out all the flyte entities (launch plans being one of them, workflows and tasks being the others), and will create a zip file containing a protobuf serialized representation of them.
you will then have to ship those off to the control plane (which is associated with one or more execution environments [usually just one])
when the launch plan schedule is activated and triggered, or when you just run the launch plan manually, only then will the code/containers be run.
if the flyte installation is on your laptop then it will start running on your laptop yes. if it’s on eks then it will kick off on eks
c
Thanks @Yee for the explainataion. How do I ensure that
pyflate package
step only "packages" the launch plan, workflow and tasks? In my case I have Flyte demo and sandbox clusters in Docker Desktop. Is is the reason that pakcage command begins executing the launch plan on the laptop itself?
y
the package command will not start executing anything… but it does run a lot of
import …
like it will run import on all your files
so if you have logic at the module level that does stuff, then it will run… but it’s not flyte running, it’s just python
c
ahan ok . thanks. I will have a look into my code . Maybe some code in
__init__.py
is making the code run