Skip to content

Parallelize bundle audit for NetworkPolicy objects#161

Open
anik120 wants to merge 1 commit into
operator-framework:mainfrom
anik120:parelleliez-np
Open

Parallelize bundle audit for NetworkPolicy objects#161
anik120 wants to merge 1 commit into
operator-framework:mainfrom
anik120:parelleliez-np

Conversation

@anik120

@anik120 anik120 commented Aug 11, 2025

Copy link
Copy Markdown
Member

Also switch from using docker save -> extract approach to opm render -> declCfg.Load() approch, which is much faster and memory efficient.

Performance improvements while aduiting catalogs:

  1. redhat-operators v4.13 took ~1 hour 20 mins
  2. redhat-operators v4.14 took ~1 hour 30 mins

Down from ~4 hours.

Also switch from using docker save -> extract approach to
opm render -> declCfg.Load() approch, which is much faster and
memory efficient.

Performance improvements while aduiting catalogs:

1. redhat-operators v4.13 took ~1 hour 20 mins
2. redhat-operators v4.14 took ~1 hour 30 mins

Down from ~4 hours.
@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 16891364393

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 1.01%

Totals Coverage Status
Change from base Build 16887173655: 0.0%
Covered Lines: 18
Relevant Lines: 1783

💛 - Coveralls

Comment thread cmd/index/np/command.go
os.MkdirAll(workerCacheDir, 0755)

for attempt := 1; attempt <= maxRetries; attempt++ {
cmd := exec.Command("opm", "alpha", "bundle", "unpack", job.image, "-o", bundleDir)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

FYI, this failed for me with one of the bundles in the community catalog, since it does some validation. What that validation was is lost to 10K+ lines in my console buffer, but I shifted to oc image extract as a foolproof solution.

Comment thread cmd/index/np/command.go
// This avoids image registry dependencies (gpgme) while giving us structured data

// Execute opm render command as external process
cmd := exec.Command("opm", "render", "-o", "yaml", indexImage)

@grokspawn grokspawn Aug 11, 2025

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You could avoid the shell/read-from-disk by doing this in go like https://github.com/operator-framework/operator-registry/blob/3212635c5e3847e5e9f4b5db3f87b147405274fa/cmd/opm/render/cmd.go#L62C3-L88C1.

Also, since you are using opm render already without any migration option, you could grab all the manifests by just walking the olm.bundle.object properties on each olm.bundle, base64 decode them and string search them. That would allow you to skip the unpacking later in the flow completely!

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