Minimum RAM requirement for building
Version of Singularity:
2.5.1
Expected behavior
Singularity should complain if there is an attempt to build when there isn't sufficient memory on the build host.
Actual behavior
Lots of errors, including:
Warning handling tar header: Write failed tar extraction error: Write failed
and later on:
cp: error writing '/var/singularity/mnt/container/etc/resolv.conf': No space left on device
which is what led me to suspect lack of RAM.
Steps to reproduce behavior
Build container from
https://github.com/rses-singularity/tfgpu-theano-pytorch-keras
in Fedora 27 VM with 2GB RAM.
Build fails.
Reconfigure VM with 4GB RAM.
Build succeeds.
There isn't necessarily a fix here, but it would be helpful if Singularity could be clearer about the problem when it occurs.
@verdurin Singularity use /tmp as temporary folder to build image, so your /tmp directory is a RAM filesystem like tmpfs. By default tmpfs use almost 50% of total memory, which could explain why after growing VM memory build succeed. Singularity doesn't have RAM requirements for builds, you can use another directory other than /tmp by setting SINGULARITY_TMPDIR environment variable like this :
$ SINGULARITY_TMPDIR=/var/tmp singularity build image.simg Singularity
Between it could be difficult to catch the error because exit code doesn't necessary reflect the error code of command
@cclerget yes, I know it's not an easy one to handle. Maybe it's worth mentioning this in the documentation?
@verdurin You're right, we can mention this kind of error in the documentation
Still need to mention tmpfs in docs nicely.