github-ci icon indicating copy to clipboard operation
github-ci copied to clipboard

Is it possible to view singularity images as oras://ghcr.io/ in github packages

Open Trophime opened this issue 3 years ago • 3 comments

Hi, following your GREAT workflow I've managed to create a singularity image for my project and upload it to ghcr.io. I still have some issues:

  • it seems that the package is advertised as a "docker image" in my project package page from github:

Install from the command line: Learn more $ docker pull ghcr.io/feelpp/salome.docker:latest

How can I tell github to display a more appropriate message like: singularity pull oras://....

  • Next as my project is private I need to pass some credentials to pull the singularity image. How can do that?

Thanks for your help

Trophime avatar Jul 07 '22 16:07 Trophime

awesome! So the GitHub packages interface is incorrect for different artifact types - whatever you put up on there it's going to show that Docker command (so safe to ignore it). What you want to do instead is:

singularity pull oras://ghcr.io/feelpp/salome.docker:latest

And unfortunately I don't know any way to change that page - perhaps we should ping GitHub to request better support for that? If your project is private (but you have permission) you'll need to use oras login first with a GitHub personal access token.

vsoch avatar Jul 07 '22 16:07 vsoch

Indeed, that would be great to tell docker image from singularity in the packages.

As for the pull operation, actually, I've already tried something like that:

  • generate a PAT,
  • and run: echo token | singularity remote login -u Trophime --password-stdin oras://ghcr.io But it keeps saying: FATAL: while login to oras://ghcr.io: Get "https://ghcr.io/v2/": denied: denied

Maybe I've not selected the right items for the PAT. Any idea which items I should check in the list?

Trophime avatar Jul 07 '22 16:07 Trophime

I would check that:

  1. your PAT has packages permission enabled (it's an extra permission)
  2. you are added to the container with permission to pull

I typically just use public repos / packages but I remember running into this and it seemed to me the message was correct - the PAT I provided didn't have permission to do the pull.

Another way to debug is outside of singularity - install the oras client (https://oras.land) and then do just

oras login (same as docker login)
oras pull -a <artifact>

Once you get that working, then go back to Singularity (and check the permissions first anyway!)

vsoch avatar Jul 07 '22 17:07 vsoch