E541 feature(volumebinding): Implement PreScore for VolumeBinding plugin to skip score by AxeZhan · Pull Request #115768 · kubernetes/kubernetes · GitHub
[go: up one dir, main page]

Skip to content

Conversation

AxeZhan
Copy link
Member
@AxeZhan AxeZhan commented Feb 14, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

Implement prescore for volumebinding plugin to let it skip score extension in some scenario.

Which issue(s) this PR fixes:

Part of #115745

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Implement  `prescore` extension point for `volumeBinding` plugin. Return skip if it doesn't do anything in Score.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 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 needs-priority Indicates a PR lacks a `priority/foo` label and requires one. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/storage Categorizes an issue or PR as relevant to SIG Storage. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 14, 2023
@AxeZhan AxeZhan force-pushed the volumebinding branch 2 times, most recently from 489d71e to 5cfe7f7 Compare February 15, 2023 03:29
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 15, 2023
@AxeZhan AxeZhan changed the title [WIP] feature(volumebinding): Implement PreScore for VolumeBinding plugin to skip score feature(volumebinding): Implement PreScore for VolumeBinding plugin to skip score Feb 15, 2023
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 15, 2023
@AxeZhan
Copy link
Member Author
AxeZhan commented Feb 15, 2023

/cc @sanposhiho

@k8s-triage-robot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 22, 2023
@sanposhiho
Copy link
Member

sorry I need to prioritize my KEPs related implementation these days. will get back here after them 🙏

@sanposhiho
Copy link
Member

/assign

@AxeZhan
Copy link
Member Author
AxeZhan commented Mar 2, 2023

This pr is need_rebase because of some conflicts in test files. So I think we can safely review the code changes in main files, and discuss whether this is worth the implementation.

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 2, 2023
@sanposhiho
Copy link
Member

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Dec 2, 2023
Copy link
Member
@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

small nits only

@sanposhiho
Copy link
Member

/retest

Copy link
Member
@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

/lgtm

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

LGTM label has been added.

Git tree hash: e3eac09a9d43c4ffbdeec73c2c9e2d9bf31a60ca

@sanposhiho
Copy link
Member

@kubernetes/sig-scheduling-approvers Anyone ptal for the second path. (The bot assigned it to me for /approve)

@sanposhiho
Copy link
Member

@AxeZhan This change deserves to be in the release note since we newly introduce PreScore for VolumeBinding.

@k8s-ci-robot k8s-ci-robot added 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 Dec 2, 2023
if err != nil {
return framework.AsStatus(err)
}
for _, podVolumes := range state.podVolumesByNode {
Copy link
Member

Choose a reason for hiding this comment

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

This is going to be iterating over all nodes in a non-parallel loop, which might be more expensive than just running Score. So I'm not sure if we are gaining anything.

I would prefer a simpler check, like podVolumesByNode being empty.

Copy link
Member Author
@AxeZhan AxeZhan Dec 6, 2023

Choose a reason for hiding this comment

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

How about we add a bool flag in state data?

type stateData struct {
	allBound bool
	podVolumesByNode  map[string]*PodVolumes
	podVolumeClaims   *PodVolumeClaims
	sync.Mutex
    
    // hasStaticBindings declares whether the pod contains one or more StaticBinding. 
	// If not, vloumeBinding will skip score extension point.
	hasStaticBindings bool
}

Then we can easily check here:

	if state.hasStaticBindings {
		return nil
	}
	return framework.NewStatus(framework.Skip)

Copy link
Member

Choose a reason for hiding this comment

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

I think so, you can get the boolean in Filter.

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

/approve
Leaving LGTM to @sanposhiho

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 7, 2023
Copy link
Member
@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

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

LGTM label has been added.

Git tree hash: 9f3dd5353c114d0e1883a71b1e199b02a2ce1d04

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor, AxeZhan, sanposhiho

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

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. area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API 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. sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants
0