-
Notifications
You must be signed in to change notification settings - Fork 61
Conversation
45e696e
to
28680fc
Compare
Sure I will fix that. |
28680fc
to
58b4964
Compare
I made the changes as suggested. I will work on flyteadmin later to reject launch plan with this kind of schedule, then probably there is no need to change flyteconsole to display the schedule. Another PR will be made in flytekit to propagate the proto. |
I forgot to |
Does this look more reasonable now? |
@@ -16,6 +16,12 @@ message FixedRate { | |||
FixedRateUnit unit = 2; | |||
} | |||
|
|||
// Supported only by some schedulers for example Spotify/Styx. Your platform may not have this enabled. | |||
message CronScheduleWithOffset { | |||
string schedule = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the schedule here actually the expression?
Also, this is pretty good, i think eventually we should just deprecate cron_expression for CronScheduleWithOffset (just offset will be 0 by default and not supported on most platforms)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be a cron expression or alias such as hourly, daily, weekly, monthly etc. So we were not so sure what name could be more reasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR flyteorg/flytekit#188 gives more details.
minor nit, then +1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what @katrogan thinks?
@wild-endeavor I guess it is legacy reason, the cron expression handling is very weird in flytekit as it basically casts from a richer semantics to a weaker one by string manipulation. Is it OK with this change we start accepting Unix flavoured cron in launch plan definition? For example, for the deprecated cron expression we keep the the existing logic unchanged, while for CronSchedule we parse it directly using croniter, and the validation will also allow cron alias, such as daily, weekly, etc. The validation logic can be found in the proposed flytekit PR. |
Co-authored-by: Yee Hing Tong <[email protected]>
Co-authored-by: Yee Hing Tong <[email protected]>
Co-authored-by: Yee Hing Tong <[email protected]>
@wild-endeavor What do you think of the name of this class: https://github.com/lyft/flytekit/blob/6274318ad9f64b0367754a917d08d0f133358300/flytekit/common/schedules.py#L128. There is already a class named |
I have a second thought now, that I think it might make other changes easier (flytekit and flyteadmin) to name the message as |
+1 after changing the name to |
I like CronSchedule too! I think it will make sense to move to that as the replacement for cron_expression (which like @honnix mentioned is a weird/less-structured format anyways) |
How do we handle the python class name then? We could have more validation branches to cover alias, Unix cron and existing cron in the same class. How does that sound? |
This reverts commit e468ea8.
@katrogan @wild-endeavor I revert it back to |
@@ -16,14 +16,20 @@ message FixedRate { | |||
FixedRateUnit unit = 2; | |||
} | |||
|
|||
message CronSchedule { | |||
string schedule = 1; | |||
string offset = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one nit: can you add comments on what the expected format for schedule and offset should be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@katrogan Do we plan to support AWS cron as well in CronSchedule.schedule
? If yes, I can revise the comment a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should move away from the aws cron type (which is more work) and have admin handle converting to it in its aws specific scheduler handler. But that can be a separate issue and we can keep using the deprecated cron_expression in the meantime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. The problem is the 5-fields cron syntax is weaker than the one used by AWS, so it's not gonna be an 100% mapping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @wild-endeavor mind taking one last look?
Alright. I'm merging this and will make changes in flytekit accordingly. Thanks everyone for reviewing and commenting on this PR. |
@katrogan I drafted this release https://github.com/lyft/flyteidl/releases/tag/untagged-eaee7bcfa18de386fe2b, please take a look and release if it is OK. |
@honnix looks good! |
Somehow the github workflow is not triggered to publish to pypi. 🤔 |
I just tried to push it manually - can you try to pull on your end? |
@wild-endeavor Yeah that worked. I guess I messed it by drafting a release and then publish. There are weird things regarding which event to use: https://stackoverflow.com/questions/59319281/github-action-different-between-release-created-and-published |
* Extend `CronSchedule` to support `schedule` and `offset` added in flyteorg/flyteidl#83 Co-authored-by: tnsetting <[email protected]>
* Extend `CronSchedule` to support `schedule` and `offset` added in flyteorg/flyteidl#83 Co-authored-by: tnsetting <[email protected]>
* Extend `CronSchedule` to support `schedule` and `offset` added in flyteorg/flyteidl#83 Co-authored-by: tnsetting <[email protected]>
* Support cron schedule with offset. For example: https://github.com/spotify/styx#schedule-string * Add generated files * Update protos/flyteidl/admin/schedule.proto Co-authored-by: Yee Hing Tong <[email protected]> * Update protos/flyteidl/admin/schedule.proto Co-authored-by: Yee Hing Tong <[email protected]> * Update protos/flyteidl/admin/schedule.proto Co-authored-by: Yee Hing Tong <[email protected]> * Regenerate files * Regenerate files * Change the message name back * Revert "Change the message name back" This reverts commit e468ea8. * Add comments for schedule and offset Co-authored-by: Yee Hing Tong <[email protected]>
TL;DR
When integrating with our scheduler Styx, we will need to extend the semantics of schedule to support Styx cron syntax, cron aliases, as well as offset.
Type
Are all requirements met?
Complete description
Complete description and details can be found in the issue description.
Tracking Issue
flyteorg/flyte#529
Follow-up issue