Hello, I am trying to schedule a workflow but the ...
# ask-the-community
s
Hello, I am trying to schedule a workflow but the documentation feels quite spotty on this. I have a workflow
wf
and launch plan like
Copy code
launch_plan.LaunchPlan.get_or_create(
    workflow=wf,
    name="my_lp",
    schedule=CronSchedule("0 0 ? * * *"),
    default_inputs={...},
    fixed_inputs={...},
)
how do I schedule this after registering it alongside my workflows with
pyflyte serialize
and
flytectl register
? I think the relevant docs are supposed to be https://docs.flyte.org/projects/flytectl/en/latest/gen/flytectl_update_launchplan.html but running the specified commands fails with
launch plan prod failed to update due to rpc error: code = NotFound desc
. This command requires a version which I have none so it might be because of this. How should I proceed? Some side note feedback: It feels to me like activating launch plans is more naturally done in the web UI. However, trying to open my launch plan errors with
Error: Minified React error #31; visit <https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Brole_session_name%2C%20region_name%2C%20role_arn%7D&args[]=> for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
Which probably comes from me using using struct arguments (role_session_name, region_name, role_arn are in a dataclass) but it nevertheless seems like there is a bug in the launch plan rendering.
Found out with
flytectl get launchplans
that the version is the git sha used to register it. Now sure how that's wired but that works. However, trying to register errors since no cron format is valid. In https://docs.flyte.org/en/latest/concepts/schedules.html#short-hand-cron-formats-predefined-schedules
@midnight
or
"0 0 * * *"
are suggested. Both fail during
serialize
. As do `
"0 0 * * * *"
and `
"0 0 ? * * *"
. Is cron scheduling just broken or can it be achieved any other way?
Apparently
CronSchedule(schedule="@midnight")
works (this is in fact in the docs) but
CronSchedule(expr)
fails for
expr
like all the above listed examples
After registering, when I open the workflow in the web UI I am greeted with a lovely
Error: Expression has only 1 part. At least 5 parts are required.
Where the 'schedule' menu used to be. Another react rendering error by the looks of it
s
@Sebastian, • We have an example in the user guide to schedule a launch plan: https://docs.flyte.org/projects/cookbook/en/latest/auto/core/scheduled_workflows/lp_schedules.html; here’s the section to activate a schedule: https://docs.flyte.org/projects/cookbook/en/latest/auto/core/scheduled_workflows/lp_schedules.html#activating-a-schedule
"0 0 * * *"
works for me. I ran the
pyflyte run --remote <python-file> <wf-name>
command.
@Jason Porter / @Carina Ursu, could you please take a look at the UI errors?
Sebastian, what’s your flyteconsole version?
s
Thanks Samhita. It might be good to link to that page from the schedule/launch plan page since there is no way to find it from launch plans pages currently. The cron formatting fails when running
pyflyte serialize
for
CronSchedule("0 0 * * *")
for me. Flyte console is UI Version1.1.6 Admin Version0.4.7-223-g0266a06
s
pyflyte serialize
isn’t the right command anymore. Can you try running
pyflyte --pkgs <parent-package>.<child-package-that-has-the-workflow> package --image <image>
? Where have you come across the
pyflyte serialize
command? You can also try the pyflyte run command I shared with you earlier. It’s far more easy than packaging and registering the workflow separately.
s
I don't know tbh. I don't mean to be rude but the docs feel very scattered and difficult to navigate. A colleague sent me that snippet taken from some docs page that described how to run registration inside a docker container and it happened to work, so now I never want to touch it again unless I really have to.
s
Sorry about that. We’re working on improving our docs.
Please do let us know in case you come across any issues.
k
@Sebastian we are extremely sorry about the docs. We agree and this is not rude. We are working on cleaning up docs in the next month to have a cleaner story. Cc @Niels Bantilan / @Eduardo Apolinario (eapolinario)
Also admin version and Ui look pretty old
h
Not sure what is going on with the admin version to be honest. We are using this image https://github.com/flyteorg/flyteadmin/pkgs/container/flyteadmin/40571873?tag=v1.1.37-scp-fix which is modified to be compliant with Azure AD for Pkce authentication flow. CC: @Prafulla Mahindrakar - are the changes for converting string scopes to a list of strings merged for any newer version to use?
So it should be version v1.1.37 rather than 0.4.7
p
Hi @Hampus Rosvall , the change has been checkedin and you can use this released version of admin https://github.com/flyteorg/flyteadmin/releases/tag/v1.1.43
h
gotcha, let’s try that!
k
Hmm that is odd that version but is wrong - we inject it at build time
p
I had given locally built image to Hampus so I might have some incorrect build version flags locally .The release pipeline shouldn’t have this issue
k
Aah makes sense
h
Testing newer one now! 🙂
Copy code
UI Version
1.1.6
Admin Version
1.1.43
p
Hi @Sebastian , can you avoid using short hand notation of cron for the time being and just use the regular 5 field standard cron. I think flytekit doesn’t support this format at the moment though the scheduler does. In the original message I see you are using 6 field cron which is non standard and was used for aws based cron scheduler.If you are using native scheduler it uses the standard cron format
s
@Prafulla Mahindrakar, should we remove shorthand notation from the docs?
p
Yes for now let’s remove that and can you keep a tracking ticket for flytekit to support this post which we can readd this to the doc
158 Views