nbclient icon indicating copy to clipboard operation
nbclient copied to clipboard

NBClient cannot read from proxied connection from enterprise gateway to notebook

Open teaglebuilt opened this issue 4 years ago • 1 comments

This issue has started here enterprise gateway conversation.

I am trying to understand why nbclient cannot find the kernel that the notebook is using when executing the notebook.

Right now, I am trying to determine if I need to look at the RemoteKernelManager or the nbclient

teaglebuilt avatar Mar 11 '21 13:03 teaglebuilt

Hi @teaglebuilt,

Access to Enterprise Gateway is available only through a notebook (using classic or lab < 3.0 front-ends) or jupyter_server (using lab >= 3) server that has been properly configured to route kernel discovery and management to the EG server. This is typically done using the --gateway-url CLI option, but can also be configured via the configuration subsystem.

nbclient, despite its name, is not a client of a notebook server, but instead is a direct/thinner application sitting on jupyter_client. So it's more of a sibliing application to notebook (or jupyter_server) and does not have the "plumbing" to leverage the kernel discovery and management mechanisms provided by its web-server siblings. This is why your python_kubernetes kernel that you're able to use from notebook is not found when referenced for nbclient.

nbclient does provide a mechanism for substituting the default KernelManager with a custom kernel manager and, recently (within the last 6 to 9 months or so), work was done such that EG's RemoteKernelManager could be used by applications such as nbclient. However, when using RMK with nbclent, similar configuration information must be provided and a properly configured kernelspec must be locally defined because its use still relies on nbclient's kernel discovery - which only looks locally.

I think we should continue our conversation on the referenced EG issue for now and come back here only if we find something amiss with nbclient - which I don't suspect will be the case.

Thanks.

kevin-bates avatar Mar 11 '21 15:03 kevin-bates