Skip to content
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

Plugins (worker and scheduler) do not work correctly with SSHCluster #8584

Open
TabeaW opened this issue Mar 15, 2024 · 0 comments
Open

Plugins (worker and scheduler) do not work correctly with SSHCluster #8584

TabeaW opened this issue Mar 15, 2024 · 0 comments

Comments

@TabeaW
Copy link

TabeaW commented Mar 15, 2024

Describe the issue:
If I use the WorkerPlugin (similar for SchedulerPlugin) in a SSHCluster only the __init__ is executed, but neither the setup nor the teardown methods. The same Plugin with a LocalCluster works nicely.
In the example only "HO" is printed for the SSHCluster. The LocalCluster prints "HO, HI, HI, ready to teardown, ready to teardown". Is there another way to use plugins with SSHCluster?

Minimal Complete Verifiable Example:

from distributed import SSHCluster,LocalCluster,WorkerPlugin,Client
from distributed import print
cluster=SSHCluster(hosts=["localhost","localhost"],connect_options={"known_hosts": None},worker_options={"n_workers":2,"nthreads":1},scheduler_options={"dashboard":8787})
#cluster=LocalCluster(host="localhost",scheduler_port=58444,n_workers=2, threads_per_worker=1) 
client=Client(cluster)

class StandardWorker(WorkerPlugin):
    def __init__(self) -> None:
        print("HO")
    def setup(self, worker):
        print("HI")
  
    def teardown(self, worker):
        print("ready to teardown")
    
        return super().teardown(worker)

client.register_plugin(StandardWorker())
cluster.close()

Environment:

  • Dask version: 2024.3.0
  • Python version: 3.10.13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant