Debajyoti Chatterjee
02/13/2024, 4:30 PMfrom flytekit import CronSchedule, LaunchPlan # noqa: E402
from train_model_workflow import train
from flytekit.remote import FlyteRemote
from flytekit.configuration import Config
remote = FlyteRemote(
config=Config.auto(config_file="../config.yaml"),
default_project="flytesnacks",
default_domain="development",
)
cron_lp = LaunchPlan.get_or_create(
name="train-cron",
workflow=train,
fixed_inputs={"tokenizer": ""},
schedule=CronSchedule(
schedule="*/5 * * * *",
),
)
print(cron_lp)
f_cron_lp = remote.register_launch_plan(
cron_lp,
version="1707840433",
project="flytesnacks",
domain="development",
)
print(f_cron_lp)
remote.activate_launchplan(f_cron_lp.id)
• Are launch plans "deactivated" by default? I had to call activate_launchplan
method. After that, the corn jobs started executing.
• I understand only one launch plan version can be active. Assume I had launch plan v4 already activated, and now I created v5. Will v5 automatically become the new active launch plan? Or do I have to deactivate v4 and then activate v5?Yee
Yee
Yee
Yee