Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap from Singularity image on GHCR? #11

Closed
ArneNx opened this issue Feb 8, 2022 · 6 comments
Closed

Bootstrap from Singularity image on GHCR? #11

ArneNx opened this issue Feb 8, 2022 · 6 comments

Comments

@ArneNx
Copy link

ArneNx commented Feb 8, 2022

I was wondering if it is in any way possible to use a singularity image that was pushed to ghcr.io with this workflow as the source for bootstrapping in a new singularity definition?

@vsoch
Copy link
Member

vsoch commented Feb 8, 2022

Yep! You should be able to bootstrap oras, which is the same way we push. See https://sylabs.io/guides/3.5/user-guide/appendix.html#oras-bootstrap-agent

@ArneNx
Copy link
Author

ArneNx commented Feb 8, 2022

Thanks for the quick response. I tried that and got:

FATAL:   While performing build: conveyor failed to get: while fetching library image: failed to get checksum for oras://ghcr.io/sinzlab/pytorch-singularity:v3.9-torch1.10.2-dj0.12.7.def: no layer found corresponding to SIF image

@vsoch
Copy link
Member

vsoch commented Feb 8, 2022

What if you just download Oras and pull with -a?

it’s after 1am here so I’ll probably need to pick up helping tomorrow.

@ArneNx
Copy link
Author

ArneNx commented Feb 8, 2022

Oras without -a gives me

Downloaded empty artifact
Pulled ghcr.io/sinzlab/pytorch-singularity:v3.9-torch1.10.2-dj0.12.7.def
Digest: sha256:c2c791486d4705423a5a8058c0b5a51230272957ac5a24a7499f33663cb86377

With -a it seems to work (container is downloaded):

Downloaded 602051779ceb container.sif
Pulled ghcr.io/sinzlab/pytorch-singularity:v3.9-torch1.10.2-dj0.12.7.def
Digest: sha256:c2c791486d4705423a5a8058c0b5a51230272957ac5a24a7499f33663cb86377

Normal singularity pull gives the same error message as Bootstrap.
The problem is not too urgent. So postponing it until tomorrow is not a problem.

@vsoch
Copy link
Member

vsoch commented Feb 8, 2022

With -a it seems to work (container is downloaded):

Okay that's our sanity check! The -a says "allow all artifact types" which is why the first doesn't work and the second does.

And I installed singularity 3.9.0 and it does seem to be downloading (albeit very slowly):

 singularity --debug pull oras://ghcr.io/sinzlab/pytorch-singularity:v3.9-torch1.10.2-dj0.12.7.def
DEBUG   [U=1000,P=438534]  persistentPreRun()            Singularity version: 3.9.0-rc.1+26-gf57577214
DEBUG   [U=1000,P=438534]  persistentPreRun()            Parsing configuration file /usr/local/etc/singularity/singularity.conf
DEBUG   [U=1000,P=438534]  handleConfDir()               /home/vanessa/.singularity already exists. Not creating.
DEBUG   [U=1000,P=438534]  getCacheParentDir()           environment variable SINGULARITY_CACHEDIR not set, using default image cache
INFO    [U=1000,P=438534]  pull()                        Downloading oras image
DEBUG   [U=1000,P=438534]  func1()                       Will pull oras image container.sif to /home/vanessa/.singularity/cache/oras/tmp_4250792211
$ ls -l /home/vanessa/.singularity/cache/oras/
total 118784
-rwx------ 1 vanessa vanessa 121634816 Feb  8 05:26 tmp_4250792211
vanessa@vanessa-ThinkPad-T450s:~$ ls -l /home/vanessa/.singularity/cache/oras/
total 230400
-rwx------ 1 vanessa vanessa 235929600 Feb  8 05:27 tmp_4250792211

Going to wait it out and make sure it finishes. Okay it just finished - image seems okay!

DEBUG   [U=1000,P=438534]  Init()                        Image format detection
DEBUG   [U=1000,P=438534]  Init()                        Check for sandbox image format
DEBUG   [U=1000,P=438534]  Init()                        sandbox format initializer returned: not a directory image
DEBUG   [U=1000,P=438534]  Init()                        Check for sif image format
DEBUG   [U=1000,P=438534]  Init()                        sif image format detected
$ ls
pytorch-singularity_v3.9-torch1.10.2-dj0.12.7.def.sif
vanessa@vanessa-ThinkPad-T450s:~/go/src/github.com/sylabs/singularity/builddir$ singularity shell pytorch-singularity_v3.9-torch1.10.2-dj0.12.7.def.sif 
Singularity> 

So I think if a basic singularity pull oras:// isn't working for you it might be a bug with singularity? I just built 3.9.0 from sylabs - give that repository a shot and if it still is an error it sounds like maybe a bug to report - something with using the wrong puller (library instead of oras) or maybe even a memory issue.

E.g., based on seeing:

while fetching library image

it looks like your install is trying to install oras from the library? That might be the issue.

@ArneNx
Copy link
Author

ArneNx commented Feb 8, 2022

You were right. I had version 3.6.4 installed.
Trying it on another server with 3.8.5 worked for me.
Thanks a lot for your help!

@ArneNx ArneNx closed this as completed Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants