Skip to content

Allow global access to dashboard by default #90

Closed

Description

@mrocklin

When using interfaces like infiniband it's often the case that one can't get the dashboard to show up. This is because the bokeh server is expecting to be called by its IP address on the infiniband network, not the normal network.

One solution to this would be to provide services={('bokeh', ('', 8787)): BokehScheduler} to LocalCluster.

Activity

  1. lesteve commented on Jul 11, 2018

    @lesteve
    Member

    Interesting, I do seem to remember to have bumped into this problem ...

  2. lesteve commented on Jul 11, 2018

    @lesteve
    Member

    Hmmm I think I got something like you suggested working, but the _repr_html_ is not showing the right port for some reason ...

  3. lesteve commented on Jul 11, 2018

    @lesteve
    Member

    Just to put a bit more context, here is my diff (I hard-code the BokehScheduler port to 12345):

    diff --git a/dask_jobqueue/core.py b/dask_jobqueue/core.py
    index ab4b602..9bc467e 100644
    --- a/dask_jobqueue/core.py
    +++ b/dask_jobqueue/core.py
    @@ -9,6 +9,7 @@ import warnings
     import dask
     import docrep
     from distributed import LocalCluster
    +from distributed.bokeh.scheduler import BokehScheduler
     from distributed.deploy import Cluster
     from distributed.utils import (get_ip_interface, ignoring, parse_bytes, tmpfile,
                                    format_bytes)
    @@ -153,7 +154,8 @@ class JobQueueCluster(Cluster):
             else:
                 host = socket.gethostname()
     
    -        self.local_cluster = LocalCluster(n_workers=0, ip=host, **kwargs)
    +        self.local_cluster = LocalCluster(n_workers=0, ip=host,
    +                                          services={('bokeh', ('', 12345)): BokehScheduler}, *kwargs)
     
             # Keep information on process, cores, and memory, for use in subclasses
             self.worker_memory = parse_bytes(memory)

    I run this ssh proxy command (redirecting the 12345 port to 9898 locally):

    ssh -N lesteve@sequoia -L 9898:sequoia:12345 # dashboard
    

    and then I can access the dashboard at http://localhost:9898/status.

    The widget for client.cluster shows the dashboard at 8787 though:

    Dashboard: http://10.149.255.254:8787/status
    

    I made sure I had the latest release of dask (0.18.1) and distributed (1.22).

  4. mrocklin commented on Jul 12, 2018

    @mrocklin
    MemberAuthor
  5. guillaumeeb commented on Jul 15, 2018

    @guillaumeeb
    Member

    Don't you think this modification should be done upstream in distributed? Always bind bokeh UI to all network address by default?

  6. mrocklin commented on Jul 15, 2018

    @mrocklin
    MemberAuthor
  7. guillaumeeb commented on Aug 1, 2018

    @guillaumeeb
    Member

    and would be confused if someone else connected to our machine and wanted to see our dashboard.

    Would we? Would that be happening a lot?

    The fact that our cluster objects use LocalCluster is a bit of a historical artifact. Ideally they would create a scheduler manually with all of their own options.

    Should we do that? Or maybe implement some more generic superclass to LocalCluster upstream, that we can reuse here?

  8. mrocklin commented on Aug 1, 2018

    @mrocklin
    MemberAuthor
  9. guillaumeeb commented on Aug 7, 2018

    @guillaumeeb
    Member

    This feature is important for being able to use Dask easily with infiniband, and to make sure it works with nbserverproxy.

    I observed the same problem as @lesteve trying its diff, the other way around though (specifing 8787, having some random port displayed, but dashboard up on 8787), but I assume it is the same issue.

    Current solution is not really elegant though, it is more of a hack. Ideally, I would prefer to have at least a kwargs in LocalCluster, so we can call something like:

    self.local_cluster = LocalCluster(n_workers=0, ip=host, dashboard_bind_ip='0.0.0.0', **kwargs)

    What do you think about that?

  10. guillaumeeb commented on Aug 7, 2018

    @guillaumeeb
    Member

    Another solution, that does not need modification to LocalCluster, is to just use ip='' parameter when launching LocalCluster. From what I understant looking at dask distributed sources, it will bind all services (scheduler too), to listen to all interfaces.

    Do someone believe that this is a problem ?

    With #107, we can easily do this:

    cluster = PBSCluster( ... , interface='ib0', ip='')

    But we could also make it by default directly in core.py:

            # 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'] = ''

    Or just drop #107, because binding on '' by default should solve it...

    Any thoughts?

  11. mrocklin commented on Aug 7, 2018

    @mrocklin
    MemberAuthor
  12. guillaumeeb commented on Aug 7, 2018

    @guillaumeeb
    Member

    So @mrocklin, once #107 is in (I believe we should keep it, to give the choice to the user to not bind on all interfaces if he wants), is this okay for you if I propose another PR wich sets LocalCluster ip = '' by default ?

    This will probably remove some lines from the one added in #107, as this default will get set no matter if interface is provided or not. I prefer to do this in another PR to keep things clear.

  13. mrocklin commented on Aug 7, 2018

    @mrocklin
    MemberAuthor
  14. guillaumeeb commented on Aug 7, 2018

    @guillaumeeb
    Member

    I agree with that, but I'm not sure that my proposal was clear enough. I just want to do the modifications in dask-jobqueue core.py file, when initializing LocalCluster here. Replace the defaults socket.gethostname() and get_ip_interface(interface) by ''.

  15. mrocklin commented on Aug 7, 2018

    @mrocklin
    MemberAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions