Update jobspec with update and periodic block

This commit is contained in:
Alex Dadgar 2016-01-07 16:11:17 -08:00
parent 8e3d9d09fa
commit 91be4970b7
1 changed files with 33 additions and 22 deletions

View File

@ -151,17 +151,7 @@ The `job` object supports the following keys:
[here](/docs/jobspec/schedulers.html) [here](/docs/jobspec/schedulers.html)
* `update` - Specifies the task's update strategy. When omitted, rolling * `update` - Specifies the task's update strategy. When omitted, rolling
updates are disabled. The `update` block has the following configuration: updates are disabled. The `update` block supports the following keys:
```
update {
// The number of tasks that can be updated in parallel.
max_parallel = 3
// A delay introduced between sets of task updates.
stagger = "30s"
}
```
* `max_parallel` - `max_parallel` is given as an integer value and specifies * `max_parallel` - `max_parallel` is given as an integer value and specifies
the number of tasks that can be updated at the same time. the number of tasks that can be updated at the same time.
@ -171,23 +161,44 @@ The `job` object supports the following keys:
seconds are assumed. Otherwise the "s", "m", and "h" suffix can be used, seconds are assumed. Otherwise the "s", "m", and "h" suffix can be used,
such as "30s". such as "30s".
* `periodic` - `periodic` allows the job to be scheduled at fixed times, dates An example `update` block:
or intervals. The `periodic` block has the following configuration:
``` ```
periodic { update {
// Enabled is defaulted to true if the block is included. It can be set // Update 3 tasks at a time.
// to false to pause the periodic job from running. max_parallel = 3
enabled = true
// A cron expression configuring the interval the job is launched at. // Wait 30 seconds between updates.
// Supports predefined expressions such as "@daily" and "@weekly" stagger = "30s"
cron = "*/15 * * * * *"
} }
``` ```
`cron`: See [here](https://github.com/gorhill/cronexpr#implementation) * `periodic` - `periodic` allows the job to be scheduled at fixed times, dates
for full documentation of supported cron specs and the predefined expressions. or intervals. The `periodic` block supports the following keys:
* `enabled` - `enabled` determines whether the periodic job will spawn child
jobs. `enabled` is defaulted to true if the block is included.
* `cron` - A cron expression configuring the interval the job is launched
at. Supports predefined expressions such as "@daily" and "@weekly" See
[here](https://github.com/gorhill/cronexpr#implementation) for full
documentation of supported cron specs and the predefined expressions.
* `prohibit_overlap` - `prohibit_overlap` can be set to true to enforce that
the periodic job doesn't spawn a new instance of the job if any of the
previous jobs are still running. It is defaulted to false.
An example `periodic` block:
```
periodic {
// Launch every 15 minutes
cron = "*/15 * * * * *"
// Do not allow overlapping runs.
prohibit_overlap = true
}
```
### Task Group ### Task Group