-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
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.
There was a problem hiding this 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
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. |
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