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

Add Bind extension point of the scheduling framework #78513

Merged
merged 1 commit into from
Jun 22, 2019

Conversation

chenchun
Copy link
Contributor

What type of PR is this?
/kind feature
/priority important-soon
/sig scheduling

What this PR does / why we need it:
Add Bind extension point of the scheduling framework

Which issue(s) this PR fixes:
Fixes #78006

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Add Bind extension point of the scheduling framework

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. 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. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. 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 May 30, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @chenchun. 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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 30, 2019
@k8s-ci-robot k8s-ci-robot requested review from k82cn and wgliang May 30, 2019 10:30
@k8s-ci-robot k8s-ci-robot added area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels May 30, 2019
@@ -42,6 +42,8 @@ const (
Unschedulable
// Wait is used when a permit plugin finds a pod scheduling should wait.
Wait
// Whether a bind plugin chooses to skip binding
Copy link
Contributor

@draveness draveness May 30, 2019

Choose a reason for hiding this comment

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

Please start comments with Skip ...

pkg/scheduler/scheduler.go Show resolved Hide resolved
@wgliang
Copy link
Contributor

wgliang commented Jun 11, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 11, 2019
@draveness
Copy link
Contributor

/assign @bsalamat

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.

Thanks, @chenchun! Generally LGTM. Only a couple of minor comments.

// RunBindPlugins runs the set of configured bind plugins. A bind plugin may choose
// whether or not to handle the given Pod. If a bind plugin chooses to skip the
// binding, it should return code=4("skip") status. Otherwise, it should return "Error"
// or "Success". If none of the plugins handled binding, RunBindPlugins returns
Copy link
Member

Choose a reason for hiding this comment

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

RunBindPlugins should one day return an error if all bind plugins 'Skip' the pod, but this is fine for now that we want to run the default bind function if none of the bind plugins process the pod. My hope is that the current bind function will one day be a (default) plugin.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we can do it in a following PR.

Copy link
Contributor

@draveness draveness Jun 20, 2019

Choose a reason for hiding this comment

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

I opened an issue #79215 to track this and I could raise a PR after this get merged.

Choose a reason for hiding this comment

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

RunBindPlugins should one day return an error if all bind plugins 'Skip' the pod, but this is fine for now that we want to run the default bind function if none of the bind plugins process the pod. My hope is that the current bind function will one day be a (default) plugin.

This is a great idea

pkg/scheduler/scheduler.go Outdated Show resolved Hide resolved
},
}
// Set reserve and bind config for testing
pluginConfig := []schedulerconfig.PluginConfig{
Copy link
Member

Choose a reason for hiding this comment

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

Not related to this PR, but we should make providing a pluginConfig for plugins optional so that something like this is not necessary if one does not need to pass any args to plugins.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually plugin config can be nil. I opened #80567 to clean up the verbose code.

test/integration/scheduler/framework_test.go Outdated Show resolved Hide resolved
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, @chenchun!

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

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Jun 21, 2019
@chenchun
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit 6efc5a8 into kubernetes:master Jun 22, 2019
@chenchun chenchun deleted the binder branch June 22, 2019 04:19
@@ -599,6 +637,165 @@ func TestUnreservePlugin(t *testing.T) {
}
}

// TestBindPlugin tests invocation of bind plugins.
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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 Bind extension point of the scheduling framework
8 participants