https://flyte.org logo
#announcements
Title
# announcements
q

Quinn Romanek

01/24/2022, 11:45 PM
Do I need to run
flytectl register files
first?
k

Ketan (kumare3)

01/24/2022, 11:57 PM
yes
you have to push your workflows to remote first
and then you can create a launch plan
q

Quinn Romanek

01/25/2022, 12:00 AM
So just having the Launchplan.get or create() should be enough to register it?
When I register a workflow
k

Ketan (kumare3)

01/25/2022, 12:00 AM
yup
q

Quinn Romanek

01/25/2022, 12:00 AM
Awesome
k

Ketan (kumare3)

01/25/2022, 12:01 AM
if you have a registered workflow, then you can use the API cto create a launchplan too
there is a cli for the same
q

Quinn Romanek

01/25/2022, 12:01 AM
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
k

Ketan (kumare3)

01/25/2022, 12:05 AM
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
q

Quinn Romanek

01/25/2022, 12:59 AM
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?
k

Ketan (kumare3)

01/26/2022, 5:03 PM
Cc @katrina do you have to enable scheduling in a Domain
k

katrina

01/26/2022, 5:13 PM
nope, scheduling is agnostic from the domain. cc @Prafulla Mahindrakar
p

Prafulla Mahindrakar

01/26/2022, 5:35 PM
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
q

Quinn Romanek

01/26/2022, 6:17 PM
Sure:
Copy code
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:
Copy code
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

01/26/2022, 7:19 PM
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 docs https://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
q

Quinn Romanek

01/26/2022, 7:31 PM
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
👍 1
20 Views