Skip to content

NO-JIRA: enable multi-architecture yarn builds#16228

Open
lgarciaaco wants to merge 1 commit intoopenshift:mainfrom
lgarciaaco:release-5.0
Open

NO-JIRA: enable multi-architecture yarn builds#16228
lgarciaaco wants to merge 1 commit intoopenshift:mainfrom
lgarciaaco:release-5.0

Conversation

@lgarciaaco
Copy link
Copy Markdown

@lgarciaaco lgarciaaco commented Mar 31, 2026

Summary

Enable multi-architecture yarn builds with hermetic build support

Changes

Convert Dockerfile to use hermetic build approach with cachi2 and add support for multiple architectures (x64, arm64, s390x, ppc64) in yarn configuration. This resolves hermetic build failures on non-x86_64 architectures by ensuring all required architecture-specific packages are included in dependency resolution.

Summary by CodeRabbit

  • Chores
    • Streamlined frontend build pipeline for improved maintainability
    • Extended platform architecture support for Linux deployments (x64, arm64, s390x, ppc64)

@openshift-ci openshift-ci bot requested review from jhadvig and rhamilto March 31, 2026 11:35
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

📝 Walkthrough

Walkthrough

The Dockerfile's frontend build stage has been simplified by removing Corepack bootstrap logic and cachito-backed artifact handling in favor of direct Yarn invocation (yarn-4.12.0.cjs). A WORKDIR frontend directive was added, and subsequent build commands now execute relative to that directory. The frontend/.yarnrc.yml configuration file now declares supported architectures (linux on x64, arm64, s390x, and ppc64). The Cypress binary suppression setting was retained.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 `@Dockerfile`:
- Line 18: The Dockerfile uses a relative WORKDIR ("WORKDIR frontend") which is
brittle; replace that WORKDIR instruction with an absolute path instead so the
build is explicit and not dependent on the base image's CWD—update the WORKDIR
line in the Dockerfile (the "WORKDIR frontend" instruction) to use an absolute
directory for the frontend build directory that matches your repo layout.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 12799d17-97a2-44eb-97f3-5c3732a321c4

📥 Commits

Reviewing files that changed from the base of the PR and between 2e67298 and 5dba68f.

📒 Files selected for processing (2)
  • Dockerfile
  • frontend/.yarnrc.yml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • Dockerfile
🪛 Hadolint (2.14.0)
Dockerfile

[error] 18-18: Use absolute WORKDIR

(DL3000)

🪛 Trivy (0.69.3)
Dockerfile

[error] 18-18: WORKDIR path not absolute

WORKDIR path 'frontend' should be absolute

Rule: DS-0009

Learn more

(IaC/Dockerfile)

🔇 Additional comments (2)
frontend/.yarnrc.yml (1)

13-16: Solid multi-arch configuration.

The supportedArchitectures block correctly declares the target platforms for hermetic builds. This ensures Yarn fetches native bindings for all four CPU architectures during dependency resolution, which is exactly what's needed for cross-platform container builds.

Dockerfile (1)

21-22: Clean simplification of the build flow.

Direct yarn invocation with --immutable is the right call for hermetic builds—ensures lockfile integrity and removes the cachito/corepack dance. Version-pinned yarn path keeps builds reproducible.

&& cp -f $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app/frontend/{.npmrc,.yarnrc.yml,yarn.lock} frontend/

# prevent download of cypress binary as part of module installs
WORKDIR frontend
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use absolute WORKDIR for clarity and robustness.

Static analysis correctly flags this. While the relative path works (base image sets /opt/app-root/src), an absolute path makes the build self-documenting and immune to upstream base image changes.

🔧 Proposed fix
-WORKDIR frontend
+WORKDIR /opt/app-root/src/frontend
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
WORKDIR frontend
WORKDIR /opt/app-root/src/frontend
🧰 Tools
🪛 Hadolint (2.14.0)

[error] 18-18: Use absolute WORKDIR

(DL3000)

🪛 Trivy (0.69.3)

[error] 18-18: WORKDIR path not absolute

WORKDIR path 'frontend' should be absolute

Rule: DS-0009

Learn more

(IaC/Dockerfile)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Dockerfile` at line 18, The Dockerfile uses a relative WORKDIR ("WORKDIR
frontend") which is brittle; replace that WORKDIR instruction with an absolute
path instead so the build is explicit and not dependent on the base image's
CWD—update the WORKDIR line in the Dockerfile (the "WORKDIR frontend"
instruction) to use an absolute directory for the frontend build directory that
matches your repo layout.

@logonoff
Copy link
Copy Markdown
Member

/retitle NO-JIRA: enable multi-architecture yarn builds

@logonoff
Copy link
Copy Markdown
Member

/label px-approved
/label docs-approved
/verified by CI

@openshift-ci openshift-ci bot changed the title build(frontend): enable multi-architecture yarn builds NO-JIRA: enable multi-architecture yarn builds Mar 31, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 31, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@lgarciaaco: This pull request explicitly references no jira issue.

Details

In response to this:

Summary

Enable multi-architecture yarn builds with hermetic build support

Changes

Convert Dockerfile to use hermetic build approach with cachi2 and add support for multiple architectures (x64, arm64, s390x, ppc64) in yarn configuration. This resolves hermetic build failures on non-x86_64 architectures by ensuring all required architecture-specific packages are included in dependency resolution.

Summary by CodeRabbit

  • Chores
  • Streamlined frontend build pipeline for improved maintainability
  • Extended platform architecture support for Linux deployments (x64, arm64, s390x, ppc64)

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Mar 31, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@logonoff: This PR has been marked as verified by CI.

Details

In response to this:

/label px-approved
/label docs-approved
/verified by CI

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added px-approved Signifies that Product Support has signed off on this PR docs-approved Signifies that Docs has signed off on this PR labels Mar 31, 2026
Convert Dockerfile to use hermetic build approach with cachi2 and add
support for multiple architectures (x64, arm64, s390x, ppc64) in yarn
configuration. This resolves hermetic build failures on non-x86_64
architectures by ensuring all required architecture-specific packages
are included in dependency resolution.

The change simplifies the build process by removing complex corepack
setup and cachito integration in favor of the standard hermetic build
pattern used across OpenShift components.
@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Apr 1, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 1, 2026

@lgarciaaco: all tests passed!

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@logonoff
Copy link
Copy Markdown
Member

logonoff commented Apr 1, 2026

/lgtm
/verified by CI

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Apr 1, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@logonoff: This PR has been marked as verified by CI.

Details

In response to this:

/lgtm
/verified by CI

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 1, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 1, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lgarciaaco, logonoff
Once this PR has been reviewed and has the lgtm label, please assign rhamilto for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants