User Tools

Site Tools


playground:playground

This is an old revision of the document!


**Playground Test edits by MSovara**

Jupyter / Ipython Notebook

Jupyter is installed in most of the python modules. To make use of it you would do something like:

jupyter-notebook

However using it effectively on the cluster is a bit more complicated…

After Logging in your account check for your preferred python version as follows:

module avail 2>&1 | grep python

Now proceed to request for an interactive compute node where a configuration file and security measures will be established. A single core on an interactive node has proven sufficient for this exercise. Request an arbitrary interactive compute node as follows:

qsub -I -P PROJ0101 -q serial -l select=1:ncpus=1:mpiprocs=1:nodetype=haswell_reg

Note:

  1. “PROJ0101” is an arbitrary project name, kindly use your research project's shortname e.g. ERTH0859
  2. Record the cnode ID because you will ssh into that particular compute node when setting up your password.
  3. Advanced interactive compute node settings are found here: Example interactive job request.

In your interactive compute node, load the preferred python module as follows:

module add chpc/python/3.6.0_gcc-6.3.0

Security

You are not the only person on the system, so it is important to set up authentication on your notebook so that not everyone gets access to your notebook (and worse – your data).

So first one needs a configuration file, this can be done by passing the generate-config parameter to jupyter as follows:

[USERNAME@cnode0010 ~]$ jupyter-notebook --generate-config

Note

  1. This writes default config to: /home/USERNAME/.jupyter/jupyter_notebook_config.py
  2. The output file “jupyter_notebook_config.py” will be listed as a hidden file. Thus, to view it do a $ ls -a

Next you need to generate your password (remember it – you'll need it when you connect later):

python
from notebook.auth import passwd
passwd()
Enter password:
Verify password:
'sha1:f27008fdb0eb:4c2f305d5e230edca16c7059882ba3ba63bee03b'

Use the following command to access the “jupyter_notebook_config.py” file $ cd /home/USERNAME/.jupyter/jupyter_notebook_config.py Now edit the jupyter_notebook_config.py file, specifically edit the c.NotebookApp.passwd line (remember to uncomment it, and don't just copy and paste my hash in).

c.NotebookApp.password = 'sha1:f27008fdb0eb:4c2f305d5e230edca16c7059882ba3ba63bee03b'
/app/dokuwiki/data/attic/playground/playground.1614090498.txt.gz · Last modified: 2021/12/09 16:42 (external edit)