JupyterLab-Teaching

From Research Computing Center Wiki
Revision as of 12:50, 16 June 2021 by Moses (talk | contribs) (Created page with "Category:TeachCategory:SoftwareCategory:Programming === Category === Programming === Program On === Sapelo2 === Version === 5.0.0, 5.6.0, 6.0.3 === Author...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 11:16:00.939 NotebookApp] JupyterLab extension loaded from /apps/eb/Anaconda3/2020.02/lib/python3.7/site-packages/jupyterlab
[I 11:16:00.939 NotebookApp] JupyterLab application directory is /apps/eb/Anaconda3/2020.02/share/jupyter/lab
[I 11:16:00.942 NotebookApp] Serving notebooks from local directory: /home/zhuofei
[I 11:16:00.942 NotebookApp] The Jupyter Notebook is running at:
[I 11:16:00.942 NotebookApp] http://10.2.1.30:8888/?token=857f8a9f63cf42f698ac1845db64219516a23e248019cdeb
[I 11:16:00.942 NotebookApp]  or http://127.0.0.1:8888/?token=857f8a9f63cf42f698ac1845db64219516a23e248019cdeb
[I 11:16:00.942 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 11:16:00.947 NotebookApp] 
    
    To access the notebook, open this file in a browser:
        file:///home/zhuofei/.local/share/jupyter/runtime/nbserver-14353-open.html
    Or copy and paste one of these URLs:
        http://10.2.1.30:8888/?token=857f8a9f63cf42f698ac1845db64219516a23e248019cdeb
     or http://127.0.0.1:8888/?token=857f8a9f63cf42f698ac1845db64219516a23e248019cdeb

Copy and paste the token, which in the example above is 857f8a9f63cf42f698ac1845db64219516a23e248019cdeb, 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