Skip to content

Reuse nbserverproxy for Dask's dashboards #2160

Closed

Description

@mrocklin

The nbserverproxy allows Jupyter servers to proxy other ports on localhost to anyone with access to the Jupyter server.

We have a similar problem in dask. People often have access to the dask-scheduler dashboard, but don't have access to each of the dask-worker dashboards. However the dask-worker dashboards are visible to the scheduler.

I'm curious if functionality from nbserverproxy could be adapted to suit Dask's needs as well. There are some similarities

  1. In both cases we have a server at an accessible location can see an inaccessible location
  2. In both cases that server is a Tornado web server

And some differences

  1. The accessible server (scheduler) is likely on a different host than the inaccessible servers (workers)
  2. One is Jupyter, the other isn't

cc @yuvipanda, is this worth investigating? Is it worth generalizing nbserverproxy? "Nope, nbserverproxy is pretty tied to Jupyter internals" is a fine answer. This isn't a huge pain point right now, I'm just curious about the possibility.

Activity

  1. yuvipanda commented on Aug 4, 2018

    @yuvipanda

    The HTTP / websocket proxying parts of nbserverproxy sound great for this. The only jupyter specific thing we do is use it for authentication, so you will have to do something yourself for authentication. There needs to be some auth at the target of the proxy too, to make sure only the proxy can talk to it.

  2. mrocklin commented on Aug 4, 2018

    @mrocklin
    MemberAuthor

    For better or worse, Dask's worker and scheduler dashboards are fully open (they leak information, but don't provide any control). Does this mean that we can drop the Jupyter parts (the IPythonHandler?)

    Also, looking at the LocalProxyHandler I see that it pins 127.0.0.1. Presumably we would extend the route to include some escaped form of the full address, rather than just the port. Do you see any problem with this?

    If someone makes these changes should they modify nbserverproxy, go upstream to https://github.com/senko/tornado-proxy (adding back in your web-socket stuff), or fork again and make a dask-server-proxy? Given the simplicity of the project I'm currently leaning towards option 3.

  3. yuvipanda commented on Aug 4, 2018

    @yuvipanda

    I too recommend option 3 for now.

  4. mrocklin commented on Apr 25, 2019

    @mrocklin
    MemberAuthor

    I would have used this today :)

    Presumably to help with the auth problem, we could probably only proxy the addresses of the worker dashboards that we know about.

  5. quasiben commented on May 10, 2019

    @quasiben
    Member

    I am interested in picking this up but running into an issue early on. I setup a dask-scheduler and one dask-worker and I'm unable to navigate to worker bokeh pages (getting 404s) on worker pages. Is this a bug or a user error ?

    127.0.0.1:58477 returns 404

     1 ❯ dask-worker tcp://127.0.0.1:8786
    distributed.nanny - INFO -         Start Nanny at: 'tcp://127.0.0.1:58475'
    distributed.diskutils - INFO - Found stale lock file and directory '/Users/bzaitlen/worker-5mrizwz9', purging
    distributed.worker - INFO -       Start worker at:      tcp://127.0.0.1:58476
    distributed.worker - INFO -          Listening to:      tcp://127.0.0.1:58476
    distributed.worker - INFO -              nanny at:            127.0.0.1:58475
    distributed.worker - INFO -              bokeh at:            127.0.0.1:58477
    distributed.worker - INFO - Waiting to connect to:       tcp://127.0.0.1:8786
    distributed.worker - INFO - -------------------------------------------------
    distributed.worker - INFO -               Threads:                         12
    distributed.worker - INFO -                Memory:                   17.18 GB
    distributed.worker - INFO -       Local Directory: /Users/bzaitlen/worker-iv2mlc0_
    distributed.worker - INFO - -------------------------------------------------
    distributed.worker - INFO -         Registered to:       tcp://127.0.0.1:8786
    distributed.worker - INFO - -------------------------------------------------
    distributed.core - INFO - Starting established connection
    
  6. mrocklin commented on May 10, 2019

    @mrocklin
    MemberAuthor

    Interesting, we're routing / to /status where for workers it should be /main. We should change this either by changing the routing, or being consistent about using /status everywhere.

    Try http://127.0.0.1:58477/main

  7. quasiben commented on May 10, 2019

    @quasiben
    Member

    Yup! That works. I'll submit a PR now for this fix. I prefer keeping everything on /status

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