You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Simplified Multi-point plugin configuration for scheduler #2891
One-line enhancement description (can be used as a release note): Scheduler profiles now offer a single field which plugin developers can implement to register multiple framework extension points in a simplified config.
It sounds like there is general consensus on @ahg-g's original proposal of a simplified single extension point, with a weight field for any score plugins.
To implement this, I think the best approach is:
Define a new extension point MultiPoint in Plugins (prefer a name besides all, because this may not register all points, more on that)
typeMultiPointPlugininterface {
Plugin// Register allows a plugin to automatically register itself in // multiple extension points, as defined by the pluginRegister(fw*framework.Framework)
}
using a new public function RegisterMultiPoint() in framework.go, which duplicates the behavior from the original function registration in NewFramework():
func (f*frameworkImpl) RegisterMultiPoint(eps*config.Plugins) error {
forname, e:=f.getExtensionPoints(eps) {
// by passing `eps` as set by the plugin in its Register() func,// the map returned from `f.getExtensionPoints(eps)` will only have the// function's defined config profiles in each *e.plugins// So only those will be appended to the existing slicePtrsiferr:=updatePluginList(e.slicePtr, *e.plugins, f.pluginsMap); err!=nil {
returnerr
}
}
}
This duplication allows the existing manual plugin config behavior to be preserved, while also taking advantage of the error checking already available with these functions.
The Register() extension point puts flexibility in the developer's hands to define several Multi-Point registration approaches. For example, a plugin which provides Filter and Score extensions could add an option in its instantiation to only enable one or the other:
For MultiPoint disabling of default plugins, it looks like we need to address that in mergePlugins() in pkg/scheduler/apis/config/v1beta2/default_plugins.go. We can pass the list of Disabled multipoint plugins to each call to mergePluginSet() as the starting set of disabled plugins. Should any default plugins match one that has been globally disabled, they will be removed then.
// mergePlugins merges the custom set into the given default one, handling disabled sets.funcmergePlugins(defaultPlugins, customPlugins*v1beta2.Plugins) *v1beta2.Plugins {
ifcustomPlugins==nil {
returndefaultPlugins
}
multiPointDisabled:=make([]string, len(customPlugins.MultiPoint.Disabled))
forp:=rangecustomPlugins.MultiPoint.Disabled {
multiPointDisabled=append(multiPointDisabled, p.Name)
}
defaultPlugins.QueueSort=mergePluginSet(defaultPlugins.QueueSort, customPlugins.QueueSort, multiPointDisabled)
defaultPlugins.PreFilter=mergePluginSet(defaultPlugins.PreFilter, customPlugins.PreFilter, multiPointDisabled)
defaultPlugins.Filter=mergePluginSet(defaultPlugins.Filter, customPlugins.Filter, multiPointDisabled)
defaultPlugins.PostFilter=mergePluginSet(defaultPlugins.PostFilter, customPlugins.PostFilter, multiPointDisabled)
defaultPlugins.PreScore=mergePluginSet(defaultPlugins.PreScore, customPlugins.PreScore, multiPointDisabled)
defaultPlugins.Score=mergePluginSet(defaultPlugins.Score, customPlugins.Score, multiPointDisabled)
defaultPlugins.Reserve=mergePluginSet(defaultPlugins.Reserve, customPlugins.Reserve, multiPointDisabled)
defaultPlugins.Permit=mergePluginSet(defaultPlugins.Permit, customPlugins.Permit, multiPointDisabled)
defaultPlugins.PreBind=mergePluginSet(defaultPlugins.PreBind, customPlugins.PreBind, multiPointDisabled)
defaultPlugins.Bind=mergePluginSet(defaultPlugins.Bind, customPlugins.Bind, multiPointDisabled)
defaultPlugins.PostBind=mergePluginSet(defaultPlugins.PostBind, customPlugins.PostBind, multiPointDisabled)
returndefaultPlugins
}
funcmergePluginSet(defaultPluginSet, customPluginSet v1beta2.PluginSet, multiDisabled []string) v1beta2.PluginSet {
disabledPlugins:=sets.NewString()
disabledPlugins.Insert(multiDisabled...) // this is the only change here...
}
@ahg-g@alculquicondor@Huang-Wei please let me know what you think of this proposal. I'm pretty fond of the shared benefits between administrators (ease-of-use) and developers (control over implementation/options for multiple configs/etc), and I think this accomplishes all of that with a set of minimally invasive changes.
What you are proposing is that we support single and multi extension point configurations, right? I don't think the extra complexity is worth the maintenance cost. There's also the problem of extra hierarchy in the YAML:
But the reality is that we would have to support both methods for a while (because we have to support v1beta1 and v1beta2). So what would happen is that the internal types (in pkg/scheduler/config) would look somewhat like what you propose. But v1beta3 profiles would only have a single plugins PluginSet field. Then we do manual conversion into the internal type.
The good thing is that we can be sure that when instantiating the framework we only need to process multiPoint or individual extension points, but not both.
In general, there should be no need for a Register method, as we can simply iterate over all the interfaces and register the ones that the plugin implements. Maybe we can offer this as a default implementation (like we have the default NormalizeScore). Then the plugins that want to offer the option to disable specific extension points can implement their own registration.
What you are proposing is that we support single and multi extension point configurations, right? I don't think the extra complexity is worth the maintenance cost
I think both methods should always be supported. imo, this change is not very complex.
Maintaining individual config options is important for development and debugging. Also given that the internal representations will remain the same no matter what we do, I don't see the benefit to removing the current config.
There's also the problem of extra hierarchy in the YAML
Isn't the hierarchy at the same level as all the other extension points? This doesn't change the yaml in that sense
The good thing is that we can be sure that when instantiating the framework we only need to process multiPoint or individual extension points, but not both.
I think we should still process both, say a user wants to disable all scoring plugins. With the current config, they can disable: "*". But if we only have multi-point, there are new requirements:
Each plugin needs to implement disabled-scoring options
Each of those now needs to be manually configured to disable their scoring
number 1 we can take the time to implement for in-tree, but there's no guarantee for 3rd party plugins. But for number 2, we have now actually added complexity to the user's config.
In general, there should be no need for a Register method, as we can simply iterate over all the interfaces and register the ones that the plugin implements
Also, giving a specific extension point makes this feature more "opt-in" for developers, and provides a concise location to control different configurations (like you mentioned in kubernetes/kubernetes#102303 (comment)). Also consider the possibility that some plugins may wish to define a set of disjoint configurations.
Hello @damemi, 1.23 Enhancements shadow here. Just checking in as we approach enhancements freeze on Thursday 09/09. Here's where this enhancement currently stands:
KEP file using the latest template has been merged into the k/enhancements repo.
KEP status is marked as implementable
KEP has a test plan section filled out.
KEP has up to date gradution criteria.
KEP has a production readiness review that has been completed and merged into k/enhancements.
For this enhancement, it looks like we need the following to be updated in the PR #2899:
KEP status marked as implementable.
A completed PRR for the beta release merged into k/enhancements (since I see in the latest comments that KEP is directly going into beta)
And finally the KEP merged into k/enhancements by the enhancements freeze
Also, can you update this issue's description when you get a chance to make it easier for us to track. (i.e. correct beta release target)
Thanks so much @damemi. Could you please link the k/k PR(s), and K/website docs PR links in the issue description. It would help track all the PR(s) properly.
Just want to be very sure that I don't miss any PRs. Thank you once again! 🙂
I think we can declare this done and will graduate to GA with component config.
/close
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.
Activity
damemi commentedon Aug 23, 2021
/sig scheduling
damemi commentedon Aug 23, 2021
/assign
To continue discussion from kubernetes/kubernetes#102303:
It sounds like there is general consensus on @ahg-g's original proposal of a simplified single extension point, with a
weightfield for any score plugins.To implement this, I think the best approach is:
MultiPointinPlugins(prefer a name besidesall, because this may not register all points, more on that)MultiPointPlugininterface inpkg/scheduler/framework/interface.go:frameworkImplto have amultiPointPluginsfield and store thepluginsMapgenerated inNewFramework()getExtensionPoints()to return a theMultiPointextensions as well, so that the factory functions for these get registeredNewFramework()immediately after the current call toupdatePluginList()to handle the new extension point (and pass the current KubeSchedulerProfile to the plugin):Plugins can then implement
Register()like so:using a new public function
RegisterMultiPoint()inframework.go, which duplicates the behavior from the original function registration inNewFramework():This duplication allows the existing manual plugin config behavior to be preserved, while also taking advantage of the error checking already available with these functions.
The
Register()extension point puts flexibility in the developer's hands to define several Multi-Point registration approaches. For example, a plugin which provides Filter and Score extensions could add an option in its instantiation to only enable one or the other:For MultiPoint disabling of default plugins, it looks like we need to address that in
mergePlugins()inpkg/scheduler/apis/config/v1beta2/default_plugins.go. We can pass the list of Disabled multipoint plugins to each call tomergePluginSet()as the starting set of disabled plugins. Should any default plugins match one that has been globally disabled, they will be removed then.@ahg-g @alculquicondor @Huang-Wei please let me know what you think of this proposal. I'm pretty fond of the shared benefits between administrators (ease-of-use) and developers (control over implementation/options for multiple configs/etc), and I think this accomplishes all of that with a set of minimally invasive changes.
yuzhiquan commentedon Aug 24, 2021
/cc
alculquicondor commentedon Aug 24, 2021
What you are proposing is that we support single and multi extension point configurations, right? I don't think the extra complexity is worth the maintenance cost. There's also the problem of extra hierarchy in the YAML:
But the reality is that we would have to support both methods for a while (because we have to support v1beta1 and v1beta2). So what would happen is that the internal types (in
pkg/scheduler/config) would look somewhat like what you propose. Butv1beta3profiles would only have a singleplugins PluginSetfield. Then we do manual conversion into the internal type.The good thing is that we can be sure that when instantiating the framework we only need to process
multiPointor individual extension points, but not both.In general, there should be no need for a
Registermethod, as we can simply iterate over all the interfaces and register the ones that the plugin implements. Maybe we can offer this as a default implementation (like we have the defaultNormalizeScore). Then the plugins that want to offer the option to disable specific extension points can implement their own registration.damemi commentedon Aug 24, 2021
I think both methods should always be supported. imo, this change is not very complex.
Maintaining individual config options is important for development and debugging. Also given that the internal representations will remain the same no matter what we do, I don't see the benefit to removing the current config.
Isn't the hierarchy at the same level as all the other extension points? This doesn't change the yaml in that sense
I think we should still process both, say a user wants to disable all scoring plugins. With the current config, they can
disable: "*". But if we only have multi-point, there are new requirements:number 1 we can take the time to implement for in-tree, but there's no guarantee for 3rd party plugins. But for number 2, we have now actually added complexity to the user's config.
I considered this, but the main problem with this approach is you can't differentiate between when to report an error that the plugin does not implement the matching interface, and when to just ignore it. We should maintain this error reporting.
Also, giving a specific extension point makes this feature more "opt-in" for developers, and provides a concise location to control different configurations (like you mentioned in kubernetes/kubernetes#102303 (comment)). Also consider the possibility that some plugins may wish to define a set of disjoint configurations.
damemi commentedon Aug 25, 2021
I took my proposal from above and put it into a WIP PR for this enhancement: #2899
I also tried to include some of the alternatives @alculquicondor mentioned, and I'm happy to discuss this further at tomorrow's sig meeting
ahg-g commentedon Sep 2, 2021
This is going directly into beta under v1beta3 scheduler component config api.
Priyankasaggu11929 commentedon Sep 3, 2021
/milestone v1.23
Priyankasaggu11929 commentedon Sep 3, 2021
Hello @damemi, 1.23 Enhancements shadow here. Just checking in as we approach enhancements freeze on Thursday 09/09. Here's where this enhancement currently stands:
For this enhancement, it looks like we need the following to be updated in the PR #2899:
Also, can you update this issue's description when you get a chance to make it easier for us to track. (i.e. correct beta release target)
Thanks!
6 remaining items
damemi commentedon Nov 8, 2021
@Priyankasaggu11929 thanks for the reminder, will open one soon
damemi commentedon Nov 11, 2021
Docs PR opened at kubernetes/website#30442
Priyankasaggu11929 commentedon Nov 12, 2021
Thanks so much @damemi. Could you please link the k/k PR(s), and K/website docs PR links in the issue description. It would help track all the PR(s) properly.
Just want to be very sure that I don't miss any PRs. Thank you once again! 🙂
damemi commentedon Nov 30, 2021
All PRs tracked in this issue for Alpha have merged 🎉
alculquicondor commentedon Nov 30, 2021
Shouldn't it say beta? We released a new beta API and there is no feature gate
damemi commentedon Nov 30, 2021
@alculquicondor ah yeah, that's just the PR description. the kep has it right: https://github.com/kubernetes/enhancements/pull/2899/files#diff-1c9b927fd69bae226096557491215d58b9d5eac51fc17a7f746035b38957d802R2
alculquicondor commentedon Dec 1, 2021
Thanks for updating
k8s-triage-robot commentedon Apr 9, 2022
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/staleis appliedlifecycle/stalewas applied,lifecycle/rottenis appliedlifecycle/rottenwas applied, the issue is closedYou can:
/remove-lifecycle stale/lifecycle rotten/closePlease send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
ahg-g commentedon Apr 9, 2022
I think we can declare this done and will graduate to GA with component config.
/close
k8s-ci-robot commentedon Apr 9, 2022
@ahg-g: Closing this issue.
Details
In response to this:
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.