singularity-userdocs icon indicating copy to clipboard operation
singularity-userdocs copied to clipboard

Minimum RAM requirement for building

Open verdurin opened this issue 7 years ago • 4 comments

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 avatar May 09 '18 16:05 verdurin

@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 avatar May 14 '18 13:05 cclerget

@cclerget yes, I know it's not an easy one to handle. Maybe it's worth mentioning this in the documentation?

verdurin avatar May 15 '18 19:05 verdurin

@verdurin You're right, we can mention this kind of error in the documentation

cclerget avatar May 15 '18 20:05 cclerget

Still need to mention tmpfs in docs nicely.

dtrudg avatar Feb 04 '20 22:02 dtrudg