Open aneustroev opened 11 months ago
Hi @aneustroev! This proposal raises a couple of questions for me:
systemd.time
syntax equivalently expressive as cron syntax? That is, are there intervals that systemd.time
that cron cannot or vice-versa?systemd.time
syntax from their use with cron
(or modern replacements) and systemd
timers. Whereas the job author might also be the cluster administrator but for many organizations is an application developer. The job author might not be familiar with cron syntax, but I'm not sure that the same author would be more familiar with systemd.time
syntax either?In any case, even if we were to do this, the systemd.time
parsing would need to live alongside the cron syntax for backwards compatibility purposes. And we definitely wouldn't want that parsing to be in the cronexpr
library; that's specifically for cron syntax so adding another Linux-specific syntax there doesn't make a lot of sense from a library design standpoint.
Hi. I don't ask about change format, just about option. :smile: Now you have job.SpecType
in Nomad code, but it use only for tests.
Is the systemd.time syntax equivalently expressive as cron syntax? Yes, a little bit spec
systemd.time
format more human-readable, because it follow nnative time format.
5 4 * * *
# vs
*-*-* 04:05:00
# or just
04:05
and with dates
5 4 */2 4-5 *
# vs
*-4..5-01/2 04:05:00
# or shorter form
*-4..5-01/2 04:05
Our programmers have no problems and prefer it.
I agree with you about cronexpr
design, but parsing systemd.time
on 99% similar that cron :smile: that because I extend library for my PoC. It doesn't look like problem, I can create another one separate repository.
Thanks for the clarification @aneustroev. I'm not sure we're definitely going to accept this but I'll move it into roadmapping for further discussion.
I made PR https://github.com/hashicorp/nomad/pull/19682, and we use it in production for a month without any problems. Also this allowed us easy migrate from systemd timers to nomad. @tgross Can you pay attention for my PR please?
Hi @aneustroev, I'll try to get that reviewed in the next week.
Hi there, I want to suggest implement PeriodicSpecSystemd
Proposal
I want to add another one PeriodicSpecType. https://www.freedesktop.org/software/systemd/man/systemd.time.html It is more flexible and usefull for many system administration who knows how to managing systemd.
I forked you cronexpr library, and add systemd timers functionality. (also rewrite some tests and add my) https://github.com/WinnerSoftLab/cronexpr
I can implement it in Nomad, but after my PR https://github.com/hashicorp/nomad/pull/17858 will be merged , because it will have a lot conflicts if I violate the order merges.
Use-cases
Nomad get more flexible and famous format for describe periodic job times.