big-notebook-82371
12/11/2023, 8:32 PMpyflyte register … --activate-launchplans
Launch plan creation in python
launch_plan = LaunchPlan.create(
name=launch_plan_name,
workflow=<workflow function>,
default_inputs={
"default_input1": "input_value",
...
},
schedule=CronSchedule(schedule="0 21 * * 1"), # 9 PM each Monday
)
Is this code alone supposed to create the launch plan? I also tried running ``pyflyte register … --activate-launchplan` after, but it seemed to just activate the existing one, which doesn’t have the schedule or the inputs.
I also tried this:
remote = FlyteRemote(
config=Config.auto(),
default_project="flytesnacks",
default_domain="development",
)
launchplan_id = remote.fetch_launch_plan(
name=launch_plan_name,
).id
remote.client.update_launch_plan(launchplan_id, "ACTIVE")
But that had the same effect, where it seems to “activate” the existing launchplan, but with no schedule and no inputs.
Here’s the schedule section, which makes it look like its not really scheduled (and i tried scheduling every minute and nothing started). And the launchplan page has no default values (it just says “scalar”) and no fixed inputs: “This launch plan has no fixed inputs”.
I’m sorry if I’m totally misunderstanding the docs. My goal in the end is to create several different launch plans for the same workflow, where each has a few differing inputs, and different schedules. Thank you!tall-lock-23197
big-notebook-82371
12/12/2023, 3:23 PMLaunchPlan.get_or_create
call was supposed to just adjacent to the workflow function? I had it under if __name__ is "__main__"
, but it looks like I got it by just not putting it under anything and then running pyflyte register path/to/workflow.py --activate-launchplans
if that sounds right