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

[migration phase 1] Make scheduler cache, volume binder and listers available when registering default plugins #83694

Merged
merged 1 commit into from
Oct 11, 2019

Conversation

ahg-g
Copy link
Member

@ahg-g ahg-g commented Oct 9, 2019

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind feature

What this PR does / why we need it:

Plumped handlers necessary to instantiate some predicates/priorities. This is necessary during phase 1 of framework migration.

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

NONE

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. 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. 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-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Oct 9, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahg-g

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. 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 Oct 9, 2019
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 9, 2019
)

// DefaultRegistryArgs arguments needed to create default plugin factories.
type DefaultRegistryArgs struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer to name it to RegistryArgs, because when declaring a DefaultRegistryArgs variable does not really give you a default registry args by default.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is args for default registry, not default RegistryArgs, but I see how this can be interpreted the other way, I changed it as you suggested.

time.Duration(options.bindTimeoutSeconds)*time.Second)

if options.frameworkRegistry == nil {
options.frameworkRegistry = frameworkplugins.NewDefaultRegistry(&frameworkplugins.DefaultRegistryArgs{
Copy link
Contributor

Choose a reason for hiding this comment

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

If we create a new function(e.g. NewRegistryArgs), we could call it from cmd/kube-scheduler/app/server.go, then we do not need to disable out-of-tree framework plugins.

Copy link
Member Author

Choose a reason for hiding this comment

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

that will require us to define global variables for the cache and volume binder, which is a pain to deal with. The framework is changing so fast right now there is no point in actually supporting out-of-tree plugins before beta.

Copy link
Contributor

Choose a reason for hiding this comment

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

that will require us to define global variables for the cache and volume binder

I could not get your point why we need to define global variables for them, we could still declare them as local variables and use them as following. Is there any problem?

	schedulerCache := internalcache.New(30*time.Second, stopCh)
	volumeBinder := volumebinder.NewVolumeBinder(client, nodeInformer, pvcInformer, pvInformer, storageClassInformer

The framework is changing so fast right now there is no point in actually supporting out-of-tree plugins before beta.

We are trying this feature, not sure whether others are using it now. Even it is alpha, we could get feedback from users. If it is not a must, I think it might be better to keep it.

Copy link
Member Author

Choose a reason for hiding this comment

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

that will require us to define global variables for the cache and volume binder

I could not get your point why we need to define global variables for them, we could still declare them as local variables and use them as following. Is there any problem?

	schedulerCache := internalcache.New(30*time.Second, stopCh)
	volumeBinder := volumebinder.NewVolumeBinder(client, nodeInformer, pvcInformer, pvInformer, storageClassInformer

schedulerCache and volumeBinder are shared handlers, we can't instantiate them multiple times, they need to be created once.

The framework is changing so fast right now there is no point in actually supporting out-of-tree plugins before beta.

We are trying this feature, not sure whether others are using it now. Even it is alpha, we could get feedback from users. If it is not a must, I think it might be better to keep it.

It is going to be tricky to keep this, and it is very premature to say we support out-of-tree plugins at this stage because we are changing the framework very frequently as we discover its limitation during the migration. If you are testing this feature, I think you can still carry a small patch to enable this back in your dev environment. Is that reasonable?

@ahg-g ahg-g changed the title Disabled out-of-tree framework plugins [migration phase 1] Disabled out-of-tree framework plugins Oct 10, 2019
Comment on lines 162 to 166
if len(registryOptions) != 0 {
return errors.New("out-of-tree framework plugins are not yet supported")
}
Copy link
Member

Choose a reason for hiding this comment

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

Instead of totally disabling it, does a warning giving the limitations sound better? If so, does it resolve @hex108 's concern?

volumeBinder := volumebinder.NewVolumeBinder(client, nodeInformer, pvcInformer, pvInformer, storageClassInformer,
time.Duration(options.bindTimeoutSeconds)*time.Second)

if options.frameworkRegistry == nil {
Copy link
Member

Choose a reason for hiding this comment

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

If external users register something into frameworkRegistry, i.e. it's not nil, IMO it's still possible for the internal scheduler to register the frameworkplugins.RegistryArgs below? Are you concerned with some side effects? If so, we can warn users.

Copy link
Member

@Huang-Wei Huang-Wei Oct 10, 2019

Choose a reason for hiding this comment

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

I mean we can still give a bare frameworkRegistry to end users to register custom things at cmd/.../app.go, and then inject the necessary fields here (to pass to legacy predicates/priorities).

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I know how to do this. We can add an option to scheduler.New to pass a "outOfTreeRegistry", which collects out-of-tree plugins that we append to the default registry, I will send a patch to show you how it looks, thanks for brainstorming.

@ahg-g ahg-g changed the title [migration phase 1] Disabled out-of-tree framework plugins [migration phase 1] Make schedulercache, volume binder available when registering default plugins Oct 10, 2019
@ahg-g ahg-g changed the title [migration phase 1] Make schedulercache, volume binder available when registering default plugins [migration phase 1] Make scheduler cache, volume binder and listers available when registering default plugins Oct 10, 2019
@ahg-g ahg-g force-pushed the ahg-adv-config branch 2 times, most recently from dd314d7 to a8ce4ac Compare October 10, 2019 20:05
@Huang-Wei
Copy link
Member

/lgtm

Thanks, @ahg-g !

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 10, 2019
@Huang-Wei
Copy link
Member

/retest

@hex108
Copy link
Contributor

hex108 commented Oct 11, 2019

It is great!

The release note also needs to be changed. :)

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Oct 11, 2019
@k8s-ci-robot k8s-ci-robot merged commit a5e6ac0 into kubernetes:master Oct 11, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.17 milestone Oct 11, 2019
ohsewon pushed a commit to ohsewon/kubernetes that referenced this pull request Oct 16, 2019
[migration phase 1] Make scheduler cache, volume binder and listers available when registering default plugins
@ahg-g ahg-g deleted the ahg-adv-config branch January 10, 2020 15:38
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. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. 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.

[migration phase 1] Make scheduler cache, volume binder and listers available when registering default plugins
4 participants