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

core: allow setting and propagation of eval priority on job de/registration #11532

Merged
merged 9 commits into from
Nov 23, 2021

Conversation

jrasell
Copy link
Member

@jrasell jrasell commented Nov 18, 2021

This change allows setting the evaluation priority on job registration, update, and deregistration. In the event an override parameter is set, it will be validate to be within the 1-100 (inclusive) range. All evaluations triggered as a direct result of the job change request will inherit the override evaluation priority. This has meant the evaluation priority needs to be passed to the allocation reconciler and deployment watcher, as the eval priority and job priority are now distinctly different properties. If the operator does not set an override, the job priority is used which is consistent with the current behaviour.

I've added a demo to my dev-mess repo which details one way to test this change and see the behaviour.

Each commit contains additional commentary where needed.

closes #11434

This change modifies the Nomad job register and deregister RPCs to
accept an updated option set which includes eval priority. This
param is optional and override the use of the job priority to set
the eval priority.

In order to ensure all evaluations as a result of the request use
the same eval priority, the priority is shared to the
allocReconciler and deploymentWatcher. This creates a new
distinction between eval priority and job priority.
The Nomad agent HTTP API has been modified to allow setting the
eval priority on job update and delete. To keep consistency with
the current v1 API, job update accepts this as a payload param;
job delete accepts this as a query param.

Any user supplied value is validated within the agent HTTP handler
removing the need to pass invalid requests to the server.
The register and deregister opts functions now all for setting
the eval priority on requests.

The change includes a small change to the DeregisterOpts function
which handles nil opts. This brings the function inline with the
RegisterOpts.
@jrasell jrasell added this to the 1.2.1 milestone Nov 18, 2021
@jrasell jrasell requested review from schmichael and tgross November 18, 2021 14:12
@jrasell jrasell self-assigned this Nov 18, 2021
@jrasell jrasell marked this pull request as ready for review November 18, 2021 14:33
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

Overall this looks great @jrasell! The way you broke up the PR into commits with good messages really helped expedite review here too. Thanks!

I've left a few comments/questions but I think the only thing that's potentially a blocker is my concern about deployments during an upgrade.

e2e/eval_priority/inputs/default_job_priority.nomad Outdated Show resolved Hide resolved
nomad/job_endpoint.go Show resolved Hide resolved
api/jobs.go Show resolved Hide resolved
e2e/eval_priority/eval_priority.go Outdated Show resolved Hide resolved
nomad/structs/structs.go Show resolved Hide resolved
nomad/deploymentwatcher/deployment_watcher.go Outdated Show resolved Hide resolved
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM!

@jrasell jrasell merged commit 80dcae7 into main Nov 23, 2021
@jrasell jrasell deleted the f-gh-11434 branch November 23, 2021 08:23
@github-actions
Copy link

github-actions bot commented Nov 8, 2022

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 Nov 8, 2022
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.

Allow overriding evaluation priority for job commands and APIs
2 participants