0

I can see that the kernel gateway library is installed in datalab, however I'm having no luck with creating an endpoint of my own. I've tried the examples in the kernel gateway demos in a cell:

# GET /test_api
import json
print(json.dumps(dict(test='test')))

Is there any way to do this? Or does anyone know if the developers are planning to implement this?

Badger Cat
  • 946
  • 2
  • 16
  • 31

1 Answers1

3

Short answer: There are no current plans to support this in Datalab, but please file a feature request here to let us know more about your use case.

Longer answer: The Datalab frontend does not operate as a kernel gateway, but rather supports using a separate kernel gateway for running notebook kernels.

There is a separate Docker container defined for running a kernel gateway with the Datalab extensions, but it currently only supports running as the backend for a Datalab frontend.

In order to do what you want, the invocation of the kernelgateway command would have to be extended to include the following arguments:

  1. "--KernelGatewayApp.api=kernel_gateway.notebook_http"
  2. "--KernelGatewayApp.seed_uri=<YOUR NOTEBOOK>"

You could do what you want by editing the linked file with those arguments, building the kernel gateway image, and then running it with your notebook (after mapping your notebook into the Docker container).

However, that is a rather involved process, and we do not currently have any plans to improve it.

Omar Jarjur
  • 1,046
  • 5
  • 5