apptainer / singularity

Singularity has been renamed to Apptainer as part of us moving the project to the Linux Foundation. This repo has been persisted as a snapshot right before the changes.
https://github.com/apptainer/apptainer
Other
2.52k stars 424 forks source link

Image file (.sif, .simg) is deleted automatically after every 'run' #5412

Closed akshayMpatel closed 4 years ago

akshayMpatel commented 4 years ago

Version of Singularity:

3.5.3-1.1.el7

Expected behavior

singularity run exits and .sif .simg is not deleted

Actual behavior

singularity run finishes and .sif/.simg is deleted

Does this have to do with INFO: Cleaning up image...?

Steps to reproduce this behavior

not sure

What OS/distro are you running

centos 7

How did you install Singularity

rpm

Why is the image file deleting after every run and how to fix?

dtrudg commented 4 years ago

How are you running the container? Can you provide the full singularity run .... command, and show where you are running it?

This is something that we'd expect to have many bug reports against if it was a reproducible problem - so we need to work out what is going on in your case. Thanks.

akshayMpatel commented 4 years ago

The run command is being called from a bash script (with variables defined.).

singularity run --fakeroot --bind ${base_path} ${base_path}/${container_dir}/${container_name} \
-b /batch/cat_standalone_segment.txt ${nii_file}

%runscript in the def file that calls another bash script that calls cat12 standalone for image processing

NOW=$(date +%s)
exec zrun /code/cat_standalone.sh "$@" 2>&1 |tee cat_$NOW.log

I suspect the problem could lie a bit deeper, perhaps any of the following?

dtrudg commented 4 years ago

Could you provide logs with the -d / --debug flag to Singularity so we can see if there are any symlinks being resolved, or other issues with the binding. I had a quick go at replicating with a bind that overlaps the container path but didn't trigger it - so the exact layout of things appears to be important.

akshayMpatel commented 4 years ago

how to run exactly with -d or --debug? both were not recognized

$ singularity run --debug --bind ~/singularity/cat12/ --cleanenv debian_cat12-standalone.simg -b /batch/cat_standalone_segment.txt ~/singularity/cat12/data/48_MRI_sMRI_400073.nii 
Error for command "run": unknown flag: --debug

Options for run command:
dtrudg commented 4 years ago

the -d --debug flag is a global one... it comes before the command run...

singularity -d run ....

dtrudg commented 4 years ago

Closing as no follow-up received.