Skip to content

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

Merged
qweeah merged 6 commits into
oras-project:mainfrom
qweeah:qweeah/optmize-delete
Sep 12, 2023
Merged

perf: optimize request count for manifest and blob deletion#1109
qweeah merged 6 commits into
oras-project:mainfrom
qweeah:qweeah/optmize-delete

Conversation

@qweeah

@qweeah qweeah commented Sep 7, 2023

Copy link
Copy Markdown
Contributor

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

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@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
Comment thread cmd/oras/internal/option/remote.go Outdated
Comment thread internal/registryutil/auth.go Outdated
Comment thread internal/registryutil/auth.go Outdated
Comment thread cmd/oras/root/manifest/delete.go Outdated
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Comment thread internal/registryutil/auth.go

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Wwwsylvia Wwwsylvia left a comment

Copy link
Copy Markdown
Member

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