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

Support M1 MacBooks darwin/arm64 on the client-side #97743

Conversation

dims
Copy link
Member

@dims dims commented Jan 6, 2021

Please test using:

build/run.sh make generated_files && make quick-release-images

Signed-off-by: Davanum Srinivas davanum@gmail.com

What type of PR is this?

/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #97550

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Add support to generate client-side binaries for new darwin/arm64 platform

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jan 6, 2021
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 6, 2021
@dims
Copy link
Member Author

dims commented Jan 6, 2021

/sig release
/area release-eng
/priority important-soon

@kubernetes/release-managers WDYT? what else do we need?

@k8s-ci-robot k8s-ci-robot added sig/release Categorizes an issue or PR as relevant to SIG Release. area/release-eng Issues or PRs related to the Release Engineering subproject priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jan 6, 2021
@dims
Copy link
Member Author

dims commented Jan 6, 2021

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 6, 2021
@hasheddan
Copy link
Contributor

@dims we are going to be working on formalizing the process for supported platforms in the 1.21 cycle (kubernetes/sig-release#1337). This, along with riscv, would be a good candidate to be the pilots for this process. What do you think?

@dims
Copy link
Member Author

dims commented Jan 6, 2021

@hasheddan +1 sounds good!

@hwdef
Copy link
Member

hwdef commented Jan 6, 2021

/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 6, 2021
@dims
Copy link
Member Author

dims commented Jan 6, 2021

we'll need to wait for golang 1.16 ... forgot to mention :)
https://github.com/golang/go/blob/master/doc/go1.16.html#L36-L43

@dims dims changed the title Support M1 MacBooks darwin/arm64 on the client-side [WIP] Support M1 MacBooks darwin/arm64 on the client-side Jan 6, 2021
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 6, 2021
@dims
Copy link
Member Author

dims commented Jan 8, 2021

/lgtm cancel

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 8, 2021
@dims dims force-pushed the support-m1-macbook-darwin/arm64-as-client branch from f95165b to 649b2aa Compare January 16, 2021 04:15
@endocrimes
Copy link
Member

For good measure, I'll also include the output from make all here:

[kubernetes(dims-m1)] $ time make all
+++ [0303 14:06:06] Building go targets for darwin/arm64:
    cmd/kube-proxy
    cmd/kube-apiserver
    cmd/kube-controller-manager
    cmd/kubelet
    cmd/kubeadm
    cmd/kube-scheduler
    vendor/k8s.io/kube-aggregator
    vendor/k8s.io/apiextensions-apiserver
    cluster/gce/gci/mounter
    cmd/kubectl
    cmd/kubectl-convert
    cmd/gendocs
    cmd/genkubedocs
    cmd/genman
    cmd/genyaml
    cmd/genswaggertypedocs
    cmd/linkcheck
    vendor/github.com/onsi/ginkgo/ginkgo
    test/e2e/e2e.test
    cluster/images/conformance/go-runner
    cmd/kubemark
    vendor/github.com/onsi/ginkgo/ginkgo

make all  289.86s user 44.61s system 552% cpu 1:00.56 total

@dims
Copy link
Member Author

dims commented Mar 3, 2021

@endocrimes thanks! would you be able to verify that say kubectl works without rosetta2?

@pires
Copy link
Contributor

pires commented Mar 3, 2021

Passed on Docker for Mac 3.1.0, Mini M1 11.2.2 🎉

Go and Docker versions
$ go version
go version go1.16 darwin/amd64

$ docker version
Client: Docker Engine - Community
 Cloud integration: 1.0.8
 Version:           20.10.3
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        48d30b5
 Built:             Fri Jan 29 14:28:27 2021
 OS/Arch:           darwin/amd64 (rosetta)
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.3
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       46229ca
  Built:            Fri Jan 29 14:32:07 2021
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

@endocrimes
Copy link
Member

endocrimes commented Mar 3, 2021

@dims here you go!

[kubernetes(dims-m1)] $ ./_output/bin/kubectl version  
Client Version: version.Info{Major:"1", Minor:"21+", GitVersion:"v1.21.0-beta.0.254+f719624654c68d", GitCommit:"f719624654c68d143cad4e4af2f21cca0bfde8fd", GitTreeState:"clean", BuildDate:"2021-03-03T13:06:06Z", GoVersion:"go1.16", Compiler:"gc", Platform:"darwin/arm64"}
Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.4+k3s-8f9e5628-dirty", GitCommit:"8f9e5628c1b5f0a673cde6051cea1afb65dcff7f", GitTreeState:"dirty", BuildDate:"2020-12-05T00:04:10Z", GoVersion:"go1.16", Compiler:"gc", Platform:"linux/amd64"}
[kubernetes(dims-m1)] $ ./_output/bin/kubectl get pods
NAME                                   READY   STATUS    RESTARTS   AGE
svclb-home-assistant-j6gw8             1/1     Running   1          4d14h
svclb-plex-jk9p7                       1/1     Running   1          4d14h
svclb-blocky-udp-9l5br                 1/1     Running   1          4d14h
svclb-blocky-tcp-rxgth                 1/1     Running   1          4d14h
home-assistant-postgresql-0            1/1     Running   1          4d14h
athens-athens-proxy-6996f79987-9qs2j   1/1     Running   1          4d14h
photoprism-69d744dc9c-z2tr4            1/1     Running   1          4d14h
blocky-6c8f4c5fd-qkqm6                 1/1     Running   1          4d14h
home-assistant-66f459b4d7-c9sjb        1/1     Running   1          4d14h

Update:
Also validated log streaming and port forwarding, both work as expected

@dims
Copy link
Member Author

dims commented Mar 3, 2021

@endocrimes thanks!

/meowvie thanks

@k8s-ci-robot
Copy link
Contributor

@dims: cat image

In response to this:

@endocrimes thanks!

/meowvie thanks

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/test-infra repository.

@stevesloka
Copy link
Contributor

Worked fine for me! 🎉

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 3, 2021
@erismaster
Copy link

Hello! I am from the Bug Triage team! Friendly reminder that code freeze is starting March 9th, 2021 (about 1 week from now). We want to ensure that each PR has a chance to be merged before code freeze. This looks like its close to being approved and merged but still commenting for awareness 😄

@estesp
Copy link

estesp commented Mar 3, 2021

Just FYI--I got my M1 before the end of 2020 and had a fairly hacked up environment (brew under Rosetta and hadn't updated to the M1-enabled /opt/homebrew configuration) as well as my iTerm started with arch x86_64 to "force" Rosetta.

To get the changes in this PR to work I had to undo my arch hackiness (which I've needed to for awhile, so thanks for forcing my hand @dims! 😂 ) and make sure I was running fully under linux/arm64 mode with Go + brew + terminal bash all aligned. Once I did that everything worked properly. file kubectl shows it building as a proper aarch64 binary.

$ file kubectl
kubectl: Mach-O 64-bit executable arm64

@dims
Copy link
Member Author

dims commented Mar 3, 2021

woohoo @estesp !

@BenTheElder
Copy link
Member

@dims see: #97743 (comment)

@dims
Copy link
Member Author

dims commented Mar 3, 2021

@BenTheElder sorry missed it. responded there

@BenTheElder
Copy link
Member

/lgtm
/approve
/triage accepted
/test all

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 4, 2021
@BenTheElder
Copy link
Member

/test pull-kubernetes-cross

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 4, 2021
@justaugustus
Copy link
Member

/test pull-kubernetes-e2e-kind

@k8s-ci-robot k8s-ci-robot merged commit 2e39df8 into kubernetes:master Mar 4, 2021
@endocrimes
Copy link
Member

✨ 🚀 💖

@dims
Copy link
Member Author

dims commented Mar 4, 2021

Thanks everyone for helping with testing this!

@endocrimes @estesp @stevesloka @pires @alenkacz @ghuntley (apologies if i missed anyone!)

image

@timkuilman
Copy link

This was super interesting to follow. I managed to build kubectl from source and it works like a charm 🔥

@dims
Copy link
Member Author

dims commented Mar 4, 2021

for those who end up coming here ... if you need just kubectl ... you don't need to build the full release. just do:

make kubectl

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder, dims, headcr4sh, justaugustus

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

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. area/release-eng Issues or PRs related to the Release Engineering subproject area/test 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. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/release Categorizes an issue or PR as relevant to SIG Release. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support M1 MacBooks darwin/arm64