Skip to content
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

add default update stanza and max_parallel=0 disables deployments #6191

Merged
merged 10 commits into from
Sep 2, 2019

Conversation

jazzyfresh
Copy link
Contributor

@jazzyfresh jazzyfresh commented Aug 22, 2019

Overview

This adds a default update stanza and makes max_parallel=0 a sentinel value that disables deployments.

  • Jobs that do not have an update stanza present in the jobspec will default to a deployment of rolling updates with max_parallel=1
    • Previous behavior for jobs w/o an update stanza was forced updates
    • Jobs that have an update stanza (even an empty one) are not affected
  • Jobs with max_parallel=0 in their update stanza will disable deployments (rolling and canary) explicitly, and make the job do forced updates

Behavior

Default update stanza

Service jobs have deployments when first submitted

Screenshot from 2019-08-30 09-43-43

Service jobs have rolling deployments when you submit a new version of the job

Screenshot from 2019-08-30 09-44-15

Batch jobs have no deployments and still perform destructive updates

Screenshot from 2019-08-30 09-50-59


max_parallel=0 disables deployments (i.e. the job will have destructive updates)

Screenshot from 2019-08-30 09-53-15
Screenshot from 2019-08-30 09-52-54

Implementation

  • we set the default update strategy for a Job, which will get merged into the TaskGroup update strategy at api.Canonicalization in the command/agent
  • the place to disable deployments for a job is when the alloc reconciler computes the deployment for the task group

Todo

  • default update stanza
    • update validation
    • update docs with a note that max_parallel=0 is a sentinel value to indicate forced updates
    • update tests
    • set the default update strategy at Job canonicalization
      • double check w/ team: canonicalization should happen server side in structs#(*Job)Canonicalize?
        • no it should happen in the api#(*Job)Canonicalize which is called from the command/agent, that means we would set the defaults before raft
        • putting it in the structs#Canonicalize would result in surprising behavior, since we expect structs to be not nil
    • test that confirms it's only for service jobs
  • max_parallel=0 should disable deployment patterns
    • confirm forced updates
    • confirm no deployments are present
  • tests for max_parallel
  • (separate PR) update docs: after an upgrade, a job update (not just job create) will result in an update stanza being added
  • (separate PR) add e2e tests

@jazzyfresh jazzyfresh assigned notnoop, cgbaker and jazzyfresh and unassigned notnoop and cgbaker Aug 22, 2019
@jazzyfresh jazzyfresh requested review from notnoop and cgbaker August 30, 2019 16:11
Copy link
Contributor

@cgbaker cgbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (with minor error message change) 🎉

nomad/structs/structs.go Outdated Show resolved Hide resolved
Copy link
Contributor

@endocrimes endocrimes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jazzyfresh jazzyfresh merged commit c346a47 into master Sep 2, 2019
@jazzyfresh jazzyfresh deleted the f-default-update-stanza branch September 2, 2019 17:30
@jazzyfresh jazzyfresh added this to the 0.10.0 milestone Sep 3, 2019
@github-actions
Copy link

github-actions bot commented Feb 1, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants