Skip to content

Commit 6055c32

Browse files
committed
Embed NB2KG into Notebook server
This change alleviates a significant pain-point for consumers of Jupyter Kernel and Enterprise Gateway projects by embedding the few classes defined in the NB2KG server extension directly into the Notebook server. All code resides in a separate gateway directory and the 'extension' is enabled via a new configuration option `--gateway-url`. Renamed classes from those used in standard NB2KG code so that Notebook servers using the existing NB2KG extension will still work. Added test_gateway.py to exercise overridden methods. It does this by mocking the call that issues requests to the gateway server. Updated the _Running a notebook server_ topic to include a description of this feature.
1 parent 04a686d commit 6055c32

File tree

6 files changed

+1287
-10
lines changed

6 files changed

+1287
-10
lines changed

docs/source/public_server.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,35 @@ single-tab mode:
343343
});
344344
345345
346+
Using a gateway server for kernel management
347+
--------------------------------------------
348+
349+
You are now able to redirect the management of your kernels to a Gateway Server
350+
(i.e., `Jupyter Kernel Gateway <https://jupyter-kernel-gateway.readthedocs.io/en/latest/>`_ or
351+
`Jupyter Enterprise Gateway <https://jupyter-enterprise-gateway.readthedocs.io/en/latest/>`_)
352+
simply by specifying a Gateway url via the following command-line option:
353+
354+
.. code-block:: bash
355+
356+
$ jupyter notebook --gateway-url=http://my-gateway-server:8888
357+
358+
the environment:
359+
360+
.. code-block:: bash
361+
362+
GATEWAY_URL=http://my-gateway-server:8888
363+
364+
or in :file:`jupyter_notebook_config.py`:
365+
366+
.. code-block:: python
367+
368+
c.NotebookApp.gateway_url = http://my-gateway-server:8888
369+
370+
When provided, all kernel specifications will be retrieved from the specified Gateway server and all
371+
kernels will be managed by that server. This option enables the ability to target kernel processes
372+
against managed clusters while allowing for the notebook's management to remain local to the Notebook
373+
server.
374+
346375
Known issues
347376
------------
348377

notebook/gateway/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)