IPython notebook: Difference between revisions

From IIHE Wiki
Jump to navigationJump to search
(Created page with "IPython is an interactive Python environment. Coupled with the "notebook" module, it provides a rich web interface. When launching the notebook, the system will create a dedicate…")
 
No edit summary
Line 1: Line 1:
IPython is an interactive Python environment. Coupled with the "notebook" module, it provides a rich web interface.
IPython is an interactive Python environment. Coupled with the "notebook" module, it provides a rich web interface.
When launching the notebook, the system will create a dedicated server running on a specific port.


=How to launch it=
IPython notebook is available on the cluster in 2 environment : the custom build and cvmfs.


To load the custom build :
=Where is it=
IPython notebook is available on the cluster in 2 environments : the custom build and CVMFS.
 
To load from the custom build :
<pre>source /software/sources/latestEnvironment</pre>
<pre>source /software/sources/latestEnvironment</pre>


Line 11: Line 11:
See [[IceCube Software Cluster#CVMFS]]
See [[IceCube Software Cluster#CVMFS]]


=Launch a notebook=
When launching the notebook, the system will create a dedicated server listening to localhost (default) running on a specific port.
==Access from the outside==
To launch your notebook and access it from the outside (your browser) :
To launch your notebook and access it from the outside (your browser) :


<pre>ipython notebook --ip=UI_URL --port=PORT_NUMBER --pylab inline</pre>
<pre>ipython notebook --ip=UI_URL --port=PORT_NUMBER --pylab inline</pre>
Where UI_URL is the ui url where you launched the command (eg. ui01.iihe.ac.be) and PORT_NUMBER is a custom defined port that you have to choose (between 1025 and 65635)  
Where UI_URL is the ui url where you launched the command (eg. ui01.iihe.ac.be) and PORT_NUMBER is a custom defined port that you have to choose (between 1025 and 65635)  
Then, open the url http://UI_URL:PORT_NUMBER from your web browser.
Then, open the url http://UI_URL:PORT_NUMBER from your web browser.


WARNING :
WARNING :
Using this method will expose your notebook to the outside (internet), that means if someone get the PORT_NUMBER, he can do whatever he wants on this notebook. The safest way is to use a SSH tunnel.
Using this method will expose your notebook to the outside (internet), that means if someone open your notebook, he can do whatever he wants on it. The safest way is to use a SSH tunnel.
 
==Access via SSH tunnel==
This way is more secure but a bit more complex
 
Launch the notebook only on localhost
<pre>ipython notebook --port=PORT_NUMBER --pylab inline</pre>
 
Create a tunnel from your machine
<pre>ssh -L PORT_NUMBER:uixx.iihe.ac.be:PORT_NUMBER</pre>
 
Open the tunnelled notebook in your browser by opening the url : http://localhost:PORT_NUMBER


=Links=
=Links=
http://ipython.org/
http://ipython.org/

Revision as of 13:45, 17 November 2014

IPython is an interactive Python environment. Coupled with the "notebook" module, it provides a rich web interface.


Where is it

IPython notebook is available on the cluster in 2 environments : the custom build and CVMFS.

To load from the custom build :

source /software/sources/latestEnvironment

To load from CVMFS : See IceCube Software Cluster#CVMFS

Launch a notebook

When launching the notebook, the system will create a dedicated server listening to localhost (default) running on a specific port.

Access from the outside

To launch your notebook and access it from the outside (your browser) :

ipython notebook --ip=UI_URL --port=PORT_NUMBER --pylab inline

Where UI_URL is the ui url where you launched the command (eg. ui01.iihe.ac.be) and PORT_NUMBER is a custom defined port that you have to choose (between 1025 and 65635) Then, open the url http://UI_URL:PORT_NUMBER from your web browser.

WARNING : Using this method will expose your notebook to the outside (internet), that means if someone open your notebook, he can do whatever he wants on it. The safest way is to use a SSH tunnel.

Access via SSH tunnel

This way is more secure but a bit more complex

Launch the notebook only on localhost

ipython notebook --port=PORT_NUMBER --pylab inline

Create a tunnel from your machine

ssh -L PORT_NUMBER:uixx.iihe.ac.be:PORT_NUMBER

Open the tunnelled notebook in your browser by opening the url : http://localhost:PORT_NUMBER

Links

http://ipython.org/