← Back to Pull requests

Set up QEMU and limit GOMAXPROCS for emulated builder builds #4339

Closed
unknown closed this pull request without merging on Nov 12, 2026 15:28 UTC
View on GitHub
unknown unknown commented on Nov 10, 2026 21:38 UTC
Author

<!-- Thanks for sending a pull request! Here are some tips for you:
1. Follow the instructions for writing a release note from k8s: https://git.k8s.io/community/contributors/guide/release-notes.md
-->

What this PR does / why we need it:

After the builder moved to CentOS Stream 10, publication repeatedly failed on s390x. The tracing added in #4336 showed that uname -m worked, but dnf --version exited with status 139 before package installation. A later run also stalled during Go tool installation on arm64 until the job timed out.

This PR makes two changes:

  • Register QEMU interpreters before Buildah builds that target architectures other than the host architecture.

  • Set GOMAXPROCS=3 during Go tool installation on arm64 and s390x to mitigate hangs under QEMU, following the workaround in kubevirt/project-infra#4654. Add shell tracing and go install -v to show progress.
  • The QEMU setup uses the same image and registration command as KubeVirt's hack/builder/build-centos-stream-10.sh:

    podman run --rm --privileged quay.io/linuxserver.io/qemu-static --reset -p yes

    KubeVirt runs this command when its check for an enabled aarch64 handler fails. CDI runs it before every Buildah build that requires emulation, rather than relying on the handlers already registered in the CI environment.

    The existing build and publication flow is unchanged. There is no probe or retry logic.

    Which issue(s) this PR fixes:

    Related to CNV-98989, #4333 and #4336.

    Special notes for your reviewer:

    The registration replaces all visible qemu-* binfmt handlers, including arm64, and may affect other workloads sharing them.

    If registration fails, the script stops with its exit status. Printing the registered handlers is best effort and does not block the build.

    The GOMAXPROCS limit applies only to the Go tool installation RUN step on arm64 and s390x, including native builds on those architectures. It is not stored as an ENV setting in the resulting image.

    The Docker build path, builder pin and runtime RPMs are unchanged.

    Validation of the simplified QEMU setup included nine passing scenarios with stubbed commands on Fedora. One mount scenario was skipped because binfmt_misc was already mounted. bash -n and git diff --check also passed.

    Post-merge validation:
    https://prow.ci.kubevirt.io/view/gs/kubevirt-prow/logs/push-containerized-data-importer-builder/2120901674712174592

    The publisher completed successfully in about 35 minutes:

  • QEMU registration completed and the registered s390x and arm64 interpreter paths were printed.

  • s390x passed dnf --version.

  • Go tool installation completed on arm64 and s390x with GOMAXPROCS=3.

  • All three architectures were built and published.
  • Published builder:
    quay.io/kubevirt/kubevirt-cdi-bazel-builder:2611121529-29097cbdf

    The published OCI index was checked with skopeo and contains linux/amd64, linux/arm64 and linux/s390x.

    This confirms that the updated setup works. It does not establish the root cause of the earlier failures: the successful run used a different node, and the job settings were also updated in kubevirt/project-infra#5625.

    Release note:
    ``release-note
    NONE
    ``

    Diff: 399 lines (+299 / -100) across 4 files Reviewer: pelefant Review duration: 2510m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 399 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.358
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #4339"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.2% (MEDIUM) · Higher = larger blast radius
    43.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.1% · Safe to merge
    17.1%