Skip to content

perf: reduce auth request count for manifest delete#623

Merged
Wwwsylvia merged 1 commit into
oras-project:release-2.3from
Wwwsylvia:backport_perf
Oct 20, 2023
Merged

perf: reduce auth request count for manifest delete#623
Wwwsylvia merged 1 commit into
oras-project:release-2.3from
Wwwsylvia:backport_perf

Conversation

@Wwwsylvia

@Wwwsylvia Wwwsylvia commented Oct 20, 2023

Copy link
Copy Markdown
Member

Backporting 0f1dc30 to the release branch.
This change does the same thing as the original commit (#618) did but using the old registryutil.WithScopeHint instead of auth.AppendRepositoryScope, which is introduced by #604 and is not available in v2.3.x.


Add pull and delete scope hints before attempting client-side indexing on manifest delete.

Before this change, the requests produced during deleting a manifest when Referrers API is not known to be available:

  • Request #0: GET manifest - 401
  • Request #1: POST token (scope: pull) - 200
  • Request #2: GET manifest - 200
  • [optional] Request #3: GET referrers index - 200
  • [optional] Request #4: PUT referrers index - 401
  • [optional] Request #5: POST token (scope: pull, push) - 200
  • [optional] Request #6: PUT referrers index - 201
  • Request #7: DELETE manifest - 401
  • Request #8: POST token (scope: delete)
  • Request #9: DELETE manifest - 202

After this change, the requests should become:

  • Request #0: GET manifest - 401
  • Request #1: POST token (scope: pull, delete) - 200
  • Request #2: GET manifest - 200
  • [optional] Request #3: GET referrers index - 200
  • [optional] Request #4: PUT referrers index - 401
  • [optional] Request #5: POST token (scope: pull, push) - 200
  • [optional] Request #6: PUT referrers index - 201
  • Request #7: DELETE manifest - 202

Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
@codecov-commenter

codecov-commenter commented Oct 20, 2023

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.46%. Comparing base (f175957) to head (ea0878d).
⚠️ Report is 1 commits behind head on release-2.3.

Additional details and impacted files
@@             Coverage Diff              @@
##           release-2.3     #623   +/-   ##
============================================
  Coverage        74.45%   74.46%           
============================================
  Files               51       51           
  Lines             4847     4848    +1     
============================================
+ Hits              3609     3610    +1     
  Misses             908      908           
  Partials           330      330           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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 changed the title perf: reduce auth request count for manifest delete perf: backport: reduce auth request count for manifest delete Oct 20, 2023
@Wwwsylvia Wwwsylvia changed the title perf: backport: reduce auth request count for manifest delete perf: reduce auth request count for manifest delete Oct 20, 2023
@Wwwsylvia Wwwsylvia merged commit f296072 into oras-project:release-2.3 Oct 20, 2023
@Wwwsylvia Wwwsylvia deleted the backport_perf branch October 20, 2023 08:51
@Wwwsylvia Wwwsylvia mentioned this pull request Oct 20, 2023
4 tasks
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.

3 participants