Skip to content

Update dockerfile to start supporting multi-arch builds #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

AjayJagan
Copy link
Member

@AjayJagan AjayJagan commented Jul 2, 2025

Description

As a part of an effort to enable multi arch builds in konflux, we need to update the Dockerfile.

JIRA: https://issues.redhat.com/browse/RHOAIENG-28666

How Has This Been Tested?

Image built from konflux: quay.io/redhat-user-workloads/open-data-hub-tenant/codeflare-operator-multi-arch-poc:3adac4d93c0c4deedef5fdb484b6bdbccdfccb14

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

Summary by CodeRabbit

  • Chores
    • Updated the Dockerfile to streamline the build process with a new base image and simplified build arguments, enhancing build efficiency without affecting application features or behavior.

Copy link

coderabbitai bot commented Jul 2, 2025

Warning

Rate limit exceeded

@AjayJagan has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 55 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 3741763 and f533436.

📒 Files selected for processing (1)
  • Dockerfile (2 hunks)

Walkthrough

The Dockerfile was refactored to use a single-stage build based on the Red Hat UBI 9 go-toolset 1.23 image, replacing the previous multi-stage approach. Manual installation of build dependencies and Go was removed, and build arguments were simplified. The build command now utilizes TARGETARCH for architecture specification.

Changes

File Change Summary
Dockerfile Refactored to use UBI 9 go-toolset 1.23 as the build stage base image; removed manual dependency installation; simplified build arguments and architecture handling.

Suggested labels

lgtm, approved

Poem

In my Docker burrow, I found a new way,
UBI 9 and Go together—hip, hip, hooray!
No more layers of fuss, just a single clean stage,
Building my code with wisdom and sage.
🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@openshift-ci openshift-ci bot requested review from Fiona-Waters and tedhtchang July 2, 2025 10:55
Copy link

openshift-ci bot commented Jul 2, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

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

@AjayJagan
Copy link
Member Author

Hi Team, Can we also port these changes to the upstream project ?

cc: @grdryn

Copy link

@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

🧹 Nitpick comments (2)
Dockerfile (2)

4-4: TARGETOS build arg is declared but never used
You only consume TARGETARCH, so TARGETOS adds noise and invites confusion.

-ARG TARGETOS TARGETARCH
+ARG TARGETARCH

2-22: Minor: reuse Go module cache between builds to shrink CI times
You can split dependency download into its own layer to leverage Docker cache:

FROM registry.access.redhat.com/ubi9/go-toolset:1.23 AS builder
ARG TARGETARCH
WORKDIR /workspace

# -- deps layer -------------------------------------------------
COPY go.mod go.sum ./
RUN go mod download

# -- source layer ----------------------------------------------
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH:-amd64} make go-build-for-image

Nice-to-have, but keeps incremental builds < 10 s.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7425d52 and a53db9f.

📒 Files selected for processing (1)
  • Dockerfile (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: precommit
🔇 Additional comments (1)
Dockerfile (1)

17-17: Cross-compile + CGO: verify tool-chain availability for non-amd64 arches
CGO_ENABLED=1 requires cross libc + gcc support for every $TARGETARCH you intend to build (e.g. aarch64, ppc64le). The UBI 9 tool-set image ships only native gcc; cross builds will fail unless gcc-$ARCH-linux-gnu packages are added.
Either disable CGO (CGO_ENABLED=0) or extend the image with the needed cross tool-chains.

@AjayJagan AjayJagan force-pushed the konflux-dockerfile-update branch 3 times, most recently from 3741763 to 1efc90a Compare July 2, 2025 11:10
@AjayJagan AjayJagan force-pushed the konflux-dockerfile-update branch from 1efc90a to f533436 Compare July 2, 2025 11:11
@AjayJagan
Copy link
Member Author

/test e2e-odh-cfo

@AjayJagan
Copy link
Member Author

@Fiona-Waters @tedhtchang , can some help me review this please :)

Copy link

openshift-ci bot commented Jul 8, 2025

@AjayJagan: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-odh-cfo f533436 link false /test e2e-odh-cfo

Full PR test history. Your PR dashboard.

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.

@chipspeak
Copy link

Hey Ajay, this looks good to me. We run our CI and e2e in the upstream moreso so I can't speak to the prow failure there. Are there some example multi-arch images built during the testing of this that we could see?

@AjayJagan
Copy link
Member Author

AjayJagan commented Jul 9, 2025

@chipspeak
Copy link

Hi Team, Can we also port these changes to the upstream project ?

cc: @grdryn

I think we'd need to have a chat about this as a team because that would involve onboarding the upstream project to Konflux. cc @laurafitzgerald

@chipspeak
Copy link

@chipspeak , here is an index image that was built in konflux: quay.io/redhat-user-workloads/open-data-hub-tenant/codeflare-operator-multi-arch-poc:3adac4d93c0c4deedef5fdb484b6bdbccdfccb14

Has this image been put through any testing within the context of RHOAI or is it purely the Konflux ones and then whatever CI it passes?

@AjayJagan
Copy link
Member Author

Has this image been put through any testing within the context of RHOAI or is it purely the Konflux ones and then whatever CI it passes?

Nope, no testing has been done in context of RHOAI.

it purely the Konflux ones and then whatever CI it passes

yes

Copy link

@laurafitzgerald laurafitzgerald left a comment

Choose a reason for hiding this comment

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

Hi @AjayJagan Apologies for the delay in reviewing here. it would be great if we can submit these changes upstream as you suggested. We have a sync which will bring them here. Depending on the timeframe you'd like this work to be completed by. If there isn't time, can you add the appropriate CARRY or PATCH prefix to your commit message.

Also you can ignore the failing test for now. Ref https://issues.redhat.com/browse/RHOAIENG-29260
I can override that for you if you want to get this pr merged.


FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest

Choose a reason for hiding this comment

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

Is it usual to use the latest tag here for ubi9?

Copy link
Member Author

Choose a reason for hiding this comment

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

@AjayJagan
Copy link
Member Author

it would be great if we can submit these changes upstream as you suggested.

I have it ready now : project-codeflare#690

@AjayJagan
Copy link
Member Author

@laurafitzgerald , should I close this in favor of the one opened in the upstream?

@AjayJagan
Copy link
Member Author

closing this PR as the change is merged upstream and will be synced here.

@AjayJagan AjayJagan closed this Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants