Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Upon connecting, you are presented the jupyter dashboard which serves as your home page for jupyter notebook. The Jupyter Notebook screen is rather simple with 3 tabs:

  • Files: (Default selected) Interactive view of the portion of the filesystem accessible by the user, rooted by the directory in which the notebook was launched from.

  • Running: Displays currently running notebooks known to the server. (You can manage notebook kernels from here)

  • Clusters: Gives a summary of iPython Parallel clusters
    (More about this later)

...

What are Kernels?

A Jupyter kernel is the computational engine behind the code execution in Jupyter notebooks.

Most users think of this as the “compiler” or programming language used when running code cells.
The Kernel empowers you to execute code in different programming languages like Python, R, or Julia or other languages and instantly view the outcomes within the notebook interface.

After opening a new notebook, you will be prompted to select a kernel

  • If you have never created a kernel to use, you will only see a list of default Jupyter kernels available on the cluster

  • You may check the box to start with the preferred kernel every time you open a notebook

Image Modified

Default Kernels on ARCC HPC Resources include:

  • Python Kernels

  • R Kernels

HPC-wide kernels are titled by packages installed and available when launched

Users can also create user-defined kernels from conda environments (Covered in a subsequent module. See: Launching Jupyter Kernels from Conda Environments)

Image ModifiedImage Modified

...

Open a New Blank Notebook

...

Code

  • Code cells allow you to write and run programming code in a language of your choosing (e.g., Python)

  • Languages supported in Jupyter include Python, R, Julia, and many others

  • On ARCC HPC resources, we support jupyter code in Python and R

  • After running, they can and usually do provide some form of output

...

Markdown

  • Text Cells allowing you to write and render Markdown syntax

  • Where you describe and document your workflow

Image Removed

Markdown

  • Text Cells allowing you to write and render Markdown syntax

  • Where you describe and document your workflow

Image Removed
Image Added

...

Raw NBConvert

  • Stands for “Raw Notebook Convert”

  • Retains any text in these cells in their raw form and does not run them

  • Enables the conversion of your notebook to another format as given by the FORMAT string using Jinja templates.

    • Presenting: PDF

    • Publishing: LaTeX

    • Collaboration

    • Sharing: HTML

  • Setting to “none” just makes it a “Raw” cell in which nothing is run on it.

...

Running with a Python kernel, we can use our jupyter notebook to get this information from the system:

  1. import the python OS module (to let us interact with the native OS on the cluster that Jupyter is running on top of)

  2. On the next line, type os.getcwd() (AKA: get current working directory)

  3. Click the run button to run our cell and generate a new output cell, which also creates a new input cell below that.

Note: New input cells are code cell types by default
With the information from our output cell, we can conclude that OnDemand launches Jupyter from your $HOME
Image RemovedImage Added

import os : import a python module allowing us to use python kernel running this notebook to interact with underlying HPC cluster’s OS

os.getcwd(): a python command to output the full system path in which our active jupyter notebook resides.

...

How to get to directories outside of $HOME?

If we select the default Python 3 (ipykernel), we are presented with the file explorer showing our home directory as it’s rooted location. This means we can’t go up any further in system’s directory structure.

  • With our local root location for the notebook set to our $HOME, we are unable to see our /project and /gscratch directories on the cluster.

  • To expose these folders to the jupyter environment, create a symbolic link (aka shortcut) within our /home.

Image Removed

Image Added

  • Instructions for creating a symbolic link may be found here or expanded in the cell to the right

Expand
titleSteps to create a symbolic link
  1. Open an ssh connection to the HPC cluster with:
    ssh your_username@clustername.arcc.uwyo.edu
    or open a shell through OnDemand:

    Image Modified
  2. In the shell/terminal interface, create a symbolic link to your project (replacing project_name with the name of your project) with:

[~] ln -s /project/project_name/ project

  1. In the shell/terminal interface, create a symbolic link to your gscratch (replacing username with the your username on the HPC) with:

[~] ln -s /gscratch/username/ gscratch

...

What Packages are Available in our Kernel?

...