Containers in Supercomputing Environment

In this tutorial, you will learn how to:

Accessing custom Jupyter notebooks via Puhti web interface

A custom Jupyter notebook to meet the needs of your computing environment can be provisioned at CSC through Puhti web interface. Here are minimal instructions for setting up your Jupyter notebook on Puhti supercomputer:

Installing necessary computing environment to projappl directory using tykky wrapper tool

Tykky container wrapper installs your software tools/packages as a container image for improved performance metrics such as faster startup times, reduced I/O load, and fewer number of file creations on Lustre parallel filesystems. For the purpose of this tutorial, we use NMRLipids course set up which needs installation of several python packages for Jupyter notebook. Please install all needed computing environment in the projappl directory.

Install python packages for course using tykky wrapper as below:

# Navigate to the scratch area of your course project 
cd /scratch/project_xxxx/      # Make sure to replace project_xxxx with correct project number

# As a starting point, you can download all necessary template files for the 
# customising course environment from allas object storage (as shown below). 
# The downloaded template files include a module environment file namely,  NMRLipids-course.lua 
#  and resource specifications file, NMRLipids-course-resources.yaml files. You can find more information about these files later.

wget https://a3s.fi/CSC_training/Puhti_web_helper.tar.gz && tar -xavf Puhti_web_helper.tar.gz
cd Puhti_web_helper
module load tykky
mkdir -p /projappl/project_xxxx/$USER and mkdir -p /projappl/project_xxxx/$USER/NMRLipids  
# You can write all needed python packages in yaml as in env_nmr.yml for NMRLpids course and install with tykky
conda-containerize new --prefix /projappl/project_xxxx/$USER/NMRLipids  env_nmr.yml  #  Installation can take for a while

Tykky would install all needed packages (as listed in the file, env_nmr.yml) to the directory /projappl/project_xxxx/$USER/NMRLipids. Please note that you have to provide absolute path of bin directory (which exists inside the folder of /projappl/project_xxxx/$USER/NMRLipids) in the “.lua” file

Creating a custom environment in Puhti web interface

The template files for custom notebook environment have to be added under the directory /projappl/project_xxxx/www_puhti_modules/ in order te be visible in Puhti web interface. The www_puhti_modules directory can be created if it does not exist.

The two files needed for setting up the course modules are:

In this NMRLipids course example, the above-mentioned two template files (NMRLipids-course-resources.yml and NMRLipids-course.lua) are available in the folder ‘Puhti_web_helper’ that you have downloaded from allas. so just modify cautiously for your own installation and place them in www_puhti_modules folder as below:


# Make sure to use correct project number (in two places in NMRLipids-course.lua file) and your CSC username in the the copied files in
# /projappl/project_xxxx/www_puhti_modules.

mkdir -p /projappl/project_xxxx/www_puhti_modules && cp NMRLipids-course-resources.yml NMRLipids-course.lua /projappl/project_xxxx/www_puhti_modules

As the name of the “.lua” file will appear as custom notebook environment on Puhti web inaterface, please use some unique name for .lua and .yaml file (e.g., add your CSC user name in the file name e.g., NMRLipids-course-yourcscusername.lua) in this course environment.

cd /projappl/project_xxxx/www_puhti_modules
# add your CSC username in .lua and .yaml file names
mv  NMRLipids-course-resources.yml  NMRLipids-course-yourcscusername-resources.yml
mv  NMRLipids-course.lua  NMRLipids-course-yourcscusername.lua 

Access custom notebook via Puhti web interface

  1. Log in to Puhti web interface
  2. Login with CSC/HAKA/VIRTU credentials (Users should have accepted Puhti service in myCSC page under a course (or own) project before using this service).
  3. Once login is successful, select “Interactive Sessions” icon on the top menu bar and then click “Jupyter for courses”. you can then see the different fields for filling in before launching as a batch job. First select the “Project” and “Working directory” and then you will be able to see “NMRLipids-course-yourcscusername” module under the “Course module” field. You can then launch Jupyter notebook which will be launched in the interactive partition. You can also change the default settings by checking “Show custom resource settings”.
  4. Upon successful launching a job, you can click on “Connect to Jupyter” to see the course notebook corresponding to your course environment.

Useful CSC documentation