Skip to content

Schedules don't work well with time zones #2209

@strickvl

Description

@strickvl

Open Source Contributors Welcomed!

Please comment below if you would like to work on this issue!

Contact Details [Optional]

[email protected]

What happened?

There is an issue with Schedules not aligning properly with different time zones. When a pipeline is scheduled with a certain cron expression, it does not run at the expected local time due to time zone differences. For instance, a pipeline scheduled with the cron expression 0 9 * * * actually ran at 11 AM instead of the expected 9 AM.

Reproduction steps

This issue can be reproduced by setting up a pipeline with a specific cron expression and observing the time it actually runs, which differs due to the time zone. Here's an example:

from zenml.config.schedule import Schedule
from zenml.pipelines import pipeline

@pipeline
def my_pipeline(...):
    ...

schedule = Schedule(cron_expression="0 9 * * *")
my_pipeline = my_pipeline.with_options(schedule=schedule)
my_pipeline.run()

Expected behavior

The scheduled pipelines should run according to the local time zone of the user or the server where ZenML is running, or there should be clear documentation and warning messages indicating the time zone in which the schedules are interpreted.

Potential Solutions

Implement a technical solution that adjusts the scheduling time based on the user's or server's local time zone.
Provide a warning or error message in the ZenML interface to indicate the time zone used for scheduling.
Add documentation specifying the behavior of the scheduler with regards to time zones, especially if it runs on UTC time by default.

Additional context

This issue is crucial for users who rely on precise scheduling for their pipelines, particularly in a global context where users may be in different time zones.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions