Skip to content

Specify protocol in LocalCluster - #2489

Merged
mrocklin merged 10 commits into
dask:masterfrom
mrocklin:specify-protocol
Apr 2, 2019
Merged

mrocklin merged 10 commits into
dask:masterfrom
mrocklin:specify-protocol

Conversation

@mrocklin

Copy link
Copy Markdown
Member

@TomAugspurger TomAugspurger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks.

Just for discussion, would an alternative be to specify scheduler_address=<protocol>://<address>:<port>? Is there a reason we split this between three arguments (consistency with other places? Just historical reasons?)

Comment thread distributed/deploy/local.py Outdated
service_kwargs: Dict[str, Dict]
Extra keywords to hand to the running services
security : Security
protocol: str (optiona)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing an "l" in optional.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be like 'tcp' or tcp://?

Edit: I see that either works.

@mrocklin

Copy link
Copy Markdown
Member Author

Just for discussion, would an alternative be to specify scheduler_address=://

:? Is there a reason we split this between three arguments (consistency with other places? Just historical reasons?)

Yeah, it's not ideal. That being said, these aren't entirely overlapping. The question of processes/protocol are somewhat separate (though often correlated). You might want to have in-memory workers with ucx for testing for example. Users generally may not be comfortable specifying address='inproc://...' when they don't want processes. If you want tls you'll need to provide a security object, and won't be able to present this with only an address.

@TomAugspurger

Copy link
Copy Markdown
Member

👍

You might want to have in-memory workers with ucx for testing for example.

yes, that's been quite helpful for me.

@mrocklin

Copy link
Copy Markdown
Member Author

Anyway, if you get a chance to test this out I'd be curious to see if it works in your case.

@TomAugspurger

Copy link
Copy Markdown
Member

Trying it out now. Hitting an issue in the worker creation that's probably a bug on my end.

@TomAugspurger

Copy link
Copy Markdown
Member

I think this will suffice for my UCX work. Right now, I believe I'm not handling "default" / implicit ports correctly, so I'm getting errors like

distributed.core - WARNING - No handler register-worker found in Worker
Traceback (most recent call last):
  File "/home/nfs/an.taugspurger/ucx-dev/distributed/distributed/core.py", line 333, in handle_comm
    handler = self.handlers[op]
KeyError: 'register-worker'

I think the client <-> scheduler comm is created with an address like ucx://10.33.225.160:13337 (with a port) and that seems to go fine.

When the scheduler <-> worker comm is created, the address is like ucx://10.33.225.160 (no port), and I'm failing to handle that case properly. I think that I'm getting my comms crossed, so a worker is receiving messages intended for the scheduler. Looking into it today.

TomAugspurger pushed a commit to TomAugspurger/distributed that referenced this pull request Jan 29, 2019
@quasiben

Copy link
Copy Markdown
Member

I just tested this and I'm getting:

AttributeError: 'UCXListener' object has no attribute 'bound_address'

With the following:

cluster = LocalCluster(protocol='ucx', ip='XX.XX.XXX.XXX', scheduler_port=13337, n_workers=2)

I think the nanny workers are trying to start up on ucx as well.

cc @jakirkham

@mrocklin

Copy link
Copy Markdown
Member Author

Can I ask for the full traceback?

Also, what happens if you don't specify an ip and scheduler_port?

@TomAugspurger

TomAugspurger commented Mar 28, 2019 via email

Copy link
Copy Markdown
Member

@quasiben

Copy link
Copy Markdown
Member

Same error as if you don't define ip and scheduler port:

/home/nfs/bzaitlen/GitRepos/distributed/distributed/bokeh/core.py:57: UserWarning: 
Port 8787 is already in use. 
Perhaps you already have a cluster running?
Hosting the diagnostics dashboard on a random port instead.
  warnings.warn('\n' + msg)
tornado.application - ERROR - Multiple exceptions in yield list
Traceback (most recent call last):
  File "/home/nfs/bzaitlen/miniconda3/envs/cudf-dev/lib/python3.7/site-packages/tornado/gen.py", line 883, in callback
    result_list.append(f.result())
  File "/home/nfs/bzaitlen/miniconda3/envs/cudf-dev/lib/python3.7/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/home/nfs/bzaitlen/GitRepos/distributed/distributed/deploy/local.py", line 251, in _start_worker
    yield w._start()
  File "/home/nfs/bzaitlen/miniconda3/envs/cudf-dev/lib/python3.7/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/home/nfs/bzaitlen/miniconda3/envs/cudf-dev/lib/python3.7/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/home/nfs/bzaitlen/GitRepos/distributed/distributed/nanny.py", line 158, in _start
    response = yield self.instantiate()
  File "/home/nfs/bzaitlen/miniconda3/envs/cudf-dev/lib/python3.7/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/home/nfs/bzaitlen/miniconda3/envs/cudf-dev/lib/python3.7/site-packages/tornado/gen.py", line 326, in wrapper
    yielded = next(result)
  File "/home/nfs/bzaitlen/GitRepos/distributed/distributed/nanny.py", line 194, in instantiate
    host = self.listener.bound_address[0]
AttributeError: 'UCXListener' object has no attribute 'bound_address'

@quasiben

Copy link
Copy Markdown
Member

on the CLI the worker spins up if you set --no-nanny

@mrocklin
mrocklin merged commit 50dd21f into dask:master Apr 2, 2019
@mrocklin
mrocklin deleted the specify-protocol branch April 2, 2019 16:29
muammar added a commit to muammar/distributed that referenced this pull request Apr 6, 2019
* upstream/master:
  Use ensure_dict instead of dict (dask#2594)
  Specify protocol in LocalCluster (dask#2489)
darindf pushed a commit to darindf/distributed that referenced this pull request Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants