Parallelize binary builds and add BUILD_IMAGES allow-list#5081
Parallelize binary builds and add BUILD_IMAGES allow-list#5081Prucek wants to merge 1 commit intoopenshift:mainfrom
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdd Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/hold |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Prucek The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@hack/install.sh`:
- Around line 67-82: The script currently tracks only PIDs (pids array) and
counts failures (failures array) so failing builds aren't named; change the
launch loop to record the mapping of PID to command (e.g., declare -A pid_to_cmd
and after starting each go install put pid_to_cmd[$!]="$command"), then in the
wait loop use that map to capture the failed command name (retrieve
pid_to_cmd[$pid]) and append the command name (not just PID) to failures;
finally, print the failing command names when reporting errors. Ensure an
associative array is declared before use and that you still collect PIDs in pids
for wait.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| echo "Building ${command}..." | ||
| go install -v $RACE_FLAG -ldflags "-X 'sigs.k8s.io/prow/pkg/version.Name=${command}' -X 'sigs.k8s.io/prow/pkg/version.Version=${version}'" "./cmd/${command}/..." & | ||
| pids+=($!) | ||
| done | ||
|
|
||
| # Wait for all parallel builds and collect failures | ||
| for pid in "${pids[@]}"; do | ||
| if ! wait "$pid"; then | ||
| failures+=("$pid") | ||
| fi | ||
| done | ||
|
|
||
| if [[ ${#failures[@]} -gt 0 ]]; then | ||
| echo "ERROR: ${#failures[@]} build(s) failed" | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
Failed builds are not identified by name, making debugging harder.
When a build fails, the error message only reports the count of failures. In CI logs with interleaved output from parallel builds, developers won't easily know which binary failed.
Consider tracking command names alongside PIDs for actionable error messages.
Suggested improvement
+declare -A pid_to_cmd
+
for dir in $( find ./cmd/ -mindepth 1 -maxdepth 1 -type d -not \( -name '*ipi-deprovison*' \) | sort ); do
command="$( basename "${dir}" )"
# If BUILD_IMAGES is set, only build listed binaries
if [[ ${`#build_images_map`[@]} -gt 0 ]]; then
if [[ -z "${build_images_map[${command}]:-}" ]]; then
continue
fi
elif [[ -n "${skipped_images_map[${command}]:-}" ]]; then
echo "Skipping install for ${command} (in SKIPPED_IMAGES)"
continue
fi
echo "Building ${command}..."
go install -v $RACE_FLAG -ldflags "-X 'sigs.k8s.io/prow/pkg/version.Name=${command}' -X 'sigs.k8s.io/prow/pkg/version.Version=${version}'" "./cmd/${command}/..." &
- pids+=($!)
+ pid=$!
+ pids+=($pid)
+ pid_to_cmd[$pid]="${command}"
done
# Wait for all parallel builds and collect failures
for pid in "${pids[@]}"; do
if ! wait "$pid"; then
- failures+=("$pid")
+ failures+=("${pid_to_cmd[$pid]}")
fi
done
if [[ ${`#failures`[@]} -gt 0 ]]; then
- echo "ERROR: ${`#failures`[@]} build(s) failed"
+ echo "ERROR: ${`#failures`[@]} build(s) failed: ${failures[*]}"
exit 1
fi🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@hack/install.sh` around lines 67 - 82, The script currently tracks only PIDs
(pids array) and counts failures (failures array) so failing builds aren't
named; change the launch loop to record the mapping of PID to command (e.g.,
declare -A pid_to_cmd and after starting each go install put
pid_to_cmd[$!]="$command"), then in the wait loop use that map to capture the
failed command name (retrieve pid_to_cmd[$pid]) and append the command name (not
just PID) to failures; finally, print the failing command names when reporting
errors. Ensure an associative array is declared before use and that you still
collect PIDs in pids for wait.
322a603 to
cceccc7
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cceccc7 to
459a2d6
Compare
|
@Prucek: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
Summary
go installcalls inhack/install.sh— builds all binaries concurrently instead of sequentiallyBUILD_IMAGESenv var allow-list to build only specific binaries when needed🤖 Generated with Claude Code