Update jobspec to have restart policy and fix indents on distinctHost

This commit is contained in:
Alex Dadgar 2015-11-17 17:41:15 -08:00
parent e7e1051f51
commit cf0630b41e
1 changed files with 49 additions and 8 deletions

View File

@ -153,6 +153,10 @@ The `group` object supports the following keys:
* `constraint` - This can be provided multiple times to define additional
constraints. See the constraint reference for more details.
* `restart` - Specifies the restart policy to be applied to tasks in this group.
If omitted, a default policy for batch and non-batch jobs is used based on the
job type. See the restart policy reference for more details.
* `task` - This can be specified multiple times, to add a task as
part of the group.
@ -209,6 +213,43 @@ The `network` object supports the following keys:
For applications that cannot use a dynamic port, they can
request a specific port.
### Restart Policy
The `restart` object supports the following keys:
* `attempts` - For `batch` jobs, `attempts` is the maximum number of restarts
allowed before the task is failed. For non-batch jobs, the `attempts` is the
number of restarts allowed in an `interval` before a restart delay is added.
* `interval` - `interval` is only valid on non-batch jobs and is a time duration
that can be specified using the "s", "m", and "h" suffixes, such as "30s".
The `interval` begins when the first task starts and ensures that only
`attempts` number of restarts happens within it. If more than `attempts`
number of failures happen, the restart is delayed till after the `interval`,
which is then reset.
* `delay` - A duration to wait before restarting a task. It is specified as a
time duration using the "s", "m", and "h" suffixes, such as "30s".
The default `batch` restart policy is:
```
restart {
attempts = 15
delay = "15s"
}
```
The default non-batch restart policy is:
```
restart {
interval = "1m"
attempts = 2
delay = "15s"
}
```
### Constraint
The `constraint` object supports the following keys: