Jupyter-Sapelo2: Difference between revisions

From Research Computing Center Wiki
Jump to navigation Jump to search
Line 105: Line 105:
After running the steps above, establish a another ssh tunnel from your desktop or laptop to sapelo2 login node at port NOTEBOOKPORT.  
After running the steps above, establish a another ssh tunnel from your desktop or laptop to sapelo2 login node at port NOTEBOOKPORT.  


=====For Mac/Linux Users====
=====For Mac/Linux Users=====


If you are using a Linux or Apple machine for your desktop or laptop you can use the following command to establish the ssh tunnel
If you are using a Linux or Apple machine for your desktop or laptop you can use the following command to establish the ssh tunnel

Revision as of 11:06, 5 November 2020

Category

Programming

Program On

Sapelo2

Version

5.0.0, 5.6.0, 6.0.3

Author / Distributor

Jupyter

Description

"The Jupyter Notebook is a web application that allows you to create and share documents that contain live code, equations, visualizations and explanatory text" Jupyter

Running Program

Versions

Please also refer to Running Jobs on Sapelo2.

  • Jupyter 5.0.0 is installed as part of Anaconda3 5.0.1 with python 3.6.3. This version is installed at /apps/eb/Anaconda3/5.0.1
  • Jupyter 5.6.0 is installed as part of Anaconda2 5.3.0 with python 2.7.15. This version is installed at /apps/eb/Anaconda2/5.3.0
  • Jupyter 6.0.3 is installed as part of Anaconda3 2020.02 with python 3.7.6. This version is installed at /apps/eb/Anaconda3/2020.02


Please note: You do not have to install jupyter notebook on your local machine.

To use Jupyter 5.0.0, please load the module:

module load Anaconda3/5.0.1


To use Jupyter 5.6.0, please load the module:

module load Anaconda2/5.3.0


To use Jupyter 6.0.3, please load the module:

module load Anaconda3/2020.02

To use Jupyter notebook on sapelo2 with an interactive job

The port number for the jupyter notebook server should be some random value between 8000 and 10000. Assign this value to the variable 'NOTEBOOKPORT' in the submission script below replacing 8888. Please do not use 8888. If more than one person uses that same value you cannot establish the ssh tunnel

Sample steps to use jupyter 6.0.3, once you connect to sapelo2:

qlogin

NOTEBOOKPORT=8888

IPUSED=$(hostname -i)

echo "NOTEBOOKPORT is " $NOTEBOOKPORT

echo "IPUSED is " $IPUSED

module load Anaconda3/2020.02

jupyter-notebook --port $NOTEBOOKPORT --ip=$IPUSED --no-browser

After running the steps above, establish a another ssh tunnel from your desktop or laptop to sapelo2 login node at port NOTEBOOKPORT.

For Mac/Linux Users

If you are using a Linux or Apple machine for your desktop or laptop you can use the following command to establish the ssh tunnel

Make sure you replace NOTEBOOKPORT and IPUSED below with the port number and the IP address you are using (see the output of the echo commands above)

ssh -N -L NOTEBOOKPORT:IPUSED:NOTEBOOKPORT username@sapelo2.gacrc.uga.edu 

Unless you have ssh key configured, you will be prompted for your MyID password and for Archpass Duo authentication. Once authentication is established, this session prompt will hang and you are ready to go to the next step.

For Windows Users

If you are using a Windows machine for your desktop or laptop download the plink program to use in place of the ssh client. The command for windows would be as follows: Assuming the plink.exe is in the current directory where you have a command window open.


Make sure you replace NOTEBOOKPORT and IPUSED below with the port number and the IP address you are using (see the output of the echo commands above)

plink -ssh -N -L NOTEBOOKPORT:IPUSED:NOTEBOOKPORT username@sapelo2.gacrc.uga.edu

Once you establish the ssh tunnel by running the command above you can access the Jupyter notebook by going to http://localhost:NOTEBOOKPORT using the browser on your desktop or laptop (make sure you replace NOTEBOOKPORT with the port number you used in the qlogin session). If the page displayed on the browser asks for a token or password, you can check the token shown in your qlogin session and copy and paste it into the token field in the page displayed in your browser. For example, the qlogin terminal might show something like this:


[I 15:02:58.309 NotebookApp] JupyterLab alpha preview extension loaded from /usr/local/apps/eb/Anaconda3/5.0.1/lib/python3.6/site-packages/jupyterlab
JupyterLab v0.27.0
Known labextensions:
[I 15:02:58.312 NotebookApp] Running the core application with no additional extensions or settings
[I 15:02:58.348 NotebookApp] Serving notebooks from local directory: /home/shtsai/sapelo2/tests/jupyter
[I 15:02:58.349 NotebookApp] 0 active kernels 
[I 15:02:58.349 NotebookApp] The Jupyter Notebook is running at: http://10.56.13.168:8812/?token=e53a8f93b9506136dcdb8632f078ed64896dafee66032f16
[I 15:02:58.349 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 15:02:58.351 NotebookApp] 
    
    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://10.56.13.168:8812/?token=e53a8f93b9506136dcdb8632f078ed64896dafee66032f16

Copy and paste the token, which in the example above is e53a8f93b9506136dcdb8632f078ed64896dafee66032f16, into the proper field in the page displayed in your browser.

Documentation

Details at https://jupyter.readthedocs.io/en/latest/index.html

System

64-bit Linux