Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jupyterhub with enterprise gateway #620

Closed
jrcblue opened this issue Mar 27, 2019 · 12 comments
Closed

jupyterhub with enterprise gateway #620

jrcblue opened this issue Mar 27, 2019 · 12 comments

Comments

@jrcblue
Copy link

jrcblue commented Mar 27, 2019

Hi, I am trying to integrate jupyterhub with enterprise_gateway. EG+nb2kg+Notebook have already worked well. I configured jupyter_notebook_config.py as another issue indicated:
`from nb2kg import managers
c = get_config()

c.NotebookApp.session_manager_class=managers.SessionManager
c.NotebookApp.kernel_manager_class=managers.RemoteKernelManager
c.NotebookApp.kernel_spec_manager_class=managers.RemoteKernelSpecManager`

However, the jupyterhub cannot find the kernels and the error is:

[E 2019-03-27 16:47:34.599 SingleUserNotebookApp web:1788] Uncaught exception GET /user/tank/api/kernelspecs (127.0.0.1)
HTTPServerRequest(protocol='http', host='127.0.0.1:19999', method='GET', uri='/user/tank/api/kernelspecs', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
File "/opt/work/conda/envs/jegpy27/lib/python3.6/site-packages/tornado/web.py", line 1699, in _execute
result = await result
File "/opt/work/conda/envs/jegpy27/lib/python3.6/site-packages/tornado/gen.py", line 209, in wrapper
yielded = next(result)
File "/opt/work/conda/envs/jegpy27/lib/python3.6/site-packages/nb2kg/handlers.py", line 328, in get
kernel_specs = yield gen.maybe_future(ksm.list_kernel_specs())
AttributeError: 'KernelSpecManager' object has no attribute 'list_kernel_specs
[W 2019-03-27 16:47:34.600 SingleUserNotebookApp handlers:620] Unhandled error
[E 2019-03-27 16:47:34.600 SingleUserNotebookApp log:150] {
"Cookie": "jupyterhub-user-tank=2|1:0|10:1553675988|20:jupyterhub-user-tank|48:MTNjZTE5NDQtY2Q5Ni00ODZlLWEyYTItNmRhY2IzNWIyNTE0|ecfd4d207065e18279349162980f237ef9ec094fbfacf64b854c30a83442d8ff; _xsrf=2|d8d45906|b01faa2c02009321af61a33ef9aed088|1551146410; username-127-0-0-1-12345="2|1:0|10:1553567027|24:username-127-0-0-1-12345|44:ZWMyMDYxYzVhNWYzNDM3ODgwZWEyNTI5NTI0OGY0YjQ=|d1208eb128abc3d04d595b0b95212f659081471afd577c69b65bfe28e9dc3157"; jupyterhub-session-id=b6c7a79e9ca645a98c2769e652ab8f53",
"Accept-Language": "en-US,en;q=0.9,zh;q=0.8",
"Accept-Encoding": "gzip, deflate, br",
"Referer": "http://127.0.0.1:19999/user/tank/tree",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36",
"X-Xsrftoken": "2|d8d45906|b01faa2c02009321af61a33ef9aed088|1551146410",
"X-Requested-With": "XMLHttpRequest",
"Accept": "/",
"Connection": "close",
"Host": "127.0.0.1:19999"
}

I was wondering what else should I configure or maybe I need to get another version of nb2kg?
I went over #448 but am still confused. Thank you!

@Gsbreddy
Copy link
Contributor

you need to import nb2kg in notebook config as below:
import nb2kg
from nb2kg import managers

Please try this. Thanks.

@jrcblue
Copy link
Author

jrcblue commented Mar 28, 2019 via email

@Gsbreddy
Copy link
Contributor

Can you share your notebook and hub config? That’ll help me .

@jrcblue
Copy link
Author

jrcblue commented Mar 28, 2019 via email

@kevin-bates
Copy link
Member

Ensure you have the extension configured (via jupyter serverextension enable --py nb2kg --sys-prefix) and I'd drop your from nb2kg import managers and prefix your class changes with nb2kg. so that it matches these.

@kevin-bates
Copy link
Member

@jrcblue - have you had any luck? Please let us know how we can assist.

@lresende
Copy link
Member

lresende commented Apr 4, 2019

FYI, here is what I use for JupyterHub integration:

JupyterHub Configuration

Jupyter Enterprise gateway ingress to make it available at /gateway

BTW, I mostly tried using in Kubernetes, not sure if using a different environment requires specific tweaks but this can give you a bases. Also, all steps are documented in the ansible-scripts we use for setting up test environments.

@jrcblue
Copy link
Author

jrcblue commented Apr 11, 2019

Thank you, and I am trying to make jupyterhub work on yarn cluster according to your configuration. I will update.

@Litchilitchy
Copy link

this is because the manager class does not get nb2kg class, it is a configuration issue, the default manager class does not have method of list_kernel_specs and this method is written in nb2kg

see this nb2kg issue to fix

@kevin-bates
Copy link
Member

Thanks for the update @Litchilitchy. @jrcblue - how are things going for you? Have you been able to move forward?

@jrcblue
Copy link
Author

jrcblue commented Apr 24, 2019 via email

@kevin-bates
Copy link
Member

@jrcblue - thank you for the response - glad you're moving forward. I'm closing this issue.

Could you please open a separate issue regarding the inability to unset unauthorized_users? Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants