Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

Connecting to Singularity/Apptainer Containers

The following contains a guide how to actively develop in a Singularity/Apptainer container. See Singularity/Apptainer for more information on the singularity  module. Both Singularity and Apptainer are largely compatible with each other, and in fact you run the container with the singularity  command regardless of which module you use.

...

This guide was contributed by our GPU users Anwai Archit and Arne Nix who kindly provided this documentation. It is lightly edited to fit the format of this page and fix a few typos. Any place you see "singularity", you could replace it with "apptainer" if you use the apptainer  module instead. It was written for the Grete GPU nodes of Emmy, but can be easily translated to other partitions/clusters (see /wiki/spaces/PUB/pages/428683 for more information). Obviously, rename any directories and files as makes sense for your user name, the SIF container file you use, and the names of your files and directories.

Starting a Singularity Container

First we need to setup a singularity container and submit it to run on a GPU node. For me this is done by the following SBATCH script:

...

  1. We need to load cuda  and singularity  to have it available to our container.
  2. We need to bind $HOME/.vscode-server  to the same place in the container.
  3. We need to remember the name of our container. In this case: anix_dev-0
  4. We need to keep the script running in order to not loose the node. This is achieved by sleep infinity .

SSH Config to Connect to the Container

We want to connect to the container via ssh. For this, setup the following configuartion in ~/.ssh/config  on your local machine.

...

  1. Connection to the login node: ssh hlrn 
  2. Connection to a compute node that we obtained through the scheduler, e.g. ssh hlrn-ggpu02 
  3. Connection to the singularity container running on a compute node, e.g. ssh hlrn-ggpu02-singularity 

Connecting VS-Code to the Container

This follows mostly the tutorial here. Then add the following lines:

...