perf(scripts): speed up RHDH operator install using install-rhdh-catalog-source.sh (~30 min → ~2 min)#2870
Open
subhashkhileri wants to merge 4 commits into
Conversation
- Skips slow `skopeo inspect` (~42s/bundle) — attempts the copy directly instead; failed copies (~3s) are faster than successful inspects - Processes bundles in parallel up to MAX_PARALLEL (default 10), with a portable kill-0 throttle loop that prunes finished PIDs each iteration - Collects per-worker sed files and applies them in one pass after all bundles complete, avoiding concurrent writes to render.yaml - Runs `opm render` and cluster registry setup in parallel since they are independent; waits before the bundle-processing phase begins - Replaces check-then-delete secret pattern with --ignore-not-found - Deletes existing CatalogSource before recreating to force OLM re-index when the tag is unchanged but the digest has changed (rebuilt IIB) - Fails loudly if any bundle fails to process (was: silent error log) Assisted-by: Claude Code Co-Authored-By: Claude Code <noreply@anthropic.com>
Review Summary by QodoParallelize IIB bundle processing for ~5x performance improvement
WalkthroughsDescription• Parallelizes bundle processing with configurable MAX_PARALLEL (default 10) - Uses portable kill -0 throttle loop to manage concurrent workers - Skips expensive skopeo inspect; attempts copy directly instead • Runs opm render and registry setup concurrently before bundle processing • Applies sed replacements atomically in single pass after all workers complete • Replaces check-then-delete pattern with --ignore-not-found flag • Forces OLM re-indexing by deleting CatalogSource before recreation • Fails loudly on bundle processing errors instead of silent continuation Diagramflowchart LR
A["Bundle Images"] --> B["Parallel Bundle Processing<br/>MAX_PARALLEL=10"]
C["opm render"] --> D["Registry Setup"]
C --> E["Wait for Both"]
D --> E
E --> B
B --> F["Collect sed Files"]
F --> G["Apply Atomic<br/>Replacements"]
G --> H["Regenerate IIB"]
H --> I["Delete & Recreate<br/>CatalogSource"]
File Changes1. .rhdh/scripts/install-rhdh-catalog-source.sh
|
…opeo stderr Background subshells don't inherit set -e from the parent, so intermediate failures (umoci, skopeo push) went undetected and the worker would write a .sed entry for a broken bundle. Also redirect speculative copy stderr to a per-bundle file instead of /dev/null so auth failures, timeouts, and disk errors are debuggable. Assisted-by: Claude Code Co-Authored-By: Claude Code <noreply@anthropic.com>
Assisted-by: Claude Code Co-Authored-By: Claude Code <noreply@anthropic.com>
a19942f to
318a09b
Compare
Assisted-by: Claude Code Co-Authored-By: Claude Code <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



JIRA : https://redhat.atlassian.net/browse/RHIDP-13676
Summary
skopeo inspect(~42s/bundle) — attempts the copy directly; failed copies (~3s) are faster than successful inspects, so images that don't exist on quay are handled with minimal overheadMAX_PARALLEL=10(env-overridable)opm render+ registry setup — these two phases are independent, so they now run concurrently; bundle processing waits until both are done.sedfile (keyed by digest, no locking needed); all replacements are applied in a singlesed -fpass after all workers complete--ignore-not-foundreplaces the check-then-delete secret patternAssisted-by: Claude Code