sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.35k stars 460 forks source link

Doc: Add instructions how to run a remote SageMath jupyter kernel #30313

Open mkoeppe opened 4 years ago

mkoeppe commented 4 years ago

(Local jupyter notebook, remote sage kernel; #30306 3ABC)

Such instructions should be added to https://doc.sagemath.org/html/en/installation/launching.html

Part of: #30306 Meta-ticket: Use system Jupyter


References:

CC: @nbruin @embray @slel @jcamp0x2a

Component: documentation

Issue created by migration from https://trac.sagemath.org/ticket/30313

mkoeppe commented 4 years ago
comment:1

On Windows, running the notebook in a native python installation and connecting to the Sage jupyter kernel running in cygwin would also be an attractive deployment option.

mkoeppe commented 4 years ago

Description changed:

--- 
+++ 
@@ -3,4 +3,6 @@
 Such instructions should be added to 
 https://doc.sagemath.org/html/en/installation/launching.html

+Part of: #30306    Meta-ticket: Use system Jupyter

+
nbruin commented 4 years ago
comment:4

The title of this ticket seems to suggest a setup where the jupyter server process runs on one machine and the sage kernel runs on another. That's a tricky set-up. I don't think it's one we can expect to support any time soon. It opens a whole new can of worms where the Jupyter server file browser may show entirely different files than the ones that are available to the kernel process, since there might not be a shared filesystem between the two machines.

Another other problem is the added latency: In that set-up you'd have browser <-> jupyter server <-> kernel, with each of the arrows really needing to go over networking protocols. With the guarantee that the server and the kernel process are on the same machine, the server <-> kernel communication should end up being just local pipes, for which the operating system hopefully can figure out nice optimizations.

Third, the sage kernel needs quite a few plug-ins. Keeping those synced across different machines will be even more complicated. Not impossible, but I don't think advisable unless really required.

I think all we need is instructions to connect a browser to a remote server, which isn't really a sage-specific thing (but probably something that's worth helping people with).

mkoeppe commented 4 years ago
comment:5

Replying to @nbruin:

The title of this ticket seems to suggest a setup where the jupyter server process runs on one machine and the sage kernel runs on another.

That's right.

Another other problem is the added latency: In that set-up you'd have browser <-> jupyter server <-> kernel, with each of the arrows really needing to go over networking protocols. With the guarantee that the server and the kernel process are on the same machine, the server <-> kernel communication should end up being just local pipes, for which the operating system hopefully can figure out nice optimizations.

Actually, the use case is exactly to improve latency, such as in an HPC environment. The head node of a shared cluster typically has abysmal interactive performance because dozens of users run stuff on it. One does not want to run the user interface on it!

Third, the sage kernel needs quite a few plug-ins. Keeping those synced across different machines will be even more complicated. Not impossible, but I don't think advisable unless really required.

Well, for example #30123 intends to fix exactly this: Replace ad-hoc installation of stuff into the notebook server by a more disciplined installation scheme: nbextensions. These can be managed and inspected in a robust and user friendly way.

mkoeppe commented 4 years ago

Description changed:

--- 
+++ 
@@ -6,3 +6,10 @@
 Part of: #30306    Meta-ticket: Use system Jupyter

+---
+
+References:
+
+- https://pypi.org/project/remote_ikernel/ (last release 2017)
+
+
mkoeppe commented 4 years ago

Description changed:

--- 
+++ 
@@ -12,4 +12,9 @@

 - https://pypi.org/project/remote_ikernel/ (last release 2017)

+- http://www.pybloggers.com/2016/06/using-remote-kernels-with-jupyter-notebook-server/

+- https://jupyter-kernel-gateway.readthedocs.io/en/latest/
+
+
+
mkoeppe commented 4 years ago

Description changed:

--- 
+++ 
@@ -14,7 +14,7 @@

 - http://www.pybloggers.com/2016/06/using-remote-kernels-with-jupyter-notebook-server/

-- https://jupyter-kernel-gateway.readthedocs.io/en/latest/
+- https://jupyter-kernel-gateway.readthedocs.io/en/latest/ (https://pypi.org/project/jupyter-kernel-gateway)
mkoeppe commented 4 years ago
comment:9

I've added a few links. (I haven't used any of these packages myself yet.)

mkoeppe commented 3 years ago
comment:11

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.