-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Fleet] Fetch only relevant assets for package policies operation #213267
base: main
Are you sure you want to change the base?
Conversation
@@ -126,6 +126,8 @@ export type InstallablePackage = RegistryPackage | ArchivePackage; | |||
|
|||
export type AssetsMap = Map<string, Buffer | undefined>; | |||
|
|||
export type PackagePolicyAssetsMap = AssetsMap & { __brand: 'PackagePolicyAssetsMap' }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use type branding to make sure AssetsMap
is not used as a PackagePolicyAssetsMap
by error
@@ -17,12 +17,15 @@ const cacheStore = new AsyncLocalStorage<CacheSession>(); | |||
|
|||
const PACKAGE_INFO_CACHE_SIZE = 20; | |||
const PACKAGE_ASSETS_MAP_CACHE_SIZE = 1; | |||
const AGENT_TEMPLATE_ASSETS_MAP_CACHE_SIZE = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can cache more than package assets map as it only contains agent template and manifest, and not all ES|kibana assets like PACKAGE_ASSETS_MAP_CACHE_SIZE
0a4948a
to
615a7af
Compare
615a7af
to
748a6e2
Compare
Pinging @elastic/fleet (Team:Fleet) |
💔 Build Failed
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
History
cc @nchaulet |
Summary
Related to #205332
That PR change the way we fetch assets, it now fetch only relevant assets for package policies operations instead of the whole assets maps (manifest and agents template).
Saved object change
To be able to filter assets we load I now store the path in
package_assets
array store on the package saved objectBenchmark
Upgrade dry run on 5 aws policies
Before
After
Upgrade 10 packages policies (without agent policy as there are need to improve the package policy too in a next PR)
Before
Kibana memory usage at the same time

After
TODO