Skip to content

Commit

Permalink
change default to 10m and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dadgar authored and preetapan committed May 7, 2018
1 parent 01fcba1 commit c240e02
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 15 deletions.
2 changes: 1 addition & 1 deletion api/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ func DefaultUpdateStrategy() *UpdateStrategy {
HealthCheck: helper.StringToPtr("checks"),
MinHealthyTime: helper.TimeToPtr(10 * time.Second),
HealthyDeadline: helper.TimeToPtr(5 * time.Minute),
ProgressDeadline: helper.TimeToPtr(15 * time.Minute),
ProgressDeadline: helper.TimeToPtr(10 * time.Minute),
AutoRevert: helper.BoolToPtr(false),
Canary: helper.IntToPtr(0),
}
Expand Down
4 changes: 2 additions & 2 deletions api/jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ func TestJobs_Canonicalize(t *testing.T) {
HealthCheck: helper.StringToPtr("checks"),
MinHealthyTime: helper.TimeToPtr(10 * time.Second),
HealthyDeadline: helper.TimeToPtr(5 * time.Minute),
ProgressDeadline: helper.TimeToPtr(15 * time.Minute),
ProgressDeadline: helper.TimeToPtr(10 * time.Minute),
AutoRevert: helper.BoolToPtr(false),
Canary: helper.IntToPtr(0),
},
Expand Down Expand Up @@ -393,7 +393,7 @@ func TestJobs_Canonicalize(t *testing.T) {
HealthCheck: helper.StringToPtr("checks"),
MinHealthyTime: helper.TimeToPtr(10 * time.Second),
HealthyDeadline: helper.TimeToPtr(5 * time.Minute),
ProgressDeadline: helper.TimeToPtr(15 * time.Minute),
ProgressDeadline: helper.TimeToPtr(10 * time.Minute),
AutoRevert: helper.BoolToPtr(false),
Canary: helper.IntToPtr(0),
},
Expand Down
2 changes: 1 addition & 1 deletion nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2486,7 +2486,7 @@ var (
HealthCheck: UpdateStrategyHealthCheck_Checks,
MinHealthyTime: 10 * time.Second,
HealthyDeadline: 5 * time.Minute,
ProgressDeadline: 15 * time.Minute,
ProgressDeadline: 10 * time.Minute,
AutoRevert: false,
Canary: 0,
}
Expand Down
15 changes: 11 additions & 4 deletions website/source/api/json-jobs.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -620,12 +620,19 @@ determined. The potential values are:

- `MinHealthyTime` - Specifies the minimum time the allocation must be in the
healthy state before it is marked as healthy and unblocks further allocations
from being updated. This is specified using a label suffix like "30s" or
"15m".
from being updated.

- `HealthyDeadline` - Specifies the deadline in which the allocation must be
marked as healthy after which the allocation is automatically transitioned to
unhealthy. This is specified using a label suffix like "2m" or "1h".
unhealthy.

- `ProgressDeadline` - Specifies the deadline in which an allocation must be
marked as healthy. The deadline begins when the first allocation for the
deployment is created and is reset whenever an allocation as part of the
deployment transitions to a healthy state. If no allocation transitions to the
healthy state before the progress deadline, the deployment is marked as
failed. If the `progress_deadline` is set to `0`, the first allocation to be
marked as unhealthy causes the deployment to fail.

- `AutoRevert` - Specifies if the job should auto-revert to the last stable job
on deployment failure. A job is marked as stable if all the allocations as
Expand All @@ -638,7 +645,7 @@ determined. The potential values are:
allocations at a rate of `max_parallel`.

- `Stagger` - Specifies the delay between migrating allocations off nodes marked
for draining. This is specified using a label suffix like "30s" or "1h".
for draining.

An example `Update` block:

Expand Down
24 changes: 17 additions & 7 deletions website/source/docs/job-specification/update.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ highest precedence and then the job.
```hcl
job "docs" {
update {
max_parallel = 3
health_check = "checks"
min_healthy_time = "10s"
healthy_deadline = "10m"
auto_revert = true
canary = 1
stagger = "30s"
max_parallel = 3
health_check = "checks"
min_healthy_time = "10s"
healthy_deadline = "5m"
progress_deadline = "10m"
auto_revert = true
canary = 1
stagger = "30s"
}
}
```
Expand Down Expand Up @@ -77,6 +78,15 @@ set of updates. The `system` scheduler will be updated to support the new
automatically transitioned to unhealthy. This is specified using a label
suffix like "2m" or "1h".

- `progress_deadline` `(string: "10m")` - Specifies the deadline in which an
allocation must be marked as healthy. The deadline begins when the first
allocation for the deployment is created and is reset whenever an allocation
as part of the deployment transitions to a healthy state. If no allocation
transitions to the healthy state before the progress deadline, the deployment
is marked as failed. If the `progress_deadline` is set to `0`, the first
allocation to be marked as unhealthy causes the deployment to fail. This is
specified using a label suffix like "2m" or "1h".

- `auto_revert` `(bool: false)` - Specifies if the job should auto-revert to the
last stable job on deployment failure. A job is marked as stable if all the
allocations as part of its deployment were marked healthy.
Expand Down

0 comments on commit c240e02

Please sign in to comment.