[IPython-dev] thoughts on the notebook, alternative front-ends and remote editing

Ryan Nelson rnelsonchem at gmail.com
Wed Mar 4 10:25:48 EST 2015


Not an IPython dev here, but I have a partial solution that might work for
you.

I also have a very powerful desktop that I use to run calculations
remotely. Instead of X session tunneling, I use port forwarding. Here's an
edited excerpt from my .ssh/config file for connecting to my desktop from
my laptop while at home:

Host athomenb
    # The IP address for my desktop on the router
    HostName 192.168.1.125
    # Add your username here
    User my_user_name
    # Change id_rsa to the name of your key file if you use it
    IdentityFile ~/.ssh/id_rsa
    # For the notebook
    LocalForward 8080 localhost:8080
    # Optional other stuff
    Compression no
    ForwardX11 yes
    ForwardX11Trusted yes
    # Add this if you need to connect via a non-standard ssh port
    #Port 30000

>From the command line, I can access my home computer as follows:
>$ ssh athomenb

>From my desktop, I fire up tmux and then Ipython notebook:
desktop>$ tmux
desktop:tmux>$ ipython notebook --no-browser --port 8080

At this point, I can actually use my web browser on my laptop to connect to
"Localhost", which is actually forwarding to my remote computer. This is
much, much faster than using a remote X window. Connect to this website
http://localhost:8080/

I can do all of my stuff. If you have something running, just save the
notebook and close the window *without* halting. You can also close the
IPython file browser. In your ssh session, you can detach from your tmux
session without the notebook stopping. ("Ctrl-b d" is the detach command
that you have set for tmux.)
desktop:tmux>$ Ctrl-b d
desktop>$ exit
$

Now, to check on the progress of your calculations, you need to reestablish
the ssh connection to your remote machine, if you want, you can reattach to
the tmux session as well.
$ ssh athomenb
desktop>$ tmux a
desktop:tmux>$ #Ipython stuff
Reconnect your local webbroswer to localhost and click on the notebook
that's running.

Sorry. I glossed over a lot of the details here. If this helps, but you
need a little more info to get it running, let me know.

Ryan


On Wed, Mar 4, 2015 at 8:57 AM, Damien Drix <damien.drix at gmail.com> wrote:

> The IPython notebook has changed the way I work. Literate programming,
> the merging of experiment scripts and experiment reports into a single
> document, and countless other productivity gains: tweaking matplotlib
> graphs interactively, easy parallelism, etc. It is quite awesome!
>
> Could it be improved? It certainly can. Here are the two points I find
> most prominent:
> - After one has gotten used to SublimeText & co, CodeMirror just hurts.
> - The notebook server has huge potential for remote work, but this
> potential is partly unexploitable because of some aspects of the
> client/server architecture.
>
> Let me explain the latter point. I have a fairly beefy desktop machine in
> my office, but I'm often working from other locations. I'd like to be
> able to open a notebook remotely on my laptop, edit it, start some long-
> running computations, close my laptop, go to lunch, and come back to it
> in the afternoon to see the results.
>
> Right now, it... kind of works. But the issue is that since the execution
> of cells is orchestrated by client-side javascript, at most one cell will
> be executed if I close the client. The results are there in the kernel
> namespace, but the outputs are lost -- integrating the outputs into the
> notebook is also done by client-side scripts. The client also loses track
> of which cells are still being executed.
>
> One solution would be to use X forwarding and keep the notebook client
> running on the desktop machine, but in my case the connection lag makes
> text editing quite unbearable. I prefer to connect to the notebook server
> from a local client process.
>
> Here is the solution I was thinking about:
>
> - A new frontend app where, instead of embedding a text editor into the
> notebook, the notebook itself is embedded into a text editor. A number of
> nice, open-source, SublimeText-class editors are already being developed:
> Atom, LimeText, LightTable, etc. LightTable has actually done some work
> on integrating the IPython kernel and displaying results inline. I
> imagine that it wouldn't be unreasonably hard to turn it into a full
> notebook client. As a bonus, no more juggling between two editors: use
> the same for the notebooks and for plain Python scripts!
>
> - Move the task of supervising cell execution and integrating the outputs
> into the notebook model from the client to the server, so that notebooks
> can keep running when the client disconnects.
>
> - Let the client app refresh its view of the notebook when it reconnects
> to the server, showing the new outputs and which cells are still running.
>
> Any thoughts on this? Is it all maybe already happening in the Jupyter
> project? ;-)
>
> Best,
> Damien
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150304/44e31aec/attachment.html>


More information about the IPython-dev mailing list