Repository navigation
forward 'ip' to LocalCluster - #107
Conversation
|
I am not an expert in this kind of thing but this seems like a problem related to dask/dask-drmaa#75. It would be great if you could add a test similar to the one in dask/dask-drmaa#77.
Interesting, can I ask whether there is a good reason for this?
Not sure ... maybe @mrocklin has some inputs on this. |
guillaumeeb
left a comment
There was a problem hiding this comment.
Those changes seem fine to me, thanks. I was searching a way to do that with less 'if' but I'm still not pythonic enough to find one.
I am not an expert in this kind of thing but this seems like a problem related to dask/dask-drmaa#75. It would be great if you could add a test similar to the one in dask/dask-drmaa#77.
Interestingly, the solution here is different, we do not default to ip='', but look for the hostname, both solutions are ok though.
Personally, I would prefer to not force the interface of the workers (in that case I could use 'interface' to set the interface of only the scheduler) but I assume you have a reason for doing so :)
Not sure ... maybe @mrocklin has some inputs on this.
See http://dask.pydata.org/en/latest/setup/hpc.html#high-performance-network, usualy in an HPC cluster, all the nodes have the same interfaces, and especially infiniband ones. The scheduler and workers need to use identical interface to communicate, as you found out.
Yes, that looks similar. I will look trough how you are doing unit tests and then add one to verify the IP address.
There is no (good) reason for that. I wish the interfaces across all nodes had the same name. It is a cluster from a university research lab.
This solution would have less if's and it doesn't change the input arguments: # Find the IP address and (if requested) set interface for workers
localhost_kwargs = {}
if interface:
localhost_kwargs['ip'] = get_ip_interface(interface)
extra += ' --interface %s ' % interface
else:
localhost_kwargs['ip'] = socket.gethostname()
localhost_kwargs.update(kwargs)
self.local_cluster = LocalCluster(n_workers=0, **localhost_kwargs) |
I was thinking on something like this, but with a temporary variable, not a dict: localcluster_ip = socket.gethostname()
if interface:
localcluster_ip = get_ip_interface(interface)
extra += ' --interface %s ' % interface
if 'ip' not in kwargs:
kwargs['ip'] = localcluster_ip But really, no strong concern about this, I let you chose, we can keep it as it is. |
|
@lesteve about the test case, there are some differences compared to dask/dask-drmaa#77
I don't think that using a SLURMCluster (wrong component) with a probably not-existing IP address is a good way to test this PR. Do you have any suggestions? I will change the PR to reflect @guillaumeeb suggestion - it looks much nicer :) |
|
I'm adding basic tests here, to merge if everything is OK so that we can move on to solve #90. |
|
Getting this in quiclky to propose another PR that solves #90 and allows #111. Thanks @twoertwein. |
JobQueueCluster forwards any additional keyword arguments to LocalCluster. However, it fails to forward 'ip' to the LocalCluster as it is explicitly set. This commit allows the user to forward 'ip' to the LocalCluster.
Context:
My cluster head has two network interfaces (one facing only the workers and one facing the internet). I want the scheduler to only listen on the worker facing interface. The 'interface' argument would be well suited for this task but JobQueueCluster also forwards this interface to the workers. Unfortunately, not all my cluster nodes have the same interface names. Therefore, I have to use 'ip' to force the scheduler to listen on the worker facing interface (without forcing the workers itself to use a (potentially non-existing) interface).
Personally, I would prefer to not force the interface of the workers (in that case I could use 'interface' to set the interface of only the scheduler) but I assume you have a reason for doing so :)