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

feat: parallel audit requests #220

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

fabriziosestito
Copy link
Contributor

Description

This PR implements parallel audit requests to the policy server.
The parallelism is currently set to 100 requests, but in the future, we could expose this value to the user through the CLI so that it can be tuned.

Gnu time output

Before the fix on a cluster with ~300 resources and 15 policies:

Percent of CPU this job got: 79%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:41.24

After the fix

Percent of CPU this job got: 109%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:30.42

In the case of slower policies (for instance policies using context-aware capabilities) is safe to assume that the elapsed time difference should be higher.

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 72.80%. Comparing base (7e56394) to head (8d19288).
Report is 2 commits behind head on main.

Files Patch % Lines
internal/scanner/scanner.go 85.71% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #220      +/-   ##
==========================================
+ Coverage   72.37%   72.80%   +0.43%     
==========================================
  Files           6        6              
  Lines         637      662      +25     
==========================================
+ Hits          461      482      +21     
- Misses        115      117       +2     
- Partials       61       63       +2     
Flag Coverage Δ
unit-tests 72.80% <85.71%> (+0.43%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Member

@flavio flavio left a comment

Choose a reason for hiding this comment

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

Nice!

@flavio
Copy link
Member

flavio commented Mar 11, 2024

This is going to be part of the final 1.11 release

CC @brunorene

@flavio
Copy link
Member

flavio commented Mar 11, 2024

This fixes #217

Copy link
Member

@viccuad viccuad left a comment

Choose a reason for hiding this comment

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

LGTM!

@viccuad
Copy link
Member

viccuad commented Mar 11, 2024

This feels more a feature than a fix, for it appear as such in the GH release it is enough to change the PR title.

@kkaempf kkaempf added this to the 1.12 milestone Mar 11, 2024
@fabriziosestito fabriziosestito modified the milestones: 1.12, 1.11 Mar 11, 2024
@fabriziosestito fabriziosestito changed the title fix: parallel audit requests feat: parallel audit requests Mar 11, 2024
Signed-off-by: Fabrizio Sestito <[email protected]>
@fabriziosestito fabriziosestito force-pushed the fix/parallel-audit-requests branch from c023a04 to 8d19288 Compare March 11, 2024 14:06
@flavio flavio merged commit bc33f23 into kubewarden:main Mar 11, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Feature Request: Allow Audit Scanner to do parallel admission review requests
4 participants