Skip to content
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

fix: ARM images #332

Merged

Conversation

mateusoliveira43
Copy link

@mateusoliveira43 mateusoliveira43 commented Jul 29, 2024

Add ARM images to PROW CI

Example image: https://quay.io/repository/msouzaol/velero

Related to openshift/release#54877

How to build

docker build -t <TAG> -f Dockerfile.ubi . --platform=linux/arm64

Signed-off-by: Mateus Oliveira <[email protected]>
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 29, 2024
Copy link

openshift-ci bot commented Jul 29, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Signed-off-by: Mateus Oliveira <[email protected]>
@mateusoliveira43 mateusoliveira43 marked this pull request as ready for review August 5, 2024 16:06
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 5, 2024
Copy link

openshift-ci bot commented Aug 5, 2024

@mateusoliveira43: all tests passed!

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.

@@ -1,10 +1,16 @@
FROM quay.io/konveyor/builder:latest AS builder
FROM quay.io/konveyor/builder:ubi9-latest AS builder
Copy link
Member

@kaovilai kaovilai Aug 5, 2024

Choose a reason for hiding this comment

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

Suggested change
FROM quay.io/konveyor/builder:ubi9-latest AS builder
FROM --platform=$BUILDPLATFORM quay.io/konveyor/builder:ubi9-latest AS builder
ARG BUILDPLATFORM

Since we are optimizing, and golang can cross compile binary, and this is not the final stage, we can set BUILDPLATFORM to get more optimum performance.

ref: cross-compilation

Copy link
Author

Choose a reason for hiding this comment

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

but this would make only multi platform builds faster, not?

since multi platform builds are CI responsibility (and I do not know how PROW does it), I think we do not need this

Copy link
Member

Choose a reason for hiding this comment

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

right do not need. but doesn't hurt to add for local dev builds either when building for dev/customers who are on arch other than the dev machine.

Copy link
Member

Choose a reason for hiding this comment

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

im on arm, so this would speed up builds of amd64 images to use on amd64 cluster.

Copy link
Member

@kaovilai kaovilai Aug 6, 2024

Choose a reason for hiding this comment

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

This would make single platform build faster if the OS building (ie. laptop is arm64) is different than intended image platform (for amd64 cluster)

@@ -1,18 +1,29 @@
# TODO! Find a real ubi8 image for golang 1.16
FROM quay.io/konveyor/builder:ubi9-latest AS builder
Copy link
Member

@kaovilai kaovilai Aug 5, 2024

Choose a reason for hiding this comment

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

Suggested change
FROM quay.io/konveyor/builder:ubi9-latest AS builder
FROM --platform=$BUILDPLATFORM quay.io/konveyor/builder:ubi9-latest AS builder
ARG BUILDPLATFORM

RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static"' -o /go/src/velero-helper github.com/vmware-tanzu/velero/cmd/velero-helper

RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=konveyor-dev' -o /go/src/velero github.com/vmware-tanzu/velero/cmd/velero
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static"' -o /go/src/velero-helper github.com/vmware-tanzu/velero/cmd/velero-helper

FROM quay.io/konveyor/builder:ubi9-latest AS restic-builder
Copy link
Member

@kaovilai kaovilai Aug 5, 2024

Choose a reason for hiding this comment

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

Suggested change
FROM quay.io/konveyor/builder:ubi9-latest AS restic-builder
FROM --platform=$BUILDPLATFORM quay.io/konveyor/builder:ubi9-latest AS restic-builder
ARG BUILDPLATFORM

Copy link

@weshayutin weshayutin left a comment

Choose a reason for hiding this comment

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

/LGTM

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 6, 2024
@mateusoliveira43
Copy link
Author

/cherry-pick oadp-1.4

@openshift-cherrypick-robot

@mateusoliveira43: once the present PR merges, I will cherry-pick it on top of oadp-1.4 in a new PR and assign it to you.

In response to this:

/cherry-pick oadp-1.4

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.

@kaovilai kaovilai added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 6, 2024
Copy link

openshift-ci bot commented Aug 6, 2024

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: kaovilai, mateusoliveira43, weshayutin

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

The pull request process is described 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

@openshift-merge-bot openshift-merge-bot bot merged commit 41ad312 into openshift:konveyor-dev Aug 6, 2024
3 checks passed
@openshift-cherrypick-robot

@mateusoliveira43: #332 failed to apply on top of branch "oadp-1.4":

Applying: fix: ARM images
Using index info to reconstruct a base tree...
M	Dockerfile.ubi
Falling back to patching base and 3-way merge...
Auto-merging Dockerfile.ubi
CONFLICT (content): Merge conflict in Dockerfile.ubi
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 fix: ARM images
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick oadp-1.4

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.

openshift-merge-bot bot pushed a commit that referenced this pull request Aug 6, 2024
* fix: ARM images

Signed-off-by: Mateus Oliveira <[email protected]>

* fixup! fix: ARM images

Signed-off-by: Mateus Oliveira <[email protected]>

---------

Signed-off-by: Mateus Oliveira <[email protected]>
(cherry picked from commit 41ad312)
sseago pushed a commit to sseago/velero that referenced this pull request Aug 22, 2024
* fix: ARM images

Signed-off-by: Mateus Oliveira <[email protected]>

* fixup! fix: ARM images

Signed-off-by: Mateus Oliveira <[email protected]>

---------

Signed-off-by: Mateus Oliveira <[email protected]>
(cherry picked from commit 41ad312)
shubham-pampattiwar pushed a commit that referenced this pull request Aug 22, 2024
* fix: ARM images

Signed-off-by: Mateus Oliveira <[email protected]>

* fixup! fix: ARM images

Signed-off-by: Mateus Oliveira <[email protected]>

---------

Signed-off-by: Mateus Oliveira <[email protected]>
sseago pushed a commit to sseago/velero that referenced this pull request Sep 19, 2024
* fix: ARM images

Signed-off-by: Mateus Oliveira <[email protected]>

* fixup! fix: ARM images

Signed-off-by: Mateus Oliveira <[email protected]>

---------

Signed-off-by: Mateus Oliveira <[email protected]>
sseago pushed a commit to sseago/velero that referenced this pull request Dec 11, 2024
* fix: ARM images

Signed-off-by: Mateus Oliveira <[email protected]>

* fixup! fix: ARM images

Signed-off-by: Mateus Oliveira <[email protected]>

---------

Signed-off-by: Mateus Oliveira <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants