From c240e021cc7a125739a1a659965f2a11777b8492 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Tue, 10 Apr 2018 16:00:52 -0700 Subject: [PATCH] change default to 10m and docs --- api/jobs.go | 2 +- api/jobs_test.go | 4 ++-- nomad/structs/structs.go | 2 +- website/source/api/json-jobs.html.md | 15 ++++++++---- .../docs/job-specification/update.html.md | 24 +++++++++++++------ 5 files changed, 32 insertions(+), 15 deletions(-) diff --git a/api/jobs.go b/api/jobs.go index f84a6bd528e7..d3a255d06b8c 100644 --- a/api/jobs.go +++ b/api/jobs.go @@ -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), } diff --git a/api/jobs_test.go b/api/jobs_test.go index 939f784874d5..3c23d4629b0b 100644 --- a/api/jobs_test.go +++ b/api/jobs_test.go @@ -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), }, @@ -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), }, diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index fda47f1aa352..55019436a619 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -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, } diff --git a/website/source/api/json-jobs.html.md b/website/source/api/json-jobs.html.md index ef86e1551460..27bb00756a44 100644 --- a/website/source/api/json-jobs.html.md +++ b/website/source/api/json-jobs.html.md @@ -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 @@ -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: diff --git a/website/source/docs/job-specification/update.html.md b/website/source/docs/job-specification/update.html.md index 73811f6cf297..c774ce7f5cc4 100644 --- a/website/source/docs/job-specification/update.html.md +++ b/website/source/docs/job-specification/update.html.md @@ -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" } } ``` @@ -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.