Skip to content

Make it easier to enable/disable plugins without writing code and make it easier to add plugins #839

@shmuelk

Description

@shmuelk

What would you like to be added:

  1. The ability to enable/disable and configure plugins without touching the code. This should be done via a configuration yaml file or configuration yaml text (see how Envoy is configured)

  2. The ability too add new plugins, without modifying existing code in the system.

Why is this needed:

  1. In the existing system one needs to add/modify/remove various environment variables to configure the set of plugins that will be used by the scheduler. Sometimes one needs to change code for these sorts of efforts.

    The use of environment variables is not scalable as one needs to be careful about clashes and for scorers one needs two environment variables. Not to mention environment variables used to configure various plugins.

    A much better way would to use a configuration yaml file or configuration yaml text. The latter is very useful in K8S deployment yaml files, as the configuration can then be on-line without the use of a ConfigMap or something like that.

  2. In the existing system to add a new plugin, in addition to writing the code one needs to modify the existing code that loads the scheduler config.

    A much better way would be to define a plugin registry that will contain a map of plugin name to plugin factory function.. The process would then be as follows:

    1. Every plugin in init() function will invoke the registry's static RegisterPlugin function.

    2. The main code reads in a configuration in which the user defines a set of references to configured plugins and a configuration that uses those plugin references. The purpose of the indirection is to support multiple concurrent scheduler profiles/configuration that share plugin instances if desired.

      The configuration file/text might look something like this:

      plugin_references:
      - name: "my-prefix-scorer"
        plugin: "prefix-cache"
        parameters:
           hash-block-size: 64
           max-prefix-blocks-to-match: 128
           lru-indexer-capacity: 50000
      - name: "my-load-filter"
         plugin: "load-aware-filter"
      
      scheduling_profiles:
      - name: default
         plugin-references:
         - name: "my-load-filter"
         - name: "my-prefix-scorer"
            weight: 20```
      

    I am proposing naming the set of scheduling plugins actually used as a scheduling profile, as that is a term has come up to the best of my knowledge in some of the re-architecting/refactoring work that is under way.

Metadata

Metadata

Assignees

Labels

needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions