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

Return the manifest digest in Registry.push() #144

Closed
hanikesn opened this issue Jun 10, 2024 · 8 comments
Closed

Return the manifest digest in Registry.push() #144

hanikesn opened this issue Jun 10, 2024 · 8 comments

Comments

@hanikesn
Copy link

It's often important to correctly identify a recently uploaded artifact. The current Registry.push() method, only returns an empty
response with the following headers:

{
  'Location': '/v2/XXXX//blobs/sha256:ee7dafd624ee5b0e5a8346730bdb319002aef13190489ffe7832c65816f9e63b',
  'Docker-Distribution-Api-Version': 'registry/2.0',
  'Docker-Content-Digest': 'sha256:ee7dafd624ee5b0e5a8346730bdb319002aef13190489ffe7832c65816f9e63b',
  'X-GUploader-UploadID': 'XXXXXX',
  'Content-Length': '0',
  'Date': 'Mon, 10 Jun 2024 21:35:38 GMT',
  'Server': 'UploadServer',
  'Content-Type': 'text/html; charset=UTF-8',
  'Alt-Svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000'
}

The digest returned in the headers does not match the digest of the manifest in the registry though, making it impossible to accurately locate it there.

@vsoch
Copy link
Contributor

vsoch commented Jun 10, 2024

We could definitely return a collection of artifacts from the entire interaction - my suggestion would be to put down exactly what you want, make a data class to handle it, and then have it collected in the function here:

def push(

It's quite a good idea.

@tarilabs
Copy link
Contributor

I think this could be closed following:

as it would now return the response+headers including sha of the actual OCI Manifest as demonstrated by this test case:

...sorry I didn't realize this was logged when I submitted the PR 😅

@vsoch kindly consider closing this github issue as resolved.
What about having a fresh release in pypi? This would avoid the need for end-user to pull the library changes straight from main?

@vsoch
Copy link
Contributor

vsoch commented Jun 27, 2024

Happy to close it - the reason I haven't done a new release yet is because I was waiting for some time to pass to test the new auth backend (not the release bump is a minor patch but still a larger jump than we normally do). If you think it's well tested and good to go I can go ahead.

@vsoch vsoch closed this as completed Jun 27, 2024
@tarilabs
Copy link
Contributor

to test the new auth backend

Is there a issue tracker of the tests which would be required for it, please?
Happy to try contribute my part :)

@vsoch
Copy link
Contributor

vsoch commented Jun 27, 2024

We don't have an issue for it - I was mostly keeping it as is (and holding off release) until enough people had been using the new branch. In practice it's hard to test these specific cases because there are so many registries.

@tarilabs
Copy link
Contributor

Ack, let see if I can manage to dedicate some cycles to it, will report back 👍
Thinking of trying with (this) Distribution, Zot, Quay... are there others I should consider? These are the ones I typically Interface with.

@vsoch
Copy link
Contributor

vsoch commented Jun 27, 2024

That would be fantastic! The registries I use most often are ghcr.io (GitHub packages) and then my communities use GitLab a bit too. The third for me would be Docker Hub. After that, I would say we should consider (maybe find someone to test) each registry provided by a major cloud, minimally AWS / Azure / Google.

@vsoch
Copy link
Contributor

vsoch commented Jun 27, 2024

@tarilabs let's pick up discussion here #147

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

3 participants