• NUS Information Technology | NUS IT Services, Solutions & Governance
  • NUS Information Technology | NUS IT Services, Solutions & Governance
  • Get Quote
  • NUS Information Technology | NUS IT Services, Solutions & Governance
    NUS Information Technology | NUS IT Services, Solutions & Governance
    • Milestones
    • Getting Started
      • HPC Portal
      • Register for HPC
      • Registration Guide
      • Introductory Guide for New HPC Users
      • How to Run Batch Job
    • Services
      • Data Processing, Storage & Management
      • Application Software
      • HPC Consulting Service
      • HPC GPU
      • Parallel Computing
      • Scientific Visualisation
  • myEmail    Staff Portal    Student Portal    A.S.K.
Home Services HPC Newsletter » Running HPC-AI Applications in Containers

Running HPC-AI Applications in Containers

Yeo Eng Hee, Research Computing, NUS Information Technology

The HPC-AI team in NUS IT has been providing high-performance computing resources for the University since the mid-90’s.  Both HPC-AI hardware and software application had been procured based on the requirements of the research computing community through the years.  As such, there is a long list of software that are currently installed in our systems, ranging from general purpose software such as Matlab and Mathematica, to more specialised ones such as Fluent and ABAQUS.  In recent years, with the growing popularity of AI and machine learning, we now have related software, such as Python, Julia and R in the list as well.

At the same time, as our user base grows, we see a potential issue in keeping up with the growing number of software that our users need.  One solution is to let the users bring in their own applications and run it in our HPC-AI clusters and a way to do this in a consistent manner is to use containers.

What are Containers?

Containers are basically isolated user space instances residing within the same operating system.  Unlike virtual machines, which run their own operating system within the virtualized machine instance, containers use resources that are exposed and shared by the host operating system.  As such, containers do not have access to all the resources in the host operating system, but can see the container’s contents and devices assigned by the host system.

How do I create my own containers?

In HPC-AI, we make use of Singularity as our container platform, a popular container platform in the HPC-AI world (Kurtzer, Sochat, & Bauer, 2017).  The steps to creating a container starts with the definition file, which is a set of blueprints explaining how to build the customised container.  The full details can be found in the software documentation[1].  The definition file sets the operating system to be used in the container, and once the base system is defined, the commands to install your software can be placed into the %post section.  A full definition file from the Singularity documentation is shown below:

Bootstrap: library
From: ubuntu:18.04
Stage: build

%setup
   touch /file1
    touch ${SINGULARITY_ROOTFS}/file2

%files
    /file1
    /file1 /opt

%environment
    export LISTEN_PORT=12345
    export LC_ALL=C

%post
    apt-get update && apt-get install -y netcat
    NOW=`date`
    echo "export NOW=\"${NOW}\"" >> $SINGULARITY_ENVIRONMENT

%runscript
    echo "Container was created $NOW"
    echo "Arguments received: $*"
    exec echo "$@"

%startscript
    nc -lp $LISTEN_PORT

%test
    grep -q NAME=\"Ubuntu\" /etc/os-release
    if [ $? -eq 0 ]; then
        echo "Container base is Ubuntu as expected."
    else
        echo "Container base is not Ubuntu."
        exit 1
    fi

%labels
    Author d@sylabs.io
    Version v0.0.1

%help
    This is a demo container used to illustrate a def file that uses all
    supported sections.
WORKS CITED

Kurtzer, G. M., Sochat, V., & Bauer, M. W. (2017). Singularity: Scientific containers for mobility of compute. PLOS ONE.

[1] See: https://sylabs.io/guides/3.7/user-guide/definition_files.html

NUS Information Technology | NUS IT Services, Solutions & Governance > Services > HPC Newsletter > » Running HPC-AI Applications in Containers
ALCA
National University of Singapore
  • 2 Engineering Drive 4
  • NUS Information Technology
  • Singapore 117584
  • 6516 2080
  • © National University of Singapore. All Rights Reserved.
       Legal        Branding guidelines