The kernel gateway is a web server that supports different mechanisms for spawning and communicating with Jupyter kernels, such as:
- A Jupyter Notebook server-compatible HTTP API used for requesting kernels and talking the Jupyter kernel protocol with the kernels over Websockets
- A HTTP API defined by annotated notebook cells that maps HTTP verbs and resources to code to execute on a kernel
The server launches kernels in its local process/filesystem space. It can be containerized and scaled out using common technologies like tmpnb, Cloud Foundry, and Kubernetes.
- Attach a local Jupyter Notebook server to a compute cluster in the cloud running near big data (e.g., interactive gateway to Spark)
- Enable a new breed of non-notebook web clients to provision and use kernels (e.g., web dashboards using jupyter-js-services)
- Create microservices from notebooks using the Kernel Gateway
notebook-http
mode
See the Features page in the documentation for a detailed explanation of Jupyter Kernel Gateway's features.
Detailed installation instructions can be found in the Jupyter Kernel Gateway documentation found on ReadTheDocs.
# install from pypi
pip install jupyter_kernel_gateway
# show all config options
jupyter kernelgateway --help-all
# run it with default options
jupyter kernelgateway
Setting up a Dockerized development environment for the Jupyter Kernel Gateway is straightforward using these steps:
- Prerequisite - Docker installation (if needed)
For example, on a Mac, do this one-time setup to set up Docker locally:
brew update
# make sure you're on Docker >= 1.7
brew install docker-machine docker
docker-machine create -d virtualbox dev
eval "$(docker-machine env dev)"
-
Clone the repo
# make a directory under ~ to put source mkdir -p ~/projects cd !$ # clone this repo git clone https://github.com/jupyter/kernel_gateway.git
-
Test the installation
make test-python3 make test-python2
-
Run the gateway server
cd kernel_gateway make dev
-
Access the gateway instances:
a. Run
docker-machine ls
and note the IP of the dev machine.b. Visit http://THAT_IP:8888/api in your browser where
THAT_IP
is the IP address returned from the previous step. (Note that the route/api/kernels
is not enabled by default for greater security. See the--KernelGatewayApp.list_kernels
parameter documentation if you would like to enable the/api/kernels
route.)