This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
other:uvcdat:cdat_conda:ipnb [2019/05/15 15:13] jypeter |
other:uvcdat:cdat_conda:ipnb [2019/05/16 08:52] jypeter Updated |
||
---|---|---|---|
Line 47: | Line 47: | ||
- in a web browser, open the temporary URL displayed by the ipython server and start using the ipython notebooks | - 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</wrap> by typing ''^C^C'' (2x ''CTRL-C''). Otherwise the server and the python processes started by the server will keep on using resources on the computer | - when you are finished, <wrap em>do not forget to kill the ipython server</wrap> by typing ''^C^C'' (2x ''CTRL-C''). Otherwise the server and the python processes started by the server will keep on using resources on the computer | ||
- | * Warning! Closing the browser, or using the Logout button in the browser will not stop the ipython server | + | * Warning! Closing the browser, or using the Logout button in the browser will not stop the ipython server |
+ | |||
+ | ===== Working correctly with the notebooks ===== | ||
+ | |||
+ | ==== Reminder ==== | ||
+ | |||
+ | * Make sure you read and understand the [[#how_does_it_work|How does it work?]] section above | ||
+ | * If you have a python installed **on your own desktop/laptop**, you can just start a local notebook server and browser with\\ ''jupyter notebook'' | ||
+ | * **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 ==== | ||
+ | |||
+ | * We assume that you have a local web browser installed!\\ Depending on your (local) computer: | ||
+ | * **Linux**: you should already be able to open a local terminal, and ''ssh'' is installed by default | ||
+ | * **Windows 7**: you need to know how to open a Windows prompt/command-line (''Windows''+''R'', then open ''cmd'') and you need to install [[other:win10apps#putty_pageant|Putty]] in order to use ''ssh'': | ||
+ | * In the instructions below, replace ''ssh'' with ''plink'' if you are using Windows 7 | ||
+ | |||
+ | ==== 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 === | ||
+ | |||
+ | <code>plink -L 7225:localhost:7225 jypeter@obelix | ||
+ | |||
+ | |||
+ | plink -L 7225:localhost:7225 jypeter@obelix | ||
+ | |||
+ | ssh -X -t -L7100:localhost:7100 jypeter@ssh1.lsce.ipsl.fr ssh -L7100:localhost:7100 obelix | ||
+ | |||
+ | plink -X -t -L7100:localhost:7100 jypeter@ssh1.lsce.ipsl.fr ssh -L7100:localhost:7100 obelix | ||
+ | |||
+ | plink -ssh -X -t -L 7100:localhost:7100 jypeter@ssh1.lsce.ipsl.fr ssh -L7100:localhost:7100 obelix | ||
+ | |||
+ | plink -X -t -L 7100:localhost:7100 jypeter@ssh1.lsce.ipsl.fr ssh -L7100:localhost:7100 obelix | ||
+ | |||
+ | ssh -X -t -L 7100:localhost:7100 jypeter@ssh1.lsce.ipsl.fr ssh -L 7100:localhost:7100 obelix | ||
+ | |||
+ | (cdatm_py3) jypeter@obelix3 - ...jypeter - 44 >jupyter notebook --no-browser --port=7100 | ||
+ | [I 23:37:26.017 NotebookApp] [nb_conda_kernels] enabled, 14 kernels found | ||
+ | [I 23:37:26.977 NotebookApp] [nb_conda] enabled | ||
+ | [I 23:37:26.978 NotebookApp] Serving notebooks from local directory: /home/users/jypeter | ||
+ | [I 23:37:26.978 NotebookApp] The Jupyter Notebook is running at: | ||
+ | [I 23:37:26.978 NotebookApp] http://localhost:7100/?token=256f8fa26c8478f136720e0c0c24c4995b6682d9febf6387 | ||
+ | [I 23:37:26.978 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). | ||
+ | [C 23:37:26.992 NotebookApp] | ||
+ | |||
+ | To access the notebook, open this file in a browser: | ||
+ | file:///home/users/jypeter/.local/share/jupyter/runtime/nbserver-1442-open.html | ||
+ | Or copy and paste one of these URLs: | ||
+ | http://localhost:7100/?token=256f8fa26c8478f136720e0c0c24c4995b6682d9febf6387</code> | ||
/* standard page footer */ | /* standard page footer */ |