-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
✨ Update Makefile for go/v3 to support darwin/arm64 #2706
✨ Update Makefile for go/v3 to support darwin/arm64 #2706
Conversation
Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
Hi @everettraven. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: everettraven 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 |
/cc @camilamacedo86 @ryantking Do either of you have an M1 Mac and are able to test this and see if it works? If not do you know anyone who may be able to? Thanks! |
@everettraven: GitHub didn't allow me to request PR reviews from the following users: ryantking. Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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. |
Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
Only builds if etcd doesn't already exist on the system Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
@@ -179,15 +179,35 @@ KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/k | |||
.PHONY: kustomize | |||
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. | |||
$(KUSTOMIZE): $(LOCALBIN) | |||
ifeq "$(uname -s)" "Darwin" |
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.
It is hard to keep maintained and not sustainable ( Spaghetti Code )
Also, we cannot do that. We cannot add a script from your repo in the default scaffold.
About etcd bin
The etcd bin is used for ENV TEST and is shipped via the kubebuilder-tools, see:
- https://github.com/kubernetes-sigs/kubebuilder/tree/tools-releases
- https://storage.googleapis.com/kubebuilder-tools
Also, we are close to having that bin from the project:
As soon we have the binary there we can trigger the job in the cloud to build the kubebuilder-tools for darwin/arm64. To better understand it check the issue: #2664
About kustomize bin
You can follow up: kubernetes-sigs/kustomize#4612
Users will be able to use it with kustomize/v2 and go/v4-alpha, see: #2552
I am not sure if we should assume the decomposability to build kustomize v2 for darwin/arm64 to make it work with go/v3 stable. That will add this kind of complexity to the Makefile and also we would need to properly build it in the cloud as we do with the kubebuilder-tools instead. It seems out of the scope from Kubebuilder itself.
However, we could doc the script for example to allow users to build it by themselves and doc as an option. But the script also needs to leave in the repo or some official place and not in our fork. We would like to have a FAQ section such as we have in SDK for the docs, so I think we could add the info there and link the script. WDYT?
To know more about what is required to support apple silicon and what was done or not so far see: #1932
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.
/hold
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.
Sounds good. I think at least adding some docs for a workaround would be good so that users can begin using Kubebuilder/Operator SDK to develop operators on apple silicon.
Just as an aside, the goal of this PR is to add those scripts to Kubebuilder as well so that the scripts that are run in the makefile are from the official Kubebuilder repo, I just left it pointing to my fork so we could test that it actually works since Kubebuilder doesn't have the scripts in place yet and would modify it to point to Kubebuilder prior to merging.
If this isn't a direction that we want to explore that is fine and I can close this PR, just thought I would give it a shot at trying to provide a solution that would allow development with go/v3 on Apple Silicon. Thanks for the feedback!
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.
Sounds good. I think at least adding some docs for a workaround would be good so that users can begin using Kubebuilder/Operator SDK to develop operators on apple silicon.
- For the Kubebuilder side we can begin to support Apple Silicon from go/v4-alpha and with kustomize/v2-alpha
- For SDK we need to discuss how we will do it there? Could we accept the breaking change for ansible/helm/hybrid instead of creating a new plugin or not for example?
Just as an aside, the goal of this PR is to add those scripts to Kubebuilder as well so that the scripts that are run in the makefile are from the official Kubebuilder repo, I just left it pointing to my fork so we could test that it actually works since Kubebuilder doesn't have the scripts in place yet and would modify it to point to Kubebuilder prior to merging.
I think we have some options to address these ones, follow some ideas/suggestion:
Regards the bins used in kubebuilder-tools/env test:
a) We could Improve the kubebuilder-tools scripts for if the bin does not exist we build them for the arch informed so that it can work in the cloud and can be used by the authors. Also, we can improve the doc: https://book.kubebuilder.io/reference/artifacts.html and let the users know about that and that they can use it to build for any platform
Regards kustomize
- For the next release, we will need to clarify its support with go/v4-alpha in the quickstart probably, I am looking if we can merge ✨(go/v4-alpha): add new golang plugin which uses the default golang base v3 and the new alpha kustomze/v2-alpha #2552 so that we can work on this
- Also, we could add a new section FAQ as we have in SDK docs ( see that we have many issues track to do that and add the info there ) then, we can have a directory under it called script and add the script that will let users know that they can use to build kustomize v2 for apple silicon or for any other platform that they need.
Regards SDK
After we add the changes here in SDK we can use/ link and redirect users to not need to duplicate the content and be required to keep maintained two places
WDYT? Is that make sense?
Could you shape your scripts so we provide them to the users via the FAQ? Would you like to contribute with the kubebuilder-tools scripts to make them be able to build the project when the bin is not found?
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.
Most of that makes sense to me. I may need a bit more clarification as I start to do some of those things. I would be happy to help out in any way that I can.
As I have time, I can begin working on updating the kubebuilder-tools scripts to build the tool if necessary. Then I think we can potentially discuss more regarding kustomize and and SDK as work on those solutions progresses.
I will go ahead and close this PR. Thanks @camilamacedo86 !
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.
Sure, if you wish we can track issues with that as well.
and by sure .. feel free to ping if you need any help
Closing as per discussion in this review comment thread: #2706 (comment) |
Description of Change
kustomize
andetcd
locallyetcd
locally withmake etcd
kustomize
Makefile target to build from source locally if running ondarwin/arm64
(Darwin
as result fromuname -s
andaarch64
as result fromuname -m
)Motivation for Change
There is seemingly more and more issues occurring for users that are using the M1 Macs to build operators with both Kubebuilder and Operator SDK. This change should provide users an easier way to remediate the issues by providing a new Makefile target to build
etcd
from source and modifying the existing Makefile target for installingkustomize
to build from source if running ondarwin/arm64
.Additional Context
I do not have an M1 Mac and therefore cannot test this change myself to verify it resolves issues for users on the new M1 Macs. I was however able to test that the scripts added work as expected.