Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
software:singularity:caviness [2018-08-08 18:04] – created anita | software:singularity:caviness [2024-08-27 17:51] (current) – anita | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======= Singularity on Caviness ====== | + | ======= |
+ | |||
+ | ===== Build a Singularity container ===== | ||
+ | |||
+ | There are several ways to get a Singularity container onto Caviness, but here are the two to consider using if reproducibility is important. | ||
+ | |||
+ | * You can build a Singularity container from a Docker or Singularity Hub on Caviness. | ||
+ | * You can build a container on your local system and copy it to Caviness. | ||
+ | |||
+ | ==== Build a Singularity container from Docker or Singularity Hub Registry ==== | ||
+ | |||
+ | Caviness does not support Docker, but you can build a Singularity container from an existing Docker container or from a Singularity Hub container regsitry. Starting on the head node, load the Singularity software into your environment using VALET, and build your container. | ||
+ | |||
+ | === Docker Hub example === | ||
+ | |||
+ | < | ||
+ | $ vpkg_require singularity | ||
+ | $ singularity build tensorflow.simg docker:// | ||
+ | </ | ||
+ | |||
+ | === Singularity Hub example === | ||
+ | |||
+ | < | ||
+ | $ vpkg_require singularity | ||
+ | $ singularity build hello-world.simg shub:// | ||
+ | </ | ||
+ | |||
+ | More details on this can be found in the [[http:// | ||
+ | |||
+ | One example of a container registry is [[https:// | ||
+ | |||
+ | ==== Build a container on your local system ==== | ||
+ | |||
+ | You can build your Singularity container on your local system, installing the singularity program if you need to. For more information on how to do this, see the [[http:// | ||
+ | |||
+ | ===== Execute your Singularity container through SLURM ===== | ||
+ | |||
+ | Once your container is on Caviness you can run it. Containers must run on Caviness' | ||
+ | |||
+ | ==== Inside your interactive session or your batch job you must first issue the command ==== | ||
+ | |||
+ | < | ||
+ | vpkg_require singularity | ||
+ | </ | ||
+ | |||
+ | Then you can use the singularity commands to execute your container, like the example below. | ||
+ | |||
+ | < | ||
+ | [traine@login01 ~]$ workgroup -g it_css | ||
+ | [(it_css: | ||
+ | salloc: Granted job allocation 844 | ||
+ | salloc: Waiting for resource configuration | ||
+ | salloc: Nodes r00n45 are ready for job | ||
+ | [traine@r00n45 ~]$ vpkg_require singularity | ||
+ | Adding package `singularity/ | ||
+ | [traine@r00n45 ~]$ singularity shell tensorflow.simg | ||
+ | Singularity: | ||
+ | |||
+ | Singularity tensorflow.simg: | ||
+ | usage: tensorboard [-h] [--logdir PATH] [--host ADDR] [--port PORT] | ||
+ | | ||
+ | [--db URI] [--inspect] [--tag TAG] [--event_file PATH] | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | TensorBoard is a suite of web applications for inspectinng and understanding | ||
+ | your TensorFlow runs and graphs. https:// | ||
+ | |||
+ | Singularity tensorflow.simg: | ||
+ | Cpus_allowed_list: | ||
+ | Singularity tensorflow.simg: | ||
+ | exit | ||
+ | [traine@r00n45 ~]$ | ||
+ | </ | ||
+ | |||
+ | ==== Troubleshooting ==== | ||
+ | |||
+ | === Locale error === | ||
+ | |||
+ | If you experience the error below after starting a particular shell container, then it is likely due to your current locale not being supported in this particular container' | ||
+ | |||
+ | <code bash> | ||
+ | [traine@r00n45 ~]$ vpkg_require singularity | ||
+ | Adding package `singularity/ | ||
+ | [traine@r00n45 ~]$ singularity shell tensorflow.simg | ||
+ | Singularity: | ||
+ | |||
+ | Singularity tensorflow.simg: | ||
+ | Traceback (most recent call last): | ||
+ | File "/ | ||
+ | sys.exit(run_main()) | ||
+ | File "/ | ||
+ | program.setup_environment() | ||
+ | File "/ | ||
+ | util.setup_logging() | ||
+ | File "/ | ||
+ | locale.setlocale(locale.LC_ALL, | ||
+ | File "/ | ||
+ | return _setlocale(category, | ||
+ | locale.Error: | ||
+ | </ | ||
+ | |||
+ | Once you start the container shell, check which locale' | ||
+ | |||
+ | <code bash> | ||
+ | Singularity tensorflow.simg: | ||
+ | locale: Cannot set LC_CTYPE to default locale: No such file or directory | ||
+ | locale: Cannot set LC_MESSAGES to default locale: No such file or directory | ||
+ | locale: Cannot set LC_COLLATE to default locale: No such file or directory | ||
+ | C | ||
+ | C.UTF-8 | ||
+ | POSIX | ||
+ | </ | ||
+ | |||
+ | Of course in this particular case, the locale setting for account '' | ||
+ | |||
+ | <code bash> | ||
+ | [traine@r00n45 ~]$ vpkg_require singularity | ||
+ | Adding package `singularity/ | ||
+ | [tainne@r00n45 ~]$ LANG=C.UTF-8 singularity shell tensorflow.simg | ||
+ | Singularity: | ||
+ | |||
+ | Singularity tensorflow.simg: | ||
+ | usage: tensorboard [-h] [--logdir PATH] [--host ADDR] [--port PORT] | ||
+ | | ||
+ | [--db URI] [--inspect] [--tag TAG] [--event_file PATH] | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | TensorBoard is a suite of web applications for inspectinng and understanding | ||
+ | your TensorFlow runs and graphs. https:// | ||
+ | |||
+ | [[ lots of additional information displayed for optional arguments | ||
+ | |||
+ | Singularity tensorflow.simg: | ||
+ | exit | ||
+ | [traine@r00n45 ~]$ | ||
+ | </ | ||
+ | |||
+ | ==== Common Singularity commands ==== | ||
+ | |||
+ | Some common commands are listed here. For more information about Singularity, | ||
+ | |||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' |