Skip to content

Problem accessing the dashboard when the cluster frontend has an internal and an external IP #80

Closed

Description

@lesteve

Funnily enough I helped solve the problem in #71 but I now realise that the dashboard is not accessible in our SGE cluster and the ssh tunneling work-around I proposed does not cut it.

Even more fun, when I use dask-drmaa, I can access the dashboard fine (a ssh tunnel is needed of course).

Here is my current understanding:

  • I run the scheduler on the cluster frontend called sequoia
  • the cluster frontend has a external IP, which is used for example when I ssh from my local machine to the frontend:
# from my local machine
$ ping sequoia
PING sequoia.paris.inria.fr (128.93.90.8) 56(84) bytes of data.
  • the cluster frontend has an internal IP that is used when I am on the cluster:
# from sequoia i.e. the cluster frontend
$ ping sequoia
PING sequoia.cm.cluster (10.141.255.254) 56(84) bytes of data.
  • the scheduler is using the internal IP address which means that even with ssh tunneling, the dashboard is not going to be reachable. Here is an excerpt of client._repr_html_() for completeness:
Scheduler: </b>tcp://10.141.255.254:57591\n
Dashboard: </b><a href=\'http://10.141.255.254:45961/status\' target=\'_blank\'>http://10.141.255.254:45961/status</a>

In some way it feels like some kind of variation of dask/dask-drmaa#75:

  • in my case (using dask-jobqueue), the internal IP is used by the scheduler so the dashboard is not accessible from the outside.
  • in their case (using dask-drmaa), the external IP was used by the scheduler but this was a problem because the workers can only access the internal IP of the frontend. cc @maxnoe in case I misunderstood something. In particular I would be very interested to see client._repr_html_() on their setup.

Inputs more than welcome:

  • is my cluster setup quite unusual? A bit of a simplification, but changing our cluster setup is not a very likely solution.
  • do we need to have the scheduler use the internal IP and the dashboard the external IP (if that is even is)?
  • other things I may have missed ?

I'd be more than happy to provide more info if that can help!

Activity

  1. guillaumeeb commented on Jun 27, 2018

    @guillaumeeb
    Member

    the scheduler is using the internal IP address which means that even with ssh tunneling, the dashboard is not going to be reachable

    I don't quite understand why, from what I understand, the important point is that the IP you tunnel to is visible from the server you ssh on, note the one you ssh from. Could you paste here your ssh tunneling command?

  2. lesteve commented on Jun 27, 2018

    @lesteve
    MemberAuthor

    Thanks for your answer!

    I think the ssh tunnel command is unlikely to be flat out wrong (I can access the dashboard with dask-drmaa after all), but there may be subleties that I am missing.

    Here is the ssh tunneling command that I use from my local machine:

    # from my local machine
    ssh -fN lesteve@sequoia -L 51597:localhost:51597

    when I open localhost:51597/status in a browser
    I get something like this in the browser:

    The connection was reset
    
    The connection to the server was reset while the page was loading.
    

    and something like this in the terminal I ran the ssh tunnel command:

    channel 2: open failed: connect failed: Connection refused
    channel 2: open failed: connect failed: Connection refused
    channel 2: open failed: connect failed: Connection refused
    channel 2: open failed: connect failed: Connection refused
    channel 2: open failed: connect failed: Connection refused
    channel 2: open failed: connect failed: Connection refused
    channel 2: open failed: connect failed: Connection refused
    channel 2: open failed: connect failed: Connection refused
    channel 2: open failed: connect failed: Connection refused
    channel 2: open failed: connect failed: Connection refused
    channel 2: open failed: connect failed: Connection refused
    

    If on the other hand I try to follow our doc

    ssh -fN your-login@scheduler-ip-address -L port-number:localhost:port-number
    

    then scheduler-ip-address is the internal IP address of the scheduler and I can not SSH to it (the ssh command seems to hang).

  3. guillaumeeb commented on Jun 27, 2018

    @guillaumeeb
    Member

    Did you try with the internal ip between the port, e.g. from your example above:
    45961:10.141.255.254:45961

  4. lesteve commented on Jun 27, 2018

    @lesteve
    MemberAuthor

    Did you try with the internal ip between the port, e.g. from your example above:
    45961:10.141.255.254:45961

    Sorry I was editing my message above with additional info so see my message above, short answer is yes and the ssh tunnel command seems to hang (it kind of makes sense to me since I can not ssh to the internal IP from my local machine).

  5. guillaumeeb commented on Jun 27, 2018

    @guillaumeeb
    Member

    Our doc seems wrong to me, the one on pangeo for using jupyter on hpc is better. You should ssh to a node that you can access to (your public ip), and that node should be able to access the scheduler ip and port (the private ip).

  6. guillaumeeb commented on Jun 27, 2018

    @guillaumeeb
    Member

    There is some misunderstanding here I believe. Command you should try:

    ssh -fN lesteve@sequoia -L 45961:10.141.255.254:45961
    
  7. lesteve commented on Jun 27, 2018

    @lesteve
    MemberAuthor

    Right this one works, thanks a lot! Feeling slightly dumb now ... I guess all the ssh tunnel command I used until now were using localhost and I considered them as black magic too.

    Oh well I'll update the documentation and add a link to the pangeo doc to make me feel better about the whole thing 😉

  8. jakirkham commented on Jun 27, 2018

    @jakirkham
    Member

    Maybe it's worth including nbserverproxy to simplify this behavior or perhaps noting how to enable/use it in the docs?

  9. guillaumeeb commented on Jun 27, 2018

    @guillaumeeb
    Member

    @lesteve glad to hear it works!

    It took a long time for me to actually go beyond the magic and take a moment to really understand ssh tunneling!

    @jakirkham I did'nt know about nbserverproxy. The Readme is concise, but from what I understand this could be really interesting. If used correctly, we only have to be able to access jupyter, and then the dask dashboard can accessible from it, is that right? Is there some more detailed doc about dask and nbserverproxy somewhere?

  10. jakirkham commented on Jun 28, 2018

    @jakirkham
    Member

    Yep, it advertises itself as a JupyterHub project, but was able to get it to work with the Jupyter Notebook by merely installing it. Should add the conda-forge package runs the jupyter-serverextension part for you as part of the install. So if using conda, just installing it seems to work (for me at least :).

    Assuming default Jupyter Notebook port and Dask Dashboard port, the URL looks something like this, http://localhost:8888/proxy/8787/, or more generally, http://localhost:<notebook_port>/proxy/<dask_dashboard_port>/. This drops you on the application menu of Dask Dashboard. The status page lives at http://localhost:<notebook_port>/proxy/<dask_dashboard_port>/status.

    There is a small issue about links on the Dask Dashboard main page being wrong. However this comes up in other cases as well. So the problem is not unique to nbserverproxy and may require a little work on Distributed side of things. ( dask/distributed#2073 ) Should add the problem does not extend to the application header bar shown when a single application is running.

    Edit: Can run dask.config.set({"distributed.dashboard.link": "/proxy/{port}/status"}) to ensure the links in Client and Cluster widgets point to the status page relative to your current URL.

  11. mrocklin commented on Jun 28, 2018

    @mrocklin
    Member
  12. changed the title [-]bokeh dashboard not accessible because the IP used by the dashboard is the internal IP and not the externall IP (i.e. not the IP accessible from the outside world)[/-] [+]Problem accessing the dashboard when the cluster frontend has an internal and an external IP[/+] on Jun 28, 2018
  13. guillaumeeb commented on Jul 31, 2018

    @guillaumeeb
    Member

    Closing this as this is fixed, I've open #111 to keep the nbserverproxy idea.

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