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

Fix garbage-collect --delete-untagged to handle schema 2 manifest list and OCI image index #4285

Merged
merged 1 commit into from Apr 21, 2024

Conversation

thewolt
Copy link
Contributor

@thewolt thewolt commented Feb 25, 2024

resolves #3178

@milosgajdos
Copy link
Member

This is failing the linter and needs fixing

@thewolt
Copy link
Contributor Author

thewolt commented Mar 5, 2024

@milosgajdos the issues reported by the linter should be fixed

@WhySoBad
Copy link

WhySoBad commented Apr 4, 2024

How is this pull request coming along? If some help is needed I'd be willing to contribute to this issue - just let me know.

@thewolt
Copy link
Contributor Author

thewolt commented Apr 5, 2024

How is this pull request coming along? If some help is needed I'd be willing to contribute to this issue - just let me know.

I don't understand what else is needed? all the checks have passed. Do I need to rebase onto origin/main ?

@WhySoBad
Copy link

WhySoBad commented Apr 6, 2024

I don't understand what else is needed? all the checks have passed

The question was more directed at @milosgajdos since he seems to be the one assigned with this issue.
For me the issue seems completed but I don't know if the folks at docker are missing something.

Do I need to rebase onto origin/main ?

I think a rebase onto origin/main can't do any harm since it's necessary to rebase before merging anyways.

Sorry if my previous comment sounded like I was trying to stress you out. I really appreciate your work on this issue!

@milosgajdos
Copy link
Member

The question was more directed at @milosgajdos since he seems to be the one assigned with this issue.

No, I am NOT assigned this issue. This is all done in everyone's free unpaid time. I merely mentioned the CI failure in my comment.

@thewolt
Copy link
Contributor Author

thewolt commented Apr 6, 2024

@milosgajdos @WhySoBad so can anyone point me to two reviewers ?

@godber
Copy link

godber commented Apr 6, 2024

@thewolt We have no authority to merge but we reviewed and used your patch against 3.0.0-alpha and rolled it out to prod because it looked good, had tests that passed, worked in our additional testing and at that point any risk that posed was far less than the constant problems posed by a destructive garbage collection mechanism.

It looks like milosgajdos can merge but I've looked through the merged PRs and he's the only one who has merged since February 29th when wy65701436 merged #4286. So sadly it seems he's been going it alone recently.

There's a MAINTAINERS File and a GOVERNANCE document if you want to dig further or solicit more help somehow.

@WhySoBad
Copy link

WhySoBad commented Apr 7, 2024

No, I am NOT assigned this issue. This is all done in everyone's free unpaid time. I merely mentioned the CI failure in my comment.

I apologize for my faulty assumption. Based on your activity in this project and your github profile it seemed as you were employed by docker.

@milosgajdos
Copy link
Member

I apologize for my faulty assumption. Based on your activity in this project and your github profile it seemed as you were employed by docker.

I used to be employed by Docker inc. but they never paid me to work on this project. Assuming someone who works for Docker automatically qualifies as a person who works on this project is a false assumption.

This project was donated to CNCF by Docker a few years ago. All the work I've done on this project has been in my free and unpaid time.

No hurt feelings, I just need to clarify all the wrong assumptions made here for the future generations 😄

@philipcristiano
Copy link

Based on @godber's comment I tested v3.0.0-alpha1 with this patch and pushed an image to a personal repo.

Thank you @thewolt for this work!

philipcristiano added a commit to philipcristiano/nixos-cluster-config that referenced this pull request Apr 8, 2024
@godber
Copy link

godber commented Apr 8, 2024

There's some bottleneck in the CNCF process around review and merge. The sad irony is I DO pay people to work on CNCF projects ... most of our issues and PRs have gone ignored and closed by bots.

I guess I should figure out how to get more involved in the CNCF but I've assumed since we don't work for some unicorn we'll be ignored. Especially given recent supply chain hysteria. But I digress, this isn't the venue for this discussion.

Copy link
Member

@milosgajdos milosgajdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a first look it LGTM. I need to give it another shot at some point this week if time permits. @deleteriousEffect @joaodrp mind having a look at this?

registry/storage/garbagecollect.go Outdated Show resolved Hide resolved
Copy link
Member

@milosgajdos milosgajdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @Jamstah mind having a look?

@nmapx
Copy link

nmapx commented Apr 19, 2024

Can someone double check this PR and merge it finally? I feel this fix is somehow underrated unfortunately. There are plenty of people waiting for it but I guess none of them are allowed to click the merge button. So frustrating.

@milosgajdos
Copy link
Member

PTAL @thaJeztah @squizzi

@gislikonrad
Copy link

Yeah, this bug caused a huge issue for us after we started building multiplatform containers. First garbage-collect after that was catastrophic. Please merge.

registry/storage/garbagecollect_test.go Outdated Show resolved Hide resolved
registry/storage/garbagecollect_test.go Outdated Show resolved Hide resolved
@thewolt
Copy link
Contributor Author

thewolt commented Apr 19, 2024

@squizzi Thanks for the review, i've updated the test case commit with your suggestions

@milosgajdos
Copy link
Member

@thewolt can you squash, please.

Signed-off-by: Anthony Ramahay <thewolt@gmail.com>
@thewolt
Copy link
Contributor Author

thewolt commented Apr 21, 2024

@thewolt can you squash, please.

@milosgajdos Squash done 👍

@milosgajdos milosgajdos merged commit df98374 into distribution:main Apr 21, 2024
16 checks passed
@nmapx
Copy link

nmapx commented Apr 21, 2024

@milosgajdos when is it gonna be released?

@milosgajdos
Copy link
Member

@milosgajdos when is it gonna be released?

Short answer: there is no concrete plan

Long answer: this project is run by unpaid volunteers who have their own full-time jobs, so it all depends on their time availability TBD

// fetch all tags from repository
// all of these tags could contain manifest in history
// which means that we need check (and delete) those references when deleting manifest
allTags, err := repository.Tags(ctx).All(ctx)
if err != nil {
if _, ok := err.(distribution.ErrManifestUnknownRevision); !ok {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @thewolt, @squizzi, I have a question about ErrManifestUnknownRevision, under what circumstances would this error occur? According to the code, it should return an ErrRepositoryUnknown error, please correct me if I have mistaken.

Additionally, I have also submitted a PR related to this.

Copy link
Contributor Author

@thewolt thewolt Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@microyahoo Sorry but I've never used Go before this PR.
When I brought the test cases from readerx, I found that adding this condition fixed the test and I looked no further.

Using the debugger, it's clear that the error i wanted to catch was indeed ErrRepositoryUnknown and the way i've put the condition is useless.

So yes, your PR is correct and provides a more useful message.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your clarification, I will update it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Registry garbage-collect --delete-untagged removes multi-arch manifests
9 participants