Running iPython Notebooks

This page describes how to launch iPython notebooks directly from an interactive job on any Frank queue. At this time the procedure is known to work on Mac OS X and Linux desktops where SSH can be run on the command line. For Windows desktops there may be several ways to create SSH tunnels

Submit interactive job

You can submit an interactive job for iPython just like a normal job. For this example I will request one core from the shared queue.

  • NOTE: even though it is possible to request more than one core in a job there is no guarantee that Python will be able to run your tasks in parallel.
defusco@login0a:~>qsub -I -q shared -l nodes=1:ppn=1,walltime=2:00:00
qsub: waiting for job to start
qsub: job ready

Launch iPython notebook

Once the interactive job is running you need to load a python module where iPython has been installed. After the module is loaded run frank-ipython-notebook to launch the notebook and receive further instructions.

defusco@n4:~>module load python/anaconda-1.9.2-rhel
Launching iPython with port 26080 on n4
Your SSH tunnel command on your desktop should look like the following
  ssh -L 9999:localhost:8888 ssh -L 8888:localhost:26080 -N n4
Then visit http://localhost:9999
2015-08-15 23:46:39.325 [NotebookApp] Using existing profile dir: u'/home/sam/defusco/.ipython/profile_default'
2015-08-15 23:46:39.494 [NotebookApp] Using MathJax from CDN:
2015-08-15 23:46:39.515 [NotebookApp] Serving notebooks from local directory: /home/sam/defusco
2015-08-15 23:46:39.515 [NotebookApp] The IPython Notebook is running at:
2015-08-15 23:46:39.515 [NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

Open SSH tunnel to compute node

On your desktop computer running either Linux or Mac OS X open a second terminal and run the SSH tunnel command shown in your frank-ipython-notebook output. If little to no output is shown then the tunnel has been established.

  • NOTE: do not stop the SSH tunnel process or you will loose your connection to the iPython notebook
albert@laptop:~>ssh -L 9999:localhost:8888 ssh -L 8888:localhost:26080 -N n4
Warning: Permanently added 'n4,' (RSA) to the list of known hosts.

Connect to your iPython notebook

Once the tunnel has been established you can connect directly to your iPython notebook running on the compute node by navigating your browser to http://localhost:9999.