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

Fixes 78001 The implementation of Filter extension for the new framework #78477

Merged
merged 1 commit into from
Jul 22, 2019

Conversation

YoubingLi
Copy link

@YoubingLi YoubingLi commented May 29, 2019

What type of PR is this?

/kind feature

What this PR does / why we need it:

The implementation of Filter extension point

Which issue(s) this PR fixes:

Fixes #78001

Special notes for your reviewer:

/assign @bsalamat
/assign @Huang-Wei

Does this PR introduce a user-facing change?:

no

   Add Filter extension point to the scheduling framework.

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 29, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @YoubingLi. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 area/test sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 29, 2019
@YoubingLi YoubingLi force-pushed the filter branch 3 times, most recently from 139ff34 to ee79c27 Compare June 3, 2019 03:10
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 14, 2019
@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 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note. labels Jun 14, 2019
@YoubingLi
Copy link
Author

YoubingLi commented Jun 14, 2019

@bsalamat

Bobby, I didn't touch the logic of  findNodesThatFit in my PR.

But I think we should add logic to check if the evaluation node is in the input slice nodes. 
Maybe the node has been excluded by Filter plugin.

        nodeName := g.cache.NodeTree().Next()

@bsalamat
Copy link
Member

@bsalamat

Bobby, I didn't touch the logic of  findNodesThatFit in my PR.

But I think we should add logic to check if the evaluation node is in the input slice nodes. 
Maybe the node has been excluded by Filter plugin.

        nodeName := g.cache.NodeTree().Next()

You are right. I think our only viable solution is to let findNodesThatFit call Filter plugins for each node, very similar how it invokes each predicate for each node.

Copy link
Member

@bsalamat bsalamat left a comment

Choose a reason for hiding this comment

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

Looks good. Just a few minor nits in the comments.


for _, p := range f.filterPlugins {
status := p.Filter(pc, pod, nodeInfo)
if !status.IsSuccess() {
Copy link
Member

Choose a reason for hiding this comment

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

+1 to @ahg-g's suggestion. It makes sense to convert all codes other than "Unschedulable" to an Error

@YoubingLi
Copy link
Author

@bsalamat @ahg-g

All comments have been addressed.

@draveness
Copy link
Contributor

/retest

1 similar comment
@YoubingLi
Copy link
Author

/retest

@YoubingLi
Copy link
Author

@bsalamat @ahg-g

Please help review the latest diff.

Copy link
Contributor

@draveness draveness 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 Jul 16, 2019

for _, p := range f.filterPlugins {
status := p.Filter(pc, pod, nodeInfo)
if !status.IsSuccess() {
Copy link
Member

Choose a reason for hiding this comment

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

@YoubingLi this hasn't been addressed yet. I left a comment with the suggestion.

if !status.IsSuccess() {
if status.Code() != Unschedulable {
klog.Errorf("RunFilterPlugins: error while running %s filter plugin for pod %s: %s",
p.Name(), pod.Name, status.Message())
Copy link
Member

Choose a reason for hiding this comment

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

The suggestion in the previous comment is to do something like this:

errMsg := fmt.Sprintf("RunFilterPlugins: error while running %s filter plugin for pod %s: %s",
					p.Name(), pod.Name, status.Message())
klog.Errorf(errMsg)
return NewStatus(Error, errMsg)

Copy link
Author

Choose a reason for hiding this comment

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

It has been addressed in the latest diff

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 17, 2019
@ahg-g
Copy link
Member

ahg-g commented Jul 17, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 17, 2019
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 17, 2019
@draveness
Copy link
Contributor

/retest

Copy link
Contributor

@draveness draveness left a comment

Choose a reason for hiding this comment

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

/lgtm

@YoubingLi
Copy link
Author

@bsalamat

Please take a look the new diff.

Copy link
Member

@bsalamat bsalamat 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

Thanks, @YoubingLi!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bsalamat, YoubingLi

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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 22, 2019
@k8s-ci-robot k8s-ci-robot merged commit f31d786 into kubernetes:master Jul 22, 2019
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/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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. 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/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Filter extension point of the scheduling framework
8 participants