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

perf: optimize request count for manifest and blob deletion #1109

Merged
merged 6 commits into from
Sep 12, 2023

Conversation

qweeah
Copy link
Contributor

@qweeah qweeah commented Sep 7, 2023

What this PR does / why we need it:
This PR optimize the request count of oras blob delete and oras manifest delete when using against a remote registry.

When deleting a manifest via tag from registry, the requests are optimized as below:

Before
request #0: HEAD manifest tag- 401
request #1: GET token (scope: pull) - 200
request #2: HEAD manifest tag- 200
request #3: GET manifest digest- 200
request #4: DELETE manifest digest 401
request #5: GET token (scope: delete, pull) - 200
request #6: DELETE manifest digest - 202

After
request #0: HEAD manifest tag- 401
request #1: GET token (scope: pull, delete, push) - 200
request #2: HEAD manifest tag- 200
request #3: GET manifest digest- 200
request #4: DELETE manifest digest - 202

Same for oras blob delete.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1104

@qweeah qweeah marked this pull request as ready for review September 11, 2023 08:03
@qweeah qweeah changed the title perf: optmize request count for manifest and blob deletion perf: optimize request count for manifest and blob deletion Sep 11, 2023
cmd/oras/internal/option/remote.go Outdated Show resolved Hide resolved
internal/registryutil/auth.go Outdated Show resolved Hide resolved
internal/registryutil/auth.go Outdated Show resolved Hide resolved
cmd/oras/root/manifest/delete.go Outdated Show resolved Hide resolved
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@Wwwsylvia Wwwsylvia left a comment

Choose a reason for hiding this comment

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

LGTM, but I'm not a maintainer

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

Successfully merging this pull request may close these issues.

Optimize the number of auth requests for oras manifest delete and oras blob delete
3 participants