wiki:hpc:usage_of_slurm_within_a_singularity_container
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | wiki:hpc:usage_of_slurm_within_a_singularity_container [2020/05/12 22:26] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======= Usage of Slurm within a Singularity Container ======= | ||
+ | When working with complex codes that require a certain environment to work, e.g. specific software of a specific version it might be useful to provide this code as a singularity container to other users. | ||
+ | The user may then work with (execute) this singularity container on the GWDG HPC system as is explained [[https:// | ||
+ | One obstacle, however, is that from within the singularity container one cannot execute slurm commands (or equally pbs commands which are outdated and therefore will not be discussed here) by default. | ||
+ | |||
+ | This page serves as a tutorial on how to achieve the usage of slurm from a singularity container on the SCC of the GWDG (as of 2020-05-12). The explanations operate under the assumption that the singularity container ''< | ||
+ | |||
+ | =====Short Summary===== | ||
+ | |||
+ | In order to execute a slurm command from inside a singularity container follow these steps: | ||
+ | < | ||
+ | singularity shell -B / | ||
+ | >> export LD_LIBRARY_PATH=/ | ||
+ | >> echo " | ||
+ | >> echo " | ||
+ | >> < | ||
+ | >> / | ||
+ | >> < | ||
+ | </ | ||
+ | |||
+ | =====Detailed Explanation===== | ||
+ | |||
+ | Two steps are necessary in the procedure: | ||
+ | |||
+ | ====Step 1: Binding Files/Paths into the Container==== | ||
+ | |||
+ | First, the container needs to have access to the installation of slurm on the host system, i.e. the SCC, and to various other required libraries. Therefore one needs to bind the following paths/files when starting the container: | ||
+ | - ''/ | ||
+ | - ''/ | ||
+ | - ''/ | ||
+ | - ''/ | ||
+ | - ''/ | ||
+ | - ''/ | ||
+ | - ''/ | ||
+ | - ''/ | ||
+ | such that the final command for executing a command in ''< | ||
+ | < | ||
+ | singularity exec -B / | ||
+ | </ | ||
+ | Here, 1. lets the container know where to find slurm on the host system, 2. - 4. provide necessary libraries for slurm itself (Note that problems may occur if your container needs a different major version of any of these libraries!), | ||
+ | |||
+ | ====Step 2: Adjust Settings inside the Container==== | ||
+ | |||
+ | Having started a container the following commands have to be executed once //within// the container to allow for it to make use of the libraries/ | ||
+ | -'' | ||
+ | -'' | ||
+ | -'' | ||
+ | The first command just adds a new path to the library path, thereby letting the container know that new libraries are to be loaded in ''/ | ||
+ | |||
+ | =====Remarks on Optimum Usage===== | ||
+ | |||
+ | Starting a singularity container is quite cumbersome for the operating system of the host and, in case too many requests to start a singularity container are received at the same time, it might fail. It is, hence, beneficial to keep the calls to singularity itself to a minimum. | ||
+ | |||
+ | Therefore, the usage of the '' | ||
+ | < | ||
+ | < | ||
+ | singularity exec -B / | ||
+ | < | ||
+ | </ | ||
+ | with ''< | ||
+ | < | ||
+ | < | ||
+ | export LD_LIBRARY_PATH=/ | ||
+ | echo " | ||
+ | echo " | ||
+ | / | ||
+ | < | ||
+ | </ | ||
+ | The prefix to the slurm command (''/ | ||
+ | < | ||
+ | export PATH=opt/ | ||
+ | </ | ||
+ | which may be added to ''< |
wiki/hpc/usage_of_slurm_within_a_singularity_container.txt · Last modified: 2020/05/12 22:26 by 127.0.0.1