Skip to content

Scheduller add_plugin doesn't call start on the plug in #5646

@davzucky

Description

@davzucky

What happened:
When calling on the Scheduller the method add_plugin the method start on the SchedullerPlugin is not called.

What you expected to happen:
I expect the method start to be called. This is what is happening to the plugins set from the __init___ method of the scheduler. However I'm not sure this is expected behavior or bug. Please confirm why they are this discrepancy, as I would expect the scheduler to call the start method on all the plugins.

Minimal Complete Verifiable Example:

@pytest.mark.asyncio
async def test_k8s_plugin_initialize_cluster(k8s_cluster, docker_image):
    scheduler = Scheduler()
    await scheduler.start()

    pod_spec = make_pod_spec(
            docker_image,
            extra_container_config={
                "imagePullPolicy": "IfNotPresent",
                "securityContext": {"runAsUser": 0},
            },
        )
    plugin = KubernetesAutoScaler(pod_spec, 0, 4)
    scheduler.add_plugin(plugin)
    # await plugin.start(scheduler=scheduler)

    assert plugin._cluster is not None
    assert plugin._cluster.status ==Status.running

Anything else we need to know?:
This is for a new plugin I'm writing for kubernetes dask/dask-kubernetes#377

Environment:

  • Dask version: Latest
  • Python version: All
  • Operating System: Na
  • Install method (conda, pip, source): Implementing new test

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