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

feat: Support score extension function in preemption. #121867

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

lianghao208
Copy link
Member

@lianghao208 lianghao208 commented Nov 14, 2023

What type of PR is this?

/kind feature
/sig scheduling

What this PR does / why we need it:

Adding a PreemptionScoreFuncs() in preemption.go#Interface to extend the scoreFuncs in preemption.go#pickOneNodeForPreemption() .
In some use cases, we need the capability to extend the prioritization for node victims to be preepmted instead of rewriting the whole SelectVictimsOnNode().

Which issue(s) this PR fixes:

discussion: slack discussion

Special notes for your reviewer:

Does this PR introduce a user-facing change?

A customizable OrderedScoreFuncs() function is introduced. Out-of-tree plugins that use scheduler's preemption interface can implement this function for custom preemption preferences, or return nil to keep current behavior.

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 14, 2023
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Nov 14, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Nov 14, 2023
@lianghao208
Copy link
Member Author

/sig scheduling

@lianghao208
Copy link
Member Author

/cc @Huang-Wei

pkg/scheduler/framework/preemption/preemption_test.go Outdated Show resolved Hide resolved
pkg/scheduler/framework/preemption/preemption_test.go Outdated Show resolved Hide resolved
pkg/scheduler/framework/preemption/preemption_test.go Outdated Show resolved Hide resolved
pkg/scheduler/framework/preemption/preemption_test.go Outdated Show resolved Hide resolved
pkg/scheduler/framework/preemption/preemption.go Outdated Show resolved Hide resolved
pkg/scheduler/framework/preemption/preemption.go Outdated Show resolved Hide resolved
@lianghao208 lianghao208 force-pushed the preeption branch 3 times, most recently from 41fc749 to df92108 Compare November 14, 2023 06:10
@lianghao208
Copy link
Member Author

@Huang-Wei Already updated according to the review, PTAL:)

@lianghao208
Copy link
Member Author

/retest

@Huang-Wei
Copy link
Member

/lgtm
/approve

@lianghao208 could you add a release note to this PR:

A customizable OrderedScoreFuncs() function is introduced. Out-of-tree plugins that use scheduler's preemption interface can implement this function for custom preemption preferences, or return nil to keep current behavior.

cc @kubernetes/sig-scheduling-misc for awareness.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 14, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Huang-Wei, lianghao208

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 8c17109396b1cae6b419be8f831641d6e82c4911

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Nov 14, 2023
@lianghao208
Copy link
Member Author

@lianghao208 could you add a release note to this PR:

@Huang-Wei released note added, thanks for the review.

Copy link
Member

@kerthcet kerthcet left a comment

Choose a reason for hiding this comment

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

Just nits.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 15, 2023
@kerthcet
Copy link
Member

/lgtm as well, thanks!

@Huang-Wei
Copy link
Member

/lgtm
/milestone v1.29

@k8s-ci-robot k8s-ci-robot added this to the v1.29 milestone Nov 16, 2023
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 16, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 33a984742fd5543afd1b254d9e6e899a3084b2ff

@k8s-ci-robot k8s-ci-robot merged commit 94fe1b3 into kubernetes:master Nov 16, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants