gregsexton / ob-ipython

org-babel integration with Jupyter for evaluation of (Python by default) code blocks
738 stars 108 forks source link

implement remote kernel support through SSH #39

Open smartass101 opened 8 years ago

smartass101 commented 8 years ago

This uses the --ssh option of the ipython console app to create the necessary tunnels and create a new connection file with "-ssh" added (because it may use different ports). Therefore, the REPL is created before the driver.

The connection file naming convention of "emacs-*.ssh" is abandoned in order to support arbitrary remote kernel connection files including "-" characters (e.g. "kernel-36465-ssh.json"), so all non-whitespace characters are matched by ExecuteHandler.

Since setting up SSH tunnels can take a while and only after that will the modified connection file be available to the driver another sleep must be used if SSH is invoked. The sleep delay is made customizable and documented.

Fixes #11

smartass101 commented 8 years ago

Warning: At the time of writing this jupyter_cleint is broken (https://github.com/jupyter/jupyter_client/issues/102) and the --ssh option does not save the new configuration file. I submitted a PR with a fix (https://github.com/jupyter/jupyter_client/pull/103), not sure when they'll merge it. For the time being it has to be tested with the applied fix I proposed.

gregsexton commented 7 years ago

Is this still relevant now that I've merged #71 ?