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 #1116

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

qweeah
Copy link
Contributor

@qweeah qweeah commented Sep 12, 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

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@codecov-commenter
Copy link

codecov-commenter commented Sep 12, 2023

Codecov Report

Merging #1116 (01a3230) into main (6609ecb) will not change coverage.
Report is 1 commits behind head on main.
The diff coverage is n/a.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@           Coverage Diff           @@
##             main    #1116   +/-   ##
=======================================
  Coverage   80.40%   80.40%           
=======================================
  Files          57       57           
  Lines        2945     2945           
=======================================
  Hits         2368     2368           
  Misses        398      398           
  Partials      179      179           

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

@qweeah qweeah merged commit 788b4fb into main Sep 12, 2023
6 checks passed
@shizhMSFT shizhMSFT deleted the optimize-delete branch September 22, 2023 14:29
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