2.4-dist
The name of a pulled image should match the one specified by the user
It add the .simg extension even if .img was specified
$ singularity pull --name foo.img shub://qbicsoftware/qbic-singularity-megSAP
Progress |===================================| 100.0%
Done. Container is at: /home/pditommaso/Downloads/foo.simg
When the pull is used programmatically, it breaks the script/application execution because it save the image with a name different from the one expected.
I can second on this unfortunately.
Let's see what singularity folks says. It doesn't seem to me a good idea to quietly change that name.
I absolutely agree - thats not good practice if that has been done with intent.
Still download manually is the best way :)
I disagree a bit. I think an extension is essential to indicate the file type, and given that images going forward are squashfs (.simg), the user should be encouraged (and forced) to use simg. I'll likely change it back due to the disagreement here, but I do think it's important my reasons were shared.
I understand that there's a different image format in 2.4. Does the pull save the image in the new format regardless the file name provided by the user?
I can understand that moving people to simg due to the switch to squashfs is indeed a good idea. However, if you specifically state you'd like to have a certain file name when pulling, then I'd personally expect to have exactly this filename instead. By default if you just pull with:
singularity pull shub://path/to/repo
I can totally understand in that case the switch to simg. I'd suppose a differentiation between naming your output (then taking whatever has been specified by the user) and without naming (then taking simg) could be a good solution.
EDIT: In Singularity hub, this leads for example to having this here

singularity pull --name customname.img shub://qbicsoftware/qbic-singularity-megSAP
which leads however to a file qbic-singularity-megSAP-master.simg when being pulled with that command.
Tend to agree.
I could put a mv name.simg name.img just after the pull, but it's a bit ugly.
+1 if you specify --name you should get a file with that exact name. There are a bunch of reasons why you wouldn't want any file extension at all. And I don't think Singularity should enforce file extensions. This is Linux after all, not Windows.
@GodloveD we may expect that you will fix this ?
Let's see what @vsoch has to say. I just wanted to add my $0.02 that I think the user should get what they ask for.
The --name option is too astonishing for me. So I don't use it directly. Also that option is available for singularity pull but not for singularity run. Because of the systematic mv I need after all my pull and run commands I usually wrap them up into a singularitypull and singularityrun that do what I want. I wish I did not have to do that.
I think the tribe has spoken! I feel strongly about a lot of things, but this isn't one of them. I'd say take the following approach:
maybe name is the basename without the extension (simg for squashed, img for ext4, xxx for future ones), and we could have a --filename which would do what people are expecting ?
Adding a new option would not be backward compatible.
That's a good suggestion @truatpasteurdotfr , but I think we should stick with one simple --name and be open to let the user decide the extension and file.
take a look at #1101 and see if it is to your liking!
Well, I'm not a compiler :) but I guess it's fine as long as it implements the approach you mentioned in the above comment https://github.com/singularityware/singularity/issues/1095#issuecomment-339638428
Looks good to me after a quick check :-)
Closing this, as believed fixed with the merged PR. Thanks!
Most helpful comment
I think the tribe has spoken! I feel strongly about a lot of things, but this isn't one of them. I'd say take the following approach: