zenml icon indicating copy to clipboard operation
zenml copied to clipboard

Schedules don't work well with time zones

Open strickvl opened this issue 1 year ago • 7 comments
trafficstars

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

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

strickvl avatar Jan 03 '24 10:01 strickvl

@strickvl

I would like to work on this Issue! Please assign...

ashutosh887 avatar Jan 11 '24 06:01 ashutosh887

@ashutosh887 you're welcome to do so. Might be worth picking one of the two you mentioned and starting with that one first, but go for it! Let us know if you have any questions or to propose how you might tackle the issue (once you've dived into it a bit).

strickvl avatar Jan 11 '24 08:01 strickvl

is anyone working on this issue? I would like to work on it

kartikbhtt7 avatar Mar 04 '24 06:03 kartikbhtt7

if this is still open, i would like to work on this

shivanjay-wagh avatar Apr 12 '24 17:04 shivanjay-wagh