Support for holiday calendars (extended cron / alternatives to cron)

93 views
Skip to first unread message

Simon Graham

unread,
Mar 1, 2018, 6:03:39 AM3/1/18
to Nomad
Hello,

Are there any plans to support extensions or alternatives to cron syntax for periodic jobs? The feature we are specifically interested in is holiday calendars, i.e. preventing jobs from running on specific dates.

I couldn't find this question covered anywhere else, so thought I should raise it.

This is supported in some other enterprise job schedulers, and in things like Java's Quartz Scheduler. Here's a calendar example taken from http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/tutorial-lesson-04.html:

HolidayCalendar cal = new HolidayCalendar();
cal.addExcludedDate( someDate );
cal.addExcludedDate( someOtherDate );

sched.addCalendar("myHolidays", cal, false);


Trigger t = newTrigger()
    .withIdentity("myTrigger")
    .forJob("myJob")
    .withSchedule(dailyAtHourAndMinute(9, 30)) // execute job daily at 9:30
    .modifiedByCalendar("myHolidays") // but not on holidays
    .build();

It would be wonderful if Nomad eventually supported something like this in addition to basic cron syntax.

Is this something that would fit in with the long term direction and roadmap for Nomad?

Thanks,
Simon

Chelsea Komlo

unread,
Mar 1, 2018, 3:16:27 PM3/1/18
to Simon Graham, Nomad
Hi Simon,

Thanks for the email- this is something that we could support in the future once we move towards a plugin architecture, but isn't something that we can support for our near-term roadmap.

In the meantime, one way to accomplish this is to write a script that runs taking holidays into account as you describe above, and submits a batch job when applicable to Nomad using Nomad's API. You could also create a periodic job for Nomad as opposed to running this script externally.

Let us know if there is anything else we can help with,
Chelsea

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/nomad/issues
IRC: #nomad-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Nomad" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nomad-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nomad-tool/02221a4e-8f53-452b-886f-0974a1626d0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Simon Graham

unread,
Mar 7, 2018, 12:08:45 PM3/7/18
to Nomad
Hi Chelsea,

That makes it very clear. Using a script to submit a batch job to Nomad using the REST API is one approach I don't think we had considered before, but it makes a lot of sense.

The plugin architecture would be a great addition when it finally arrives.

Thanks,
Simon

To unsubscribe from this group and stop receiving emails from it, send an email to nomad-tool+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages