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

Add support for arm64 to kube-cross image #1853

Merged

Conversation

dims
Copy link
Member

@dims dims commented Jan 15, 2021

We should be able to compile for say linux/arm64 using this image on arm64. We'll not be able to cross-compile on non-amd64 platforms.

Notes:

  • Adding linux/arm64 linux/ppc64le variations in addition to currentu linux/amd64.
  • Had to bump PROTOBUF_VERSION for additional architectures
  • tested using make container locally
  • basically we are enabling simple scenarios like "make kubelet" work on arm64 boxes
  • crossbuild-essential-* are not available on the non-amd64 platforms :( we end up with broken packages.

Signed-off-by: Davanum Srinivas [email protected]

What type of PR is this?

/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

We should be able to compile for say linux/arm64 using this image on
arm64. We'll not be able to cross-compile on non-amd64 platforms.

Signed-off-by: Davanum Srinivas <[email protected]>
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 15, 2021
@dims dims changed the title [WIP] Add support for arm64 to kube-cross image Add support for arm64 to kube-cross image Jan 15, 2021
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jan 15, 2021
@dims
Copy link
Member Author

dims commented Jan 15, 2021

/assign @hasheddan @justaugustus

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Jan 15, 2021
Copy link
Contributor

@hasheddan hasheddan left a comment

Choose a reason for hiding this comment

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

Thanks for adding this @dims! One nitpick below, otherwise LGTM 👍

@@ -41,8 +41,11 @@ ENV KUBE_CROSSPLATFORMS \
##------------------------------------------------------------

# Pre-compile the standard go library when cross-compiling. This is much easier now when we have go1.5+
RUN for platform in ${KUBE_CROSSPLATFORMS}; do GOOS=${platform%/*} GOARCH=${platform##*/} go install std; done \
&& go clean -cache
RUN targetArch=$(echo $TARGETPLATFORM | cut -f2 -d '/') \
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: how would you feel about setting TARGETARCH as env var once at beginning so that we don't have to execute on each command?

Copy link
Member Author

Choose a reason for hiding this comment

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

Apparently that does not work, i ended up eye-balling a bunch of code similar:
https://grep.app/search?q=TARGETPLATFORM&case=true&filter[lang][0]=Dockerfile

could be something wrong in my setup. could we merge and iterate please?

Copy link
Contributor

Choose a reason for hiding this comment

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

works for me 👍

Copy link
Contributor

@hasheddan hasheddan left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 16, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dims, hasheddan

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

@dims dims removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 16, 2021
@k8s-ci-robot k8s-ci-robot merged commit 1f60173 into kubernetes:master Jan 16, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Jan 16, 2021
@justaugustus
Copy link
Member

Future note: Let's make sure we bump the image tags on these changes e.g., v1.15.5-1 --> v1.15.5-2

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants