-
Notifications
You must be signed in to change notification settings - Fork 2k
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
nomad plan for periodic tasks #2012
Comments
Also of note, if a |
Thanks for the report! |
I also found this when doing some config managemetnt for nomad via the API. This is because the nomad plan API call always returns |
Just ran
@clinta I don't believe that is true. That depends on the count of the task group! |
@dadgar Here's how to reproduce, with v0.5.6. Use the following batch job: {
"Job": {
"ID": "test",
"Name": "test",
"Type": "batch",
"Datacenters": [
"dc0"
],
"TaskGroups": [
{
"Name": "test",
"Count": 1,
"Constraints": [],
"Tasks": [
{
"Name": "test",
"Driver": "exec",
"Config": {
"command": "echo",
"args": [
"foobar"
]
}
}
]
}
],
"Periodic": {
"Enabled": true,
"Spec": "1 * * * * *",
"SpecType": "cron",
"ProhibitOverlap": true
}
}
} Run the job:
Then run plan. Place should be 0, as this job is unchanged.
|
@clinta Ah! Sorry I thought you meant that plan was always returning Place:1 regardless of the count of the actual task group. |
Doing some issue cleanup and I've re-verified this against current versions of Nomad: job "example" {
datacenters = ["dc1"]
type = "batch"
periodic {
cron = "*/10 * * * * *"
prohibit_overlap = true
}
group "group" {
task "task" {
driver = "exec"
config {
command = "/bin/sh"
args = ["-c", "echo $(date)"]
}
}
}
} Initial plan:
Run the job:
Plan again:
|
Fixed in #14492 |
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. |
Nomad version 0.5.0.
For a periodic job,
nomad plan
seems to always exit with exitcode 1, indicating pending changes, even when there are no changes pending.This output is when the job doesn't exist, this is expected
However, I expect that once the job is running, that subsequent plans are noops, but that's not what happens.
EDIT: Including the jobfile as an attachment, but I renamed it to
hello-periodic.txt
to make github happy.hello-periodic.txt
The text was updated successfully, but these errors were encountered: