forked from vmware-tanzu/velero
-
Notifications
You must be signed in to change notification settings - Fork 18
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
openshift-merge-bot
merged 2 commits into
openshift:konveyor-dev
from
mateusoliveira43:fix/arm-images
Aug 6, 2024
Merged
fix: ARM images #332
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -1,18 +1,29 @@ | ||||||||
# TODO! Find a real ubi8 image for golang 1.16 | ||||||||
FROM quay.io/konveyor/builder:ubi9-latest AS builder | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
ARG TARGETOS | ||||||||
ARG TARGETARCH | ||||||||
|
||||||||
ENV GOPATH=$APP_ROOT | ||||||||
|
||||||||
COPY . /go/src/github.com/vmware-tanzu/velero | ||||||||
|
||||||||
WORKDIR /go/src/github.com/vmware-tanzu/velero | ||||||||
RUN CGO_ENABLED=0 GOOS=linux 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=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 | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
ARG TARGETOS | ||||||||
ARG TARGETARCH | ||||||||
|
||||||||
ENV GOPATH=$APP_ROOT | ||||||||
|
||||||||
RUN mkdir -p $APP_ROOT/src/github.com/restic \ | ||||||||
&& cd $APP_ROOT/src/github.com/restic \ | ||||||||
&& git clone https://github.com/konveyor/restic -b konveyor-dev | ||||||||
&& cd $APP_ROOT/src/github.com/restic \ | ||||||||
&& git clone https://github.com/konveyor/restic -b konveyor-dev | ||||||||
|
||||||||
WORKDIR $APP_ROOT/src/github.com/restic/restic | ||||||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static"' -o $APP_ROOT/src/restic github.com/restic/restic/cmd/restic | ||||||||
|
||||||||
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static"' -o $APP_ROOT/src/restic github.com/restic/restic/cmd/restic | ||||||||
|
||||||||
FROM registry.access.redhat.com/ubi9-minimal | ||||||||
RUN microdnf -y update && microdnf -y install nmap-ncat && microdnf -y reinstall tzdata && microdnf clean all | ||||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)