You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Include nbserverproxy or describe how to use it in the docs #111
@jakirkham, I tried nbserverproxy with no luck, as mentionned in pangeo thread. Could you look at it to see if you're doing things differently? I'll give it another go when I have some time.
Okay, so I've found the problem with my setup : Dask dashboard was bind to a given network interface, but apparently nbserverproxy was not able to proxy to this one, it was probably trying another interface, don't know why though.
So in order to make nbserverproxy work, I add to use the trick described in #90: bind the dashboard to all interfaces.
I haven't actually used jupyterhub before so you may want to ask someone with more experience than I. I still gave it a go though and my build notes from scratch are below. I made it as far as to 'sign up with github button' but it wasn't really responding after that
$ conda create -n djq_nbs python=3.6
$ conda activate dqj_nbs
$ pip install git+https://github.com/dask/dask-jobqueue.git
$ conda install -c conda-forge psutil jupyterhub nbserverproxy bokeh
$ pip install install oauthenticator
$ jupyter serverextension enable --py nbserverproxy
$ jupyterhub --generate-config
# Not sure if now needed with github login method
$ openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -subj '/CN=XX.XXX.XXX.XXX'
# Horrible hack to get rid of bad password phrase error when starting jupyterhub ( https://github.com/jupyterhub/jupyterhub/issues/1134; https://github.com/mcollina/mosca/issues/421)
$ cp key.pem key.old.pem
$ openssl rsa -in key.pem -out newkey.pem
# use github for logging in https://github.com/settings/applications/new
# Setup as environmental files (in your .bashrc
OAUTH_CALLBACK_URL=https://XX.XXX.XXX.X:8000/hub/oauth_callback
GITHUB_CLIENT_ID=xxx
GITHUB_CLIENT_SECRET=xxx
# edit jupyterhub_config.py:
import os
from oauthenticator.github import GitHubOAuthenticator
c.JupyterHub.authenticator_class = GitHubOAuthenticator
c.MyOAuthenticator.oauth_callback_url = 'https://XX.XXX.XXX.X:8000/hub/oauth_callback'
c.MyOAuthenticator.client_id = 'XXX'
c.MyOAuthenticator.client_secret = 'XXX'
c.JupyterHub.admin_access = True
c.Authenticator.admin_users = {'GITHUBUSERNAME'}
c.JupyterHub.ssl_key = 'newkey.pem'
c.JupyterHub.ssl_cert = 'cert.pem'
c.Authenticator.whitelist = {'GITHUBUSERNAME'}
c.LocalAuthenticator.create_system_users = True
$ jupyterhub --ip XX.XXX.XXX.XXX --port 8000
# On laptop open https://XX.XXX.XXX.XXX:8000
@raybellwaves ah sorry, I did not make myself clear enough. I just wanted you to test the nbserverproxy solution with your current procedure : user launched notebook. Something like that :
The setup worked thanks but nothing displayed in the dashboard. I tried just the notebook and jupyter lab but both gave the same response.
pip install git+https://github.com/dask/dask-jobqueue.git
conda install -c conda-forge psutil jupyter jupyterlab nbserverproxy widgetsnbextension ipywidgets bokeh pandas
jupyter serverextension enable --py nbserverproxy
jupyter notebook --no-browser --ip=`hostname` --port=8888
# on laptop
ssh -N -L 8888:`hostname`:8888 username@domain
# open notebook in browser at http://`localhost`:8888
# Contents of notebook is
from dask_jobqueue import LSFCluster
from dask.distributed import Client
cluster = LSFCluster(cores=2, memory='2 GB')
cluster
# start 2 workers
client = Client(cluster)
client
# open the dashboard in browser at http://`localhost`:8888/proxy/`dashboardport`/status
Here's the logs from my terminal running the notebook
[I 12:02:43.327 NotebookApp] Client sent subprotocols: []
ERROR:asyncio:Future exception was never retrieved
future: <Future finished exception=IndexError('list index out of range',)>
Traceback (most recent call last):
File "/nethome/rxb826/local/bin/miniconda3/envs/djq_nbs/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/nethome/rxb826/local/bin/miniconda3/envs/djq_nbs/lib/python3.6/site-packages/tornado/websocket.py", line 721, in _accept_connection
self.selected_subprotocol = self.handler.select_subprotocol(subprotocols)
File "/nethome/rxb826/local/bin/miniconda3/envs/djq_nbs/lib/python3.6/site-packages/nbserverproxy/handlers.py", line 300, in select_subprotocol
return subprotocols[0]
IndexError: list index out of range
@raybellwaves it looks like you're not using nbserverproxy in your last comment. Is is probably as you say, just the binding to all interface that solved your problem.
Could you try again with the http://localhost:8888/proxy/dashboardport/status URL? Maybe its what you just did and there still was a problem?
Yes. I made sure that my jobs were running. I still get the empty dashboard as shown above
I don't think I am missing something in the setup of the nbserverproxy?
Yes. I made sure that my jobs were running. I still get the empty dashboard as shown above
I don't think I am missing something in the setup of the nbserverproxy
You could be on a dashboard from another cluster, maybe the dashboard port is not the right one.
Activity
guillaumeeb commentedon Aug 1, 2018
Cross referencing the work of @jhamman on pangeo-data/pangeo#304 here, this already work in progress!
jakirkham commentedon Aug 4, 2018
Probably worth linking this comment as well since that has a little more details about how to set it up. Not that there is much to setup at all.
guillaumeeb commentedon Aug 4, 2018
@jakirkham, I tried nbserverproxy with no luck, as mentionned in pangeo thread. Could you look at it to see if you're doing things differently? I'll give it another go when I have some time.
raybellwaves commentedon Aug 6, 2018
@guillaumeeb I was the same. I ended up opening an issue over there jupyterhub/jupyter-server-proxy#45 but closed it once I had the
sshsolution working.guillaumeeb commentedon Aug 7, 2018
Okay, so I've found the problem with my setup : Dask dashboard was bind to a given network interface, but apparently nbserverproxy was not able to proxy to this one, it was probably trying another interface, don't know why though.
So in order to make nbserverproxy work, I add to use the trick described in #90: bind the dashboard to all interfaces.
guillaumeeb commentedon Aug 8, 2018
@raybellwaves, could you give another go to nbserverproxy solution, now that #119 is in master?
raybellwaves commentedon Aug 9, 2018
I haven't actually used jupyterhub before so you may want to ask someone with more experience than I. I still gave it a go though and my build notes from scratch are below. I made it as far as to 'sign up with github button' but it wasn't really responding after that
guillaumeeb commentedon Aug 9, 2018
@raybellwaves ah sorry, I did not make myself clear enough. I just wanted you to test the nbserverproxy solution with your current procedure : user launched notebook. Something like that :
Do the ssh tunneling thing to access to your notebook (and only your notebook). Then in your notebook, launch Dask using jobqueue, and go to
or wathever port Dask Dashboard has been launched to.
raybellwaves commentedon Aug 9, 2018
No problem. I've been meaning to try jupyterhub for a while anyway so it was a good learning experience.
Ok. I'll give it a go later or tomorrow.
raybellwaves commentedon Aug 10, 2018
The setup worked thanks but nothing displayed in the dashboard. I tried just the
notebookandjupyter labbut both gave the same response.Here's the logs from my terminal running the notebook
guillaumeeb commentedon Aug 10, 2018
That's better.
Were your workers started at that moment?
raybellwaves commentedon Aug 10, 2018
Yes. I just checked again.
Actually it works now if I just click on the dashboard link
I may do a quick test without
nbserverproxy. I think your recent PR's helped my problem in #116 (comment)guillaumeeb commentedon Aug 10, 2018
@raybellwaves it looks like you're not using nbserverproxy in your last comment. Is is probably as you say, just the binding to all interface that solved your problem.
Could you try again with the http://
localhost:8888/proxy/dashboardport/status URL? Maybe its what you just did and there still was a problem?raybellwaves commentedon Aug 10, 2018
Correct. It seems to work without
nbserverproxyfor me now.Yes. I made sure that my jobs were running. I still get the empty dashboard as shown above
I don't think I am missing something in the setup of the
nbserverproxy?guillaumeeb commentedon Aug 30, 2018
You could be on a dashboard from another cluster, maybe the dashboard port is not the right one.
jakirkham commentedon Aug 30, 2018
It sounds like this is a bug fixed in
master. Though downgrading should be equally effective at resolving the issue.xref: jupyterhub/jupyter-server-proxy#39