dask / dask/distributed

Scheduller add_plugin doesn't call start on the plug in

Open
#5,646 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.7k
Forks
778
Avg merge
2h 50m
Merged PRs (30d)
3

Description

**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**:

```python

@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 https://github.com/dask/dask-kubernetes/issues/377

**Environment**:

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.