#IPython Remote Notebook
##Installation and setup
-
Download or clone this gist:
git clone https://gist.github.com/6600757.git remote_ipython
-
Add or edit your default notebook configuration file (
.ipython/profile_default/ipython_notebook_config.py
) on Janus so that it looks like the following:c = get_config() c.NotebookApp.ip = '*' c.NotebookApp.port = ipythonport c.NotebookApp.open_browser = False
If you do note have an
.ipython/profile_default
directory, just run the notebook on Janus once. Create theipython_notebook_config.py
file if it does not exist. -
Copy the
notebook_janus.py
file onto Janus. Please note the location. -
Copy the
notebook_local.py
file onto your local machine. -
Make sure you have the control sockets specified in your
.ssh/config
file locally. For example, here is what my file looks like:Host login HostName login.rc.colorado.edu User molu8455 ControlMaster auto ControlPath ~/.ssh/sockets/%r@%h:%p
Of coures, you'll want to replace my user name,
molu8455
, with your own. -
Edit the configuration settings at the top of the
notebook_local.py
file.login_base = 'login' remote_dir = '/home/molu8455/bin' remote_default_dir = '/projects/molu8455' port = 8055
Again please modify and replace
molu8455
where appropriate. If you use a gateway machine, likebumba
you can bounce:login_base = 'ssh login'
##Running
-
Login to Janus with your one time password device using the
.ssh/config
specification.ssh login
-
In a terminal session on your local machine, run the local notebook command.
python notebook_local.py
You can change the defaults if you would like. For example,
python notebook_local.py -d . -n 2 -p 8765
will run the notebook in my
$HOME
directory with 2 nodes on port 8765. -
When you are done with the notebook session, hit control-c to cancel the script, which will also cancel the job on Janus.
##Reuse
You can put a custom python command in a bash
script for quick access to certain directories and resource levels. For example, I have a datascience.sh
script that contains the following information.
python notebook_local.py -n 2 -d /home/molu8455/projects/data_science_meetup_2013
This allows me to have a shortcut.
./datascience.sh