• Quinn Romanek

    Quinn Romanek

    6 months ago
    Do I need to run
    flytectl register files
    first?
  • Ketan (kumare3)

    Ketan (kumare3)

    6 months ago
    yes
  • you have to push your workflows to remote first
  • and then you can create a launch plan
  • Quinn Romanek

    Quinn Romanek

    6 months ago
    So just having the Launchplan.get or create() should be enough to register it?
  • When I register a workflow
  • Ketan (kumare3)

    Ketan (kumare3)

    6 months ago
    yup
  • Quinn Romanek

    Quinn Romanek

    6 months ago
    Awesome
  • Ketan (kumare3)

    Ketan (kumare3)

    6 months ago
    if you have a registered workflow, then you can use the API cto create a launchplan too
  • there is a cli for the same
  • Quinn Romanek

    Quinn Romanek

    6 months ago
    What's the command? I didn't see it
  • In flytectl
  • Also, does the email notification require any other setup? Like I noticed you don't give a sender email in the python code
  • Ketan (kumare3)

    Ketan (kumare3)

    6 months ago
    hmm 😞 its missing in flytectl, can you create an issue. it can be done in python - https://github.com/flyteorg/flytekit/blob/master/flytekit/clis/flyte_cli/main.py#L1079
  • the email notification today uses an external emailing service
  • we dont use smtp
  • Quinn Romanek

    Quinn Romanek

    6 months ago
    Hm my schedule isn't showing up, does the launch plan need to be in the workflow directory?
  • Ah it had a default name
  • Ok, it now shows up in the console as running daily (after I've run flytectl update --activate), but the workflow is not actually being scheduled
  • My scheduler is healthy and logs that it pulls 0 schedules from flyteadmin
  • Is there something I'm missing?
  • Ketan (kumare3)

    Ketan (kumare3)

    6 months ago
    Cc @katrina do you have to enable scheduling in a Domain
  • k

    katrina

    6 months ago
    nope, scheduling is agnostic from the domain. cc @Prafulla Mahindrakar
  • p

    Prafulla Mahindrakar

    6 months ago
    Hi @Quinn Romanek, can you share your schedule example that you wrote using flytekit and i might want to try and see what is happening .
  • Also please do share the command you used to activate the schedule
  • Quinn Romanek

    Quinn Romanek

    6 months ago
    Sure:
    from flytekit import CronSchedule, LaunchPlan, Email, WorkflowExecutionPhase
    from flyte.workflows import nba
    
    # Run daily download at 10 am every day
    daily_download_lp = LaunchPlan.get_or_create(
        name="daily_download_schedule",
        workflow=nba.daily_download,
        schedule=CronSchedule(schedule="0 10 * * *"),
        notifications=[
            Email(
                phases=[
                    WorkflowExecutionPhase.FAILED,
                    WorkflowExecutionPhase.SUCCEEDED,
                    WorkflowExecutionPhase.TIMED_OUT,
                ],
                recipients_email=["xxxx"],
            )
        ],
    )
  • Command:
    flytectl update launchplan \
      -c config.yaml \
      -p quinnba \
      -d development \
      daily_download_schedule \
      --version 08b064a7 --activate
  • And it now says "runs at 10am" in the workflow page on the console
  • p

    Prafulla Mahindrakar

    6 months ago
    Runs at 10 am , seem right https://crontab.guru/#0_10_*_*_* I think you are missing the kickoff_time_input_arg probably . Can you check these docshttps://docs.flyte.org/projects/cookbook/en/latest/auto/core/scheduled_workflows/lp_schedules.html#cron-schedules Seems we are missing a validation in flytekit here
  • Quinn Romanek

    Quinn Romanek

    6 months ago
    Right, the issue is that it isn't actually running
  • But admin/console thinks it will
  • Oh sorry just saw that last message, I'll add the kickoff time arg