ROX-33327: Image fetch request coalescing,improved image scan caching#19523
ROX-33327: Image fetch request coalescing,improved image scan caching#19523
Conversation
|
Skipping CI for Draft Pull Request. |
|
Images are ready for the commit at 2728dc7. To use with deploy scripts, first |
f30251a to
864b775
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #19523 +/- ##
==========================================
- Coverage 49.25% 49.25% -0.01%
==========================================
Files 2727 2727
Lines 205788 205833 +45
==========================================
+ Hits 101362 101381 +19
- Misses 96890 96916 +26
Partials 7536 7536
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
89e65c5 to
7825c8e
Compare
7825c8e to
ee70d2d
Compare
|
/test all |
|
/test ocp-4-21-operator-e2e-tests |
|
/test ocp-4-20-nongroovy-e2e-tests |
|
/test ocp-4-12-nongroovy-e2e-tests |
charmik-redhat
left a comment
There was a problem hiding this comment.
Good to go after @dashrews78's comment about context timeout is addressed.
Description
This is the third in the series of planned optimizations for admission controller.
The goal of this PR is to optimize image fetch calls to sensor/central and ultimately registry scan requests, thus improving the throughput of the policy eval webhook, and its burst resilience and timeout avoidance, at scale.
Two optimizations have been added:
(1) request coalescing (singleflight) -- concurrent fetches for the same image share a single in-flight call;
(2) two-level caching -- the existing digest-keyed cache plus a new image-name-to-cache-key map so tag-only references can hit cached results without a digest. The name-to-key map can be disabled via
ROX_ADMISSION_CONTROL_IMAGE_NAME_CACHE_ENABLED=falsefor environments where image tags are reused for different content (mutable tags).Note to reviewers:
User-facing documentation
Testing and quality
Automated testing
How I validated my change
AdmissionControllerTest.groovyfor correctness and regression testing.Results:
https://docs.google.com/document/d/13B_1X5MPcrMB8qH076S-1QS_21CKhYEjh-YyH-vfbQM/edit?tab=t.0#heading=h.y9iqi8q2pwjt