-
Notifications
You must be signed in to change notification settings - Fork 91
feat: Load the SchedulerConfig from a configuration file/text and make it easier to add plugins #881
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Shmuel Kallner <[email protected]>
Signed-off-by: Shmuel Kallner <[email protected]>
Signed-off-by: Shmuel Kallner <[email protected]>
Signed-off-by: Shmuel Kallner <[email protected]>
Signed-off-by: Shmuel Kallner <[email protected]>
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: shmuelk The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @shmuelk. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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-sigs/prow repository. |
…lugin.plugin_name Signed-off-by: Shmuel Kallner <[email protected]>
/ok-to-test |
@shmuelk: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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-sigs/prow repository. I understand the commands that are listed here. |
"sigs.k8s.io/yaml" | ||
) | ||
|
||
type Config struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend to treat this similar to CRDs so that we version it, and also place this under https://github.com/kubernetes-sigs/gateway-api-inference-extension/tree/main/api/config
See examples:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this need to be a generic config api for epp, we need to encapsulate the plugins configuration in its own struct so we can accommodate other parameters (most flags should move here basically)
} | ||
|
||
// Load config either from supplied text or from a file | ||
func LoadConfig(configText []byte, fileName string, log logr.Logger) (*Config, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defining it similar to a CRD would allow us to use the decoder pkg from k8s, see this example: https://github.com/kubernetes-sigs/jobset/blob/a7a669590b3483715c193e0af53dbb5f4f066b03/pkg/config/config.go#L19
PR needs rebase. 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-sigs/prow repository. |
This PR adds the ability to:
This PR implements issue #839.
This PR adds a configuration of the form:
The
plugin_definitions
section enables a plugin instance to be used in multipleSchedulerProfile
s, its use is optional. It is an array and the fields of each element are:name
: provides a name by which the plugin instance can be referenced in theprofile_picker
andscheduler_profile
sections.plugin_name
: names the plugin to instantiate.parameters
: passed unparsed to the named plugin's factory function when creating the instance.The
profile_picker
section defines theProfilePicker
plugin to be used. Its fields are:reference
: names a plugin instance by the name it was given in theplugin_definitions
section.plugin
: defines, in-line a plugin to instantiated. Theplugin
field has in turn the following sub-fields:plugin_name
: names the plugin to instantiate.parameters
: passed unparsed to the named plugin's factory function when creating the instance.Either the
reference
field or theplugin
field should be specified.The
scheduler_profiles
section defines the set ofSchedulerProfile
s that will be in the createdSchedulerConfig
. It is and array and each element has the following fields:name
: provides a name for theSchedulerProfile
plugins
: The array ofPlugin
s to be associated with thisSchedulerProfile
. Each element in this array has the following fields:reference
: names a plugin instance by the name it was given in theplugin_definitions
section.plugin
: defines, in-line a plugin to instantiated. Theplugin
field has in turn the following sub-fields:plugin_name
: names the plugin to instantiate.parameters
: passed unparsed to the named plugin's factory function when creating the instance.weight
: the weight to be used if the plugin is aScorer
Either the
reference
field or theplugin
field should be specified.To enable the instantiation of plugins from the configuration file/text a singleton/static plugin registry was added. Each plugin was modified to add an
init()
function and a factory function. Theinit()
function simply registers the plugin's factory function in the registry.