Closed victorsndvg closed 6 years ago
hey @victorsndvg ! Thanks for finding that manifest bug, I fixed it here:
https://github.com/singularityhub/sregistry-cli/commit/136584d09e593af443f97710a11e80b0e647df58
The SREGISTRY_CLIENT_SECRETS is the same file that you would have downloaded from your registry, it is defaulted to be $HOME/.sregistry
if you don't set it.
I'm confused about "hardcoding the manifest obtained from sregistry API" and then using Singularity... it looks like you are running a singularity image with sregistry, but binding some local pull.py script with one in the image? Is that for the manifest bug?
Hi @vsoch ,
I tried to pull a private image from SRegistry using the right token and I always get the bad request code 400 ...
, I think this means that is not able to retrieve the manifest.
At this point I don't know if I'm doing something wrong ... or I'm misunderstanding something ...
Then, to check if sregistry-cli
is able to pull a private image after getting the proper manifest, I harcoded the manifest in the pull.py
that I'm binding into the container (avoiding the bad request code 400 ...
message) and it worked. Of course this is not the way to go, only a simple check.
Now the questions is ... Why I'm not able to obtain the manifest of an image of a private SRegistry collection?
hey @victorsndvg ! This is expected behavior given the current implementation - you can only pull public images. Take a look here:
https://github.com/singularityhub/sregistry/blob/master/shub/apps/api/urls/containers.py#L150
You'll notice that if the collection is private, it will just return 400, otherwise the manifest. This is why you are able to get the manifest and then do the pull. So this presents two bugs, and they actually need to be addressed first at the sregistry repository.
get
function linked above should check the request for the credential header. If it's present, then even if the collection is private the manifest should be returned. This also means that the request coming from the client (this repository) needs to add the header as well. This will be almost identical to the one generated for push, but for pull.I can definitely get these fixed up! However I'm going in for surgery early next week, so likely I won't have time until the end of the month.
okay, just wanted to let you know I started working on this this evening - the integration into the sregistry I think is good, and now I need to figure out the client. I don't have a good ETA because, well, life, but it will be as soon as I can :)
Ok! As always, no rush.
You have other tasks with more priority ;) Lets keep the issue open till it's fixed.
best wishes and Good luck!
It's your lucky day! Much earlier than anticipated, see https://github.com/singularityhub/sregistry/pull/77
Wow, awesome!
I will check it on Monday ;)
I think we can close this issue too. Reopen if needed
Hi, I'm having troubles when retreiving an image from a private local sregistry:
sregistry pull hifimagnet/test:mso4sc
[client|registry] [database|sqlite:////home/LNCMI-G/trophime/.singularity/sregistry.db]
Traceback (most recent call last):
File "/usr/bin/sregistry", line 11, in <module>
load_entry_point('sregistry==0.0.72', 'console_scripts', 'sregistry')()
File "/usr/lib/python3/dist-packages/sregistry/client/__init__.py", line 352, in main
subparser=subparsers[args.command])
File "/usr/lib/python3/dist-packages/sregistry/client/pull.py", line 53, in main
save=do_save)
File "/usr/lib/python3/dist-packages/sregistry/main/registry/pull.py", line 80, in pull
if manifest.status_code == 403:
AttributeError: 'dict' object has no attribute 'status_code'
If I comment out the lines in pull.py
:
# Still denied
if manifest.status_code == 403:
manifest = 403
it works...
hey @Trophime ! I just pushed a fix to #88 could you give it a try?
Thanks @vsoch , It's working! :)
Hi I am having an issue to pull images from my local singularity registry. Its showing following error. any suggestion is highly appreciated.
Failed to get manifest from Shub: Only the default Singularity Hub registry is suported for now
Can you please provide a full command? I can read dinosaur minds, but not human ones.... :O
Hi @vsoch ,
I still trying your great tool :)
First of all I think there is a small but in this line:
https://github.com/singularityhub/sregistry-cli/blob/master/sregistry/main/registry/pull.py#L62
I think you should move the assignment
manifest['selfLink'] = url
after checking if the manifest is a dictionary.Then I try to pull a private image (with the SREGISTRY_CLIENT_SECRETS defined) and I'm not able to pull it.
SREGISTRY_CLIENT_SECRETS contains a path to a plain text file containing the full JSON token. Is this right?
I get the following:
If I hardcoded the manifest (obtained from SRegistry API), I can get the image using the pull command.
Why I cannot get the manifest using the token?
I really don't understand how to pull private images.