Namespaces

Variants
Actions
Personal tools

Jupyter

From UABgrid Documentation

(Difference between revisions)
Jump to: navigation, search
(putty port forward link added)
(Adding GPU info, cleanup)
Line 1: Line 1:
 
[http://jupyter.org/ Jupyter Notebook]  is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. For more information on jupyter notebook, click [http://jupyter.org/documentation here].
 
[http://jupyter.org/ Jupyter Notebook]  is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. For more information on jupyter notebook, click [http://jupyter.org/documentation here].
  
== Jupyter on Cheaha ==
+
= Jupyter on Cheaha =
  
 
The cheaha cluster supports Jupyter notebooks for data analysis, but such jobs should be running using the SLURM job submission system to avoid overloading the head node. To run a Jupyter Notebook on cheaha, login to cheaha from your client machine and start an [https://docs.uabgrid.uab.edu/wiki/Slurm#Interactive_Job interactive job].  
 
The cheaha cluster supports Jupyter notebooks for data analysis, but such jobs should be running using the SLURM job submission system to avoid overloading the head node. To run a Jupyter Notebook on cheaha, login to cheaha from your client machine and start an [https://docs.uabgrid.uab.edu/wiki/Slurm#Interactive_Job interactive job].  
Line 7: Line 7:
 
One important note is that cheaha only supports openssh, you should be able to use native ssh from Mac or Linux machines. Windows 10 supports openssh as well, but it is not enabled by default. On updated Windows 10 machines, '''a Developers Command Prompt''' (available via searching from the Start Menu) is able to run openssh via the ssh command similar to Mac and Linux users. Another option for Windows machines is the installation of Cygwin. Putty has been  [[Setting_Up_VNC_Session#Port-forwarding_from_Windows_Systems|tested]], but does not work reliably on cheaha for proxying connections.
 
One important note is that cheaha only supports openssh, you should be able to use native ssh from Mac or Linux machines. Windows 10 supports openssh as well, but it is not enabled by default. On updated Windows 10 machines, '''a Developers Command Prompt''' (available via searching from the Start Menu) is able to run openssh via the ssh command similar to Mac and Linux users. Another option for Windows machines is the installation of Cygwin. Putty has been  [[Setting_Up_VNC_Session#Port-forwarding_from_Windows_Systems|tested]], but does not work reliably on cheaha for proxying connections.
  
 +
== Starting the Jupyter Notebook ==
 
<pre>
 
<pre>
 
srun --ntasks=1 --cpus-per-task=4 --mem-per-cpu=4096 --time=08:00:00 --partition=medium --job-name=JOB_NAME --pty /bin/bash
 
srun --ntasks=1 --cpus-per-task=4 --mem-per-cpu=4096 --time=08:00:00 --partition=medium --job-name=JOB_NAME --pty /bin/bash
Line 13: Line 14:
 
jupyter notebook --no-browser --ip=$host
 
jupyter notebook --no-browser --ip=$host
 
</pre>
 
</pre>
 +
 +
== Heavy Data IO option ==
 
Additionally, if anticipating large IO data transfer adjust the run command to set a higher data rate limit as shown below:
 
Additionally, if anticipating large IO data transfer adjust the run command to set a higher data rate limit as shown below:
 
<pre>
 
<pre>
 
jupyter notebook --no-browser --ip=$host --NotebookApp.iopub_data_rate_limit=1.0e10  
 
jupyter notebook --no-browser --ip=$host --NotebookApp.iopub_data_rate_limit=1.0e10  
 +
</pre>
 +
== GPU Option ==
 +
Finally, if your job requires a GPU then add the [https://docs.uabgrid.uab.edu/wiki/Slurm#Requesting_for_GPUs gres and partition arguments] as shown below:
 +
<pre>
 +
srun --ntasks=1 --cpus-per-task=1 --mem-per-cpu=4096 --time=08:00:00 --partition=pascalnodes --job-name=JOB_NAME --gres=gpu:1 --pty /bin/bash
 
</pre>
 
</pre>
  
 +
== Copy notebook settings ==
 
After running the jupyter notebook command the server should start running and provide you with a URL including a port # (typically but not always 8888) and a compute node on cheaha (for example C0047) that looks something like this:
 
After running the jupyter notebook command the server should start running and provide you with a URL including a port # (typically but not always 8888) and a compute node on cheaha (for example C0047) that looks something like this:
 
<pre>
 
<pre>
Line 26: Line 35:
 
</pre>
 
</pre>
  
Now, start up a new tab/terminal/window on your client machine, and relogin to cheaha, using
+
== Proxy Connection Locally ==
 +
Now, start up a '''new''' tab/terminal/window on your client machine and relogin to cheaha, using
 
<pre>
 
<pre>
 
ssh -L 88XX:c00XX:88XX BLAZERID@cheaha.rc.uab.edu
 
ssh -L 88XX:c00XX:88XX BLAZERID@cheaha.rc.uab.edu
Line 34: Line 44:
 
* '''88XX''' is the port that the notebook is running, for example 8888
 
* '''88XX''' is the port that the notebook is running, for example 8888
  
 +
== Access Notebook through Local Browser via Proxy Connection ==
 
Now access the link on your client machine browser locally using the link generated by jupyter notebook by '''substituting in localhost instead of c00XX'''. Make sure you have the correct port as well.
 
Now access the link on your client machine browser locally using the link generated by jupyter notebook by '''substituting in localhost instead of c00XX'''. Make sure you have the correct port as well.
 
<pre>
 
<pre>

Revision as of 10:16, 12 September 2018

Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. For more information on jupyter notebook, click here.

Contents

Jupyter on Cheaha

The cheaha cluster supports Jupyter notebooks for data analysis, but such jobs should be running using the SLURM job submission system to avoid overloading the head node. To run a Jupyter Notebook on cheaha, login to cheaha from your client machine and start an interactive job.

One important note is that cheaha only supports openssh, you should be able to use native ssh from Mac or Linux machines. Windows 10 supports openssh as well, but it is not enabled by default. On updated Windows 10 machines, a Developers Command Prompt (available via searching from the Start Menu) is able to run openssh via the ssh command similar to Mac and Linux users. Another option for Windows machines is the installation of Cygwin. Putty has been tested, but does not work reliably on cheaha for proxying connections.

Starting the Jupyter Notebook

srun --ntasks=1 --cpus-per-task=4 --mem-per-cpu=4096 --time=08:00:00 --partition=medium --job-name=JOB_NAME --pty /bin/bash
module load Anaconda3/5.2.0
unset XDG_RUNTIME_DIR
jupyter notebook --no-browser --ip=$host

Heavy Data IO option

Additionally, if anticipating large IO data transfer adjust the run command to set a higher data rate limit as shown below:

jupyter notebook --no-browser --ip=$host --NotebookApp.iopub_data_rate_limit=1.0e10 

GPU Option

Finally, if your job requires a GPU then add the gres and partition arguments as shown below:

srun --ntasks=1 --cpus-per-task=1 --mem-per-cpu=4096 --time=08:00:00 --partition=pascalnodes --job-name=JOB_NAME --gres=gpu:1 --pty /bin/bash

Copy notebook settings

After running the jupyter notebook command the server should start running and provide you with a URL including a port # (typically but not always 8888) and a compute node on cheaha (for example C0047) that looks something like this:

  
    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://c0047:8888/?token=73da89e0eabdeb9d6dc1241a55754634d4e169357f60626c&token=73da89e0eabdeb7d6dc1241a55754634d4e169357f60626c

Proxy Connection Locally

Now, start up a new tab/terminal/window on your client machine and relogin to cheaha, using

ssh -L 88XX:c00XX:88XX BLAZERID@cheaha.rc.uab.edu

Note:

  • c00XX is the compute node where you started the jupyter notebook, for example c0047
  • 88XX is the port that the notebook is running, for example 8888

Access Notebook through Local Browser via Proxy Connection

Now access the link on your client machine browser locally using the link generated by jupyter notebook by substituting in localhost instead of c00XX. Make sure you have the correct port as well.

http://localhost:88XX/?token=73da89e0eabdeb9d6dc1241a55754634d4e169357f60626c&token=73da89e0eabdeb7d6dc1241a55754634d4e169357f60626c

A Jupyter notebook should then open in your browser.