Yelp / Tron

Next generation batch process scheduling and management
Other
343 stars 61 forks source link

Replace IntervalScheduler with GrocIntervalScheduler #78

Open irskep opened 12 years ago

irskep commented 12 years ago

In order to have jobs run at the top of every hour, and synchronize intervals even in the face of DST, we should hook up groc's IntervalTimeSpecification to our interval scheduler.

irskep commented 12 years ago

Just to clarify, this would let us do "every 3 hours between 10AM and 3PM".

bchess commented 12 years ago

+1. This would make it possible to run our hourly batches during the daytime hours.

irskep commented 12 years ago

I was blocked on some things today, so I started a branch for this, forking from config_rewrite.

irskep commented 12 years ago

For reference: GAE cron syntax

irskep commented 12 years ago

I was bored after work and wrote a parser for this. No actual scheduler yet.

irskep commented 12 years ago

This can be bumped to the next release.

irskep commented 12 years ago

I don't know if I'm going to ultimately have time to hook up the parser with the actual IntervalTimeSpecification object. If you want to continue my work, you can look at this branch: https://github.com/irskep/tron/tree/new_interval_scheduler

I can still try to find time to do it in between my other work, I just can't give you a specific delivery date.

dnephin commented 12 years ago

I took a look at this again. I noticed that the appengine.cron package has a parser already, and the package is only dependent on core python packages. What do you think about creating a package out of everything under: http://code.google.com/p/googleappengine/source/browse/trunk/python/google/appengine/cron/. This package would be external to Tron.

That would allow us to create a scheduler which uses this parser/scheduler but would only attempt to import the package when a job is configured to use this scheduler. It would also mean we'd support the full groc syntax.

irskep commented 12 years ago

The parser uses antlr3, which I thought wasn't in the standard library.

dnephin commented 12 years ago

Ah, true. I guess I meant that there weren't any other google appengine dependencies. If someone wanted to use the groc scheduler, they'd have to install antlr3 and this new package that we would make.

irskep commented 12 years ago

I'd rather see fewer dependencies.. Besides, the existing daily parser implements most available daily scheduler features, and the other parser just needs a little glue to work. I admit regexes are not the cleanest solution, but they match correct expressions correctly.

Maybe in the future there could be some sort of scheduler plugin system.

dnephin commented 11 years ago

There is now a general purpose time specification (tron.utils.trontimespec) which will support the groc interval spec. All we'd need is a parser for the config entry.

https://github.com/irskep/Tron/blob/new_interval_scheduler/tron/config/schedule_parse.py