perf(scripts): speed up RHDH operator install using install-rhdh-catalog-source.sh (~30 min → ~2 min)#2870
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 Qodo(Agentic_describe updated until commit 49ef790)Parallelize IIB bundle processing for ~13x speedup
WalkthroughsDescription• Parallelize bundle processing with configurable MAX_PARALLEL (default 10) - Skips slow skopeo inspect (~42s/bundle); attempts copy directly instead - Processes bundles concurrently with portable kill-0 throttle loop - Collects per-worker sed files; applies replacements in single pass • Run opm render and registry setup concurrently (independent phases) • Force OLM re-index by deleting CatalogSource before recreation • Improve error handling and debugging - Add set -euo pipefail to process_bundle function - Preserve skopeo stderr to per-bundle files for troubleshooting - Fail loudly if any bundle fails (was silent error log) - Validate MAX_PARALLEL is positive integer • Simplify secret deletion with --ignore-not-found flag Diagramflowchart LR
A["Extract bundle images"] --> B["Parallel bundle processing<br/>MAX_PARALLEL=10"]
A --> C["opm render"]
A --> D["Registry setup"]
B --> E["Collect sed files"]
C --> F["Wait for completion"]
D --> F
E --> G["Apply replacements<br/>single sed pass"]
F --> G
G --> H["Delete CatalogSource"]
H --> I["Recreate CatalogSource<br/>force OLM re-index"]
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
|
Persistent review updated to latest commit 49ef790 |
…cess group kill 0 sends SIGTERM to the entire process group including the parent shell/CI harness, causing segfaults on normal exit. Use jobs -p to target only this script's background jobs. Split INT/TERM from EXIT to avoid re-entrant cleanup. Assisted-by: Claude Code Co-Authored-By: Claude Code <noreply@anthropic.com>
998488a to
87c3ba3
Compare
|
|
/override "PR Publish" unrelated |
|
@rm3l: Overrode contexts on behalf of rm3l: PR Publish, PR Validate DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
c417781
into
redhat-developer:main
|
/cherry-pick release-1.10 Just as a reminder to backport to 1.10 once 1.10.0 is out. |
|
@rm3l: new pull request created: #2913 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |



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