Repository navigation
Allow setting the ip of DRMAACluster, fixes #75 - #77
Conversation
kbruegge
left a comment
There was a problem hiding this comment.
does the IP string also support specifying the port?
|
No, it's just the ip. The cluster as several ports, you can set them using the kwargs described here: For our usual usecase, setting |
|
Is there a way to test this? Minimal test seems to pass an ip to |
I tested it on our Torque cluster, without it it does not work at all, because the wrong ip address is taken and workers cannot reach the scheduler. With this option, everything works fine.
Actually, isses are closed by "fixes #" in the commit message. I included this. As the PR title lands in the Merge commit message, this also works indirectly. |
|
I use this script: from dask_drmaa import DRMAACluster
from dask.distributed import Client, as_completed
import time
import pandas as pd
import numpy as np
def do_work(i):
df = pd.DataFrame()
df['x'] = np.random.normal(size=1000)
df['y'] = np.random.normal(size=1000)
return df
cluster = DRMAACluster(
ip='10.141.1.3',
scheduler_port=0,
diagnostics_port=None,
template={'nativeSpecification': '-l walltime=03:59:59,vmem=6G'}
)
client = Client(cluster)
cluster.start_workers(2)
while not client.ncores():
print('Waiting for workers to connect')
time.sleep(5)
futures = client.map(do_work, range(100))
with pd.HDFStore('test.hdf5', mode='w') as hdf:
for i, result in enumerate(as_completed(futures), start=1):
print(f'Job #{i} of 100 done')
hdf.append('events', client.gather(result))
client.close()
cluster.close()the |
| self.hostname = hostname or socket.gethostname() | ||
| logger.info("Start local scheduler at %s", self.hostname) | ||
| self.local_cluster = LocalCluster(n_workers=0, ip='', **kwargs) | ||
| self.local_cluster = LocalCluster(n_workers=0, ip=ip, **kwargs) |
There was a problem hiding this comment.
Another solution to this would be to delete the keyword argument and depend on **kwargs to pass things through.
Also, in production I might recommend using the interface= keyword rather than ip=. See http://dask.pydata.org/en/latest/setup/hpc.html#high-performance-network
There was a problem hiding this comment.
Deleting it would only listen on '127.0.0.1' per default. The '' makes more sense as a default for DRMAACluster imho.
|
OK
…On Thu, Apr 12, 2018 at 11:39 AM, Maximilian Nöthe ***@***.*** > wrote:
***@***.**** commented on this pull request.
------------------------------
In dask_drmaa/core.py
<#77 (comment)>:
> @@ -125,7 +129,7 @@ def __init__(self, template=None, cleanup_interval=1000, hostname=None,
"""
self.hostname = hostname or socket.gethostname()
logger.info("Start local scheduler at %s", self.hostname)
- self.local_cluster = LocalCluster(n_workers=0, ip='', **kwargs)
+ self.local_cluster = LocalCluster(n_workers=0, ip=ip, **kwargs)
Deleting it would only listen on '127.0.0.1' per default. The '' makes
more sense as a default for DRMAACluster imho.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#77 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AASszPVr2O8BSdc3ZWCn99s72sf1B5hMks5tn4MxgaJpZM4TOyaC>
.
|
Great that you tested it on your cluster and thanks for your test script! What I had in mind was more is there a way to add a unit test for this fix. This way we make it less likely that this bug reappears inadvertently in the future.
Good point! Not super important at all, but I still prefer the issue number in the PR description, it adds a link to the issue in the PR and a link to the PR in the issue. Also bear in mind that your message can be edited when squash+merging. |
|
Unit Testing this is Kind of hard, as it involves several pieces of non standard hardware/system setup |
|
Maybe you could test that the ip passed at the |
|
Ah, ok. Yes that sounds like a good first step |
|
I added a simple test case for the ip |
173e502 to
b620e02
Compare
Nice, thanks! Note the Travis failure seems identical to #60 and can be ignored. LGTM, I'll wait a bit and merge this one, unless someone complains in the meantime. |
|
Merging, thanks a lot @maxnoe! |
Fixes #75.