Singularity is container software written at Lawrence Berkeley Labs.
If you need a specialized computing environment, you can use a Singularity container on Bridges. Your Singularity container will execute on Bridges's compute nodes and can use other Bridges resources, including pylon filesystems. Within your container you can use a different Unix operating system and any software you need. You can set up your Singularity container without any intervention from PSC staff.
If you have questions about using Singularity containers on Bridges send email to email@example.com.
1. Build a Singularity container and copy it to Bridges
Singularity containers cannot be built on Bridges. There are several ways to get a Singularity container onto Bridges.
- You can build a Singularity container on your local system and copy it to Bridges.
- You can convert a Docker container to Singularity on your local system and copy it to Bridges.
- You can copy a container from a container registry to Bridges.
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 Singularity web site. Copy your container to Bridges using the usual file transfer methods. See the Transferring files section of this User Guide for more information.
Convert a Docker container
If you have a Docker container you can convert it to a Singularity container using the
docker2singularity command on your local system. Bridges does not support Docker. Copy your single file to Bridges using the usual file transfer methods. See the Transferring files section of this User Guide for more information.
Copy a container from a registry
An alternative to creating your own container and then copying it to Bridges is to use the s
pull command on Bridges to copy a pre-existing container from a container registry. If you use the s
ingularity pull command to copy a Docker container, it will be converted to Singularity during the pull process.
To copy a container from a registry:
- Log in to Bridges
- Load the singularity module with
module load singularity
- Copy the container you want with the singularity pull command.
More details on this can be found in the Singularity User Guide.
One example of a container registry is https://biocontainers.pro/registry/#/.
2. Execute your Singularity container through SLURM
Once your container is on Bridges you can run it. Containers must run on Bridges' compute nodes, not on the frontends. Use either the
sbatch command to get access to a compute node. See the Running Jobs section of this User Guide for more information on SLURM and using Bridges' compute nodes.
Inside your interactive session or your batch job you must first issue the command
module load singularity
Then you can use the singularity commands to execute your container.
Common Singularity commands
Some common commands are listed here. For more information about Singularity, see the Singularity web site.
- Start a shell within your container using the operating system you have set up your container to use.
- Run a single command within your container.
- Run a recipe script you have set up within your container. Using a recipe script forces users of your container to use a pre-established workflow.
- Provides help on Singularity