Skip to content

Parallelize bundle audit for NetworkPolicy objects #161

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anik120
Copy link

@anik120 anik120 commented Aug 11, 2025

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

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

os.MkdirAll(workerCacheDir, 0755)

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

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.

// 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)
Copy link

@grokspawn grokspawn Aug 11, 2025

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