rapaio-jupyter-kernel icon indicating copy to clipboard operation
rapaio-jupyter-kernel copied to clipboard

Google Colab integration

Open padreati opened this issue 2 years ago • 3 comments
trafficstars

Provide a clean way to integrate RJK into Google Colab.

padreati avatar May 07 '23 19:05 padreati

The problem with Google Colab is not the verbosity of the installer. That can be handled with ease. There is an additional problem which is that since 2022, Google decided to use ipc (inter process protocol - Unix sockets) instead of standard tcp.

Unix sockets were not supported in Java until 16. However, the java library jeromq, which is the java version of zero mq library, which notebook relies on to communicate does not support it. Yet. There are some issues opened on this topic, but one of them looks promising:

https://github.com/zeromq/jeromq/issues/927 https://github.com/zeromq/jeromq/issues/953

There is another alternative, that during the installation process on colab host to create some proxies to bind the ipc ports to some tcp ports. This looks ugly, since anyway, there are already some commands for installing jdk and the kernel.

This will be postponed for now and give priority to other issues in the meantime.

padreati avatar May 24 '23 17:05 padreati

Searching more on this path I think there is a way to may implement that, but I have to put some work to test it:

  • since jupyter is there, that python should be also
  • the zeromq python is a wrapper over c implementation
  • c implementation is complete and contains a proxy
  • if ipc is detected in connection file, a temporary file could be created by kernel runner, that file could contain a python script which could be launched to bind ipc to tcp on the same ports, for all 5 channels
  • the python script could be launched as an process
  • when kernel is closing, the process connected with script is killed and the temp file is deleted

padreati avatar May 25 '23 19:05 padreati

You can have a look at this: https://github.com/zeromq/jeromq/pull/998.

fbacchella avatar Dec 27 '24 11:12 fbacchella