-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Periodic jobs for system scheduler #1944
Comments
I don't think nomad ever supported periodic jobs for any type but batch - but having a way to run something across all hosts could be nice. today we use rundeck for that :) |
Hey as @jippi mentioned, this has never been supported but it is a valid use case. Tagged as an enhancement. Thanks! |
@dadgar Is there a way to simulate this with the batch scheduler? In other words, how can we run a periodic job on each host with the batch scheduler? Setting the distinct_host constraint is not enough. |
@oribaldi There really is no elegant workaround with out scheduler support. You could run the batch scheduler with distinct_host and a count equal to the number of nodes on the cluster but there is no guarantee that will target every node. It may be worth just running the system scheduler as is, and wrapping your "batch" job in a script that acts as a cron and starts up the task every N minutes. Sorry that there isn't a great work around. |
@dadgar Thanks for the reply! We will go for the cron job then. |
+1. for now, i have a master job that restarts scheduled system jobs maintained in a separate config. |
I would love to use nomad as a distributed cron, and move my "management tasks" running on various CM systems over to nomad, but need this to do so. |
My use case is to run a "cleanup" of the docker directory at '/var/lib/docker'. |
Any chance to have this feature developed any time soon? 🙏 |
This would be super useful for important periodic cleanup jobs |
This would be great to have, I have a few scenarios where a 'system' job could be scheduled periodically. |
based on a suggestion by Tommy Alatalo in the Gitter room, you can leverage the ref: https://gitter.im/hashicorp-nomad/Lobby?at=5e4beee0d97c107ed25e3a91 |
Thanks a ton! |
As in: "I don't think it will ever"? Is there any chance this enhancment will be added? It sounds like an easy add, as both the system & cron types already exist
Looks like a nice tool but I really think it would be something nomad could easily provide, saving me from having yet another tool to manage things in our infra... :) |
@tino you could try the |
I could but that means I have to fail the task, which will give noise. ("The restart stanza configures a tasks's behavior on task failure. Restarts happen on the client that is running the task.") I currently implemented it by running a 24h sleep around the actual task in a loop. Also ugly, hence my request to the Nomad team to take another look at this 😉 |
@tino I too once had something similar ... a "while 1" loop with a sleep of 24h 😄 Just for the record ... I am mentioning the Note group "something" {
...
restart {
interval = "4h"
attempts = 1
delay = "2h"
mode = "delay"
}
... |
Thank you all the input and waiting for this feature. Feel free to open new issues if you find any problems with Closed by #9160. |
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
Now (0.5.0rc1) nomad not support periodic jobs for system scheduler.
I think, that it is normal use case that someone want to do periodic job on each host.
Yes, I can use system scheduler with docker container with crond inside, but periodic+system is more simple to use, then cron-in-docker solution.
The text was updated successfully, but these errors were encountered: