Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core feature] Add timezone to CronSchedule #5824

Open
2 tasks done
jbencina opened this issue Oct 8, 2024 · 2 comments
Open
2 tasks done

[Core feature] Add timezone to CronSchedule #5824

jbencina opened this issue Oct 8, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@jbencina
Copy link

jbencina commented Oct 8, 2024

Motivation: Why do you think this is important?

There are instances where some flows are expected to launch at a time anchored to a specific time zone. The CronSchedule has an offset parameter, however this is a fixed value. During daylight savings time adjustments, a discrepancy is introduced unless the offset parameter is updated.

Goal: What should the final outcome look like, ideally?

Addition of another optional parameter accepting an IANA timezone like Americas/Los_Angeles as used by Python's tzinfo. The Flyte scheduler should use this timezone as an override to any application interpretation of the cron schedule.

Describe alternatives you've considered

We tried the offset parameter and just relying on UTC scheduling, but the DST shifts will cause issues down the road.

Propose: Link/Inline OR Additional context

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@jbencina jbencina added enhancement New feature or request untriaged This issues has not yet been looked at by the Maintainers labels Oct 8, 2024
Copy link

welcome bot commented Oct 8, 2024

Thank you for opening your first issue here! 🛠

@eapolinario eapolinario removed the untriaged This issues has not yet been looked at by the Maintainers label Oct 17, 2024
@eapolinario eapolinario self-assigned this Oct 17, 2024
@eapolinario
Copy link
Contributor

In principle, this could be achieved in the case of the Flyte Native Scheduler. Under the covers we use https://github.com/robfig/cron, which is able to parse the expression CRON_TZ=<time-zone>, as described in the docs:

CRON_TZ is now the recommended way to specify the timezone of a single schedule, which is sanctioned by the specification. The legacy "TZ=" prefix will continue to be supported since it is unambiguous and easy to do so

Unfortunately, that convention is not implemented in the python library we use to validate cron expressions, https://github.com/kiorky/croniter, which complicates matters.

We'd also have to update the parsing of the cron expression in flyteconsole, as that uses a library that doesn't implement the CRON_TZ=<time-zone> convention either.

@eapolinario eapolinario removed their assignment Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

2 participants