other:uvcdat:cdat_conda:ipnb
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| other:uvcdat:cdat_conda:ipnb [2019/05/15 11:57] – Started How does it work jypeter | other:uvcdat:cdat_conda:ipnb [2019/05/20 11:10] (current) – Improved jypeter | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| There are **many** python distributions, | There are **many** python distributions, | ||
| - | * // | + | * // |
| * using python in a //Linux terminal//, the [[https:// | * using python in a //Linux terminal//, the [[https:// | ||
| * using the default '' | * using the default '' | ||
| Line 24: | Line 24: | ||
| In [2]: | In [2]: | ||
| Do you really want to exit ([y]/n)? y</ | Do you really want to exit ([y]/n)? y</ | ||
| - | * using //ipython notebooks// | + | * using python interactively in a //ipython notebooks//, which means that |
| - | + | * you will use an ipython interpreter | |
| - | //Using an ipython notebook// | + | * in a web browser (rather than a terminal) |
| - | * you will use an ipython interpreter | + | * a notebook is the content of the web page where you have interacted with python. You can save it ('' |
| - | * in a web browser (rather than a terminal) | + | * the notebooks have cells with python input, python output (including graphics), and cells that can be used to format the document (titles, formatted text, equations, images, etc...) |
| + | * the notebooks support several other languages (e.g. **R**) | ||
| ===== How does it work? ===== | ===== How does it work? ===== | ||
| Line 35: | Line 36: | ||
| - determine if you will use python on your local computer or a remote computer and //go// to that computer | - determine if you will use python on your local computer or a remote computer and //go// to that computer | ||
| - | * this mostly depends on the data you need to work. The idea is to move the computation near the data, not to move/ | + | * the selected computer |
| - | - choose/ | + | - choose/ |
| + | * e.g. you can [[other: | ||
| + | - start the ipython notebook server with the appropriate parameters (on the selected computer, with the selected python) | ||
| + | * this will start a temporary web server that you can connect to, in order to use the notebooks | ||
| + | * the server will display the URL that you have to use. The URL has an authentication token and only you (or the person who has a copy of the full URL) can connect to your server | ||
| + | * the basic way to start a server is to just type '' | ||
| + | * the '' | ||
| + | * if you have to work on a remote computer, <wrap hi>the idea is to start the ipython server on the remote computer and use a web browser on your local computer</ | ||
| + | - in a web browser, open the temporary URL displayed by the ipython server and start using the ipython notebooks | ||
| + | - when you are finished, <wrap em>do not forget to kill the ipython server</ | ||
| + | * Warning! Closing the browser, or using the '' | ||
| + | |||
| + | ===== Working correctly with the notebooks ===== | ||
| + | |||
| + | ==== Reminder ==== | ||
| + | |||
| + | * Make sure you read and understand the [[# | ||
| + | * If you have a python installed **on your own desktop/ | ||
| + | * **On a remote and shared server**, only start the notebook server and use a local browser to connect to the notebook server through an //ssh tunnel//. | ||
| + | |||
| + | ==== Prerequisites ==== | ||
| + | |||
| + | You need to meet the following prerequisites in order to create an ssh tunnel to the remote server where your notebook server will run | ||
| + | |||
| + | * We assume that: | ||
| + | * **you have a local web browser** installed! | ||
| + | * **you have an account on the remote server**: replace ''< | ||
| + | * **you have an assigned a //port number//** on the remote server: replace ''< | ||
| + | * List of assigned port numbers at **LSCE**: check the [[http:// | ||
| + | * Ask your advisor for a port number at LSCE if you do not have one | ||
| + | * List of assigned port numbers on **ciclad**: check the ''/ | ||
| + | * Ask Jérôme Servonnat for a port number on ciclad if you do not have one | ||
| + | * System dependent requirements: | ||
| + | * **Linux** and **Mac**: you should already be able to open a local terminal, and '' | ||
| + | * **Windows**: | ||
| + | * **Windows 7**: you have to install [[other: | ||
| + | * In the instructions below, replace '' | ||
| + | * **Windows 10**: ssh is already installed, but you may still want to install [[other: | ||
| + | * if you have installed [[https:// | ||
| + | |||
| + | ==== Digging ssh tunnels ==== | ||
| + | |||
| + | The ssh tunnels will allow you to connect a web browser running **locally** on your computer to a notebook server running on a **remote** server | ||
| + | |||
| + | === From a local LSCE computer to obelix === | ||
| + | |||
| + | ssh -L 7225: | ||
| + | |||
| + | === From a computer outside LSCE to obelix === | ||
| + | |||
| + | In that case, we have to go through the ssh1 gateway before connecting to obelix | ||
| + | |||
| + | < | ||
| + | |||
| + | |||
| + | plink -L 7225: | ||
| + | |||
| + | ssh -X -t -L7100: | ||
| + | |||
| + | plink -X -t -L7100: | ||
| + | |||
| + | plink -ssh -X -t -L 7100: | ||
| + | |||
| + | plink -X -t -L 7100: | ||
| + | |||
| + | ssh -X -t -L 7100: | ||
| + | |||
| + | (cdatm_py3) jypeter@obelix3 - ...jypeter - 44 >jupyter notebook --no-browser --port=7100 | ||
| + | [I 23: | ||
| + | [I 23: | ||
| + | [I 23: | ||
| + | [I 23: | ||
| + | [I 23: | ||
| + | [I 23: | ||
| + | [C 23: | ||
| + | |||
| + | To access the notebook, open this file in a browser: | ||
| + | file:/// | ||
| + | Or copy and paste one of these URLs: | ||
| + | http:// | ||
| + | |||
| + | ==== Extra resources ==== | ||
| + | |||
| + | * Jérôme' | ||
| + | * [[http:// | ||
| + | * [[https:// | ||
| + | * JYP's [[https:// | ||
| /* standard page footer */ | /* standard page footer */ | ||
other/uvcdat/cdat_conda/ipnb.1557914256.txt.gz · Last modified: by jypeter
