Skip to content

Add Client.register_scheduler_plugin #4745

@jrbourbeau

Description

@jrbourbeau

Today scheduler plugins are added to a cluster by calling the Scheduler.add_plugin method. I often see plugins added at scheduler startup through a preload script.

However, it's also useful to be able to add a scheduler plugin to an existing, already running scheduler. In these cases one often doesn't have direct access to the Scheduler instance and ends up calling client.run_on_scheduler to add their plugin:

def register_plugin(plugin):
    await plugin.start()
    dask_scheduler.add_plugin(plugin)

client.run_on_scheduler(register_plugin)

This works, but is a little awkward. Additionally, some users might not be aware that client.run_on_scheduler exists.

It would be nice if we had a client.register_scheduler_plugin, which was similar to our existing client.register_worker_plugin, to allow users to register their own scheduler plugins in a more straightforward way.

cc @douglasdavis who may be interested in adding a client.register_scheduler_plugin method

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions