Skip to content

Optimise resolver#1447

Closed
gnmahanth wants to merge 12 commits into
anchore:mainfrom
deepfence:optimise-resolver
Closed

Optimise resolver#1447
gnmahanth wants to merge 12 commits into
anchore:mainfrom
deepfence:optimise-resolver

Conversation

@gnmahanth

@gnmahanth gnmahanth commented Jan 11, 2023

Copy link
Copy Markdown

Fixes: #1446

Depends On PR: anchore/stereoscope#151

when dpkdb-cataloger is selected syft indexes whole filesystem even when cataloger is looking for files in **/var/lib/dpkg/{status,status.d/**}, to fix this this PR adds path filter function which indexes files from paths required by catalogers when provided

improvements while scanning confluentinc/cp-kafka image when all catalogers are enabled
syft memory usage: ~350MB
syft memory usage with this PR: ~125MB

with only java catalogers enabled
syft memory usage: ~290MB
syft memory usage with this PR: ~80MB

gnmahanth added 9 commits January 11, 2023 09:05
Signed-off-by: gnmahanth <mahanth@deepfence.io>
Signed-off-by: gnmahanth <mahanth@deepfence.io>
Signed-off-by: gnmahanth <mahanth@deepfence.io>
Signed-off-by: gnmahanth <mahanth@deepfence.io>
Signed-off-by: gnmahanth <mahanth@deepfence.io>
Signed-off-by: gnmahanth <mahanth@deepfence.io>
Signed-off-by: gnmahanth <mahanth@deepfence.io>
Signed-off-by: gnmahanth <mahanth@deepfence.io>
Signed-off-by: gnmahanth <mahanth@deepfence.io>
Comment thread cmd/syft/main.go Outdated
if err := cli.Execute(); err != nil {
log.Fatalf("error during command execution: %v", err)
}
f, err := os.Create("mem.pprof")

@wagoodman wagoodman Jan 11, 2023

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.

note: this should be removed.

Also there should already be memory profiling built into syft. If you use SYFT_DEV_PROFILE_MEM=true --that being said, it seems to have been inadvertently removed. I'll try and restore this functionality.

@gnmahanth gnmahanth Jan 11, 2023

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

removed in commit 353d001

Comment thread go.mod

go 1.18

replace github.com/anchore/stereoscope => github.com/deepfence/stereoscope v0.0.0-20230111090613-ee0c9713629f

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.

just a reminder for reviewers: this should be removed before merging (keep this comment unresolved for now)

Signed-off-by: gnmahanth <mahanth@deepfence.io>
gnmahanth added 2 commits January 12, 2023 07:00
Signed-off-by: gnmahanth <mahanth@deepfence.io>
Signed-off-by: gnmahanth <mahanth@deepfence.io>
@wagoodman

Copy link
Copy Markdown
Contributor

We don't want to remove files from the resolver index since we don't exhaustively know all possible calls about possible content. That is, we may use the configured globs to find packages but the contents of glob results may hint at other locations which we add as evidence on to the package. These new evidence paths aren't known in advance, so removing them from the index would break existing functionality.

@wagoodman wagoodman closed this Jan 19, 2023
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.

syft memory usage is high

2 participants