-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
cross build s390x kind binary and associated images by default #1705
Conversation
…ges namely base, kindnetd and haproxy
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. 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. I understand the commands that are listed here. |
Welcome @guirish! |
Hi @guirish. 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: guirish 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 |
You can override these at build time already and include this if you wish. Why should we include this by default. |
Hi @BenTheElder , we are planning to setup our own local CI to test and publish Kubernetes Integration and Conformance test results specific to s390x. We have raised this PR so that we could have the cross built kind binary and its associated multi-arch images as releases, which would in-turn help us in our CI setup. |
Currently there's no continuous testing of s390x in any form in the Kubernetes project, adding this might be valuable to someone. Can you elaborate on your intentions here and who / what groups you're working with within the Kubernetes project? Is this going to be continuous testing? I.E. not Kubernetes tagged releases, but ongoing development versions (HEAD)? If this is just downstream conformance testing releases or something along those lines, I'm not sure this is the best use of our resources, given that you can already build custom images for your own usage. Building for more platforms is very slow compared to the native platform build. |
Hi @BenTheElder, Let me provide some background and answer to your questions. @guirish feel free to add any comments too. |
@cwsolee why not try to help the sig-testing team with the required resources to help with this ^^^ task upstream? I ask because I am also interested in using kind on s390x to test ingress-nginx Note: the changes in this PR are not enough to build the kindest/node image. This is what I changed to build the image |
@aledbf Thanks for highlighting the changes required for building node image, this PR is not specific to adding support to build node image. I'm planning to PR node specific changes after this PR. I will look into your changes. |
support already existed without this change (PLATFORMS is ?=, so you can supply it and it will accept the value you set instead, the and the go binary / CLI is trivially compileable on / for s390x without the release / cross build script). what this change actually does is build them by default. building them by default is NOT a blocker to using kind on this platform, with respect to kubernetes/kubernetes#93621 conformance is a pretty good start, though we usually aim to run more e2e test cases than that. I have been re-working the node image build to support more platforms more easily. It has been slow going with other things going on, particularly kubernetes/test-infra#18551 |
Yes @BenTheElder , I agree that we can cross build kind binary and associated images excluding node by setting PLATFORM value to respective disto/ARCH, my intention here for raising this PR was to get s390x binary as release similar to amd64,arm64,arm and ppc64le. We are currently trying to build node image using kind and bazel locally, as node image is required in running conformance tests. |
I just realized I didn't respond to this last comment, sorry.
Yes, but I'm not overly interested in releasing for another platform that isn't actually functional. We're not removing the current platforms so as not to break anyone already choosing to depend on these. but I'm going to start noting the level of support for these. building the base image has gotten so much slower with these additional platforms and they're of little use and demand to us at the moment. arm at least has some growing developer machine usage and provided some upstream CI signal. I will revisit this in the 0.10 timeframe, we're trying to finish up the 0.9 release. In the meantime you can build images and binaries for this platform without these changes. |
Hi @BenTheElder are there any updates for this topic? |
see #2024: a better plan for multi-arch is on the maintainers agenda for the next release (previous release just this past friday). this PR or a similar change should likely fall in v0.11 |
not sure why this never ran in CI, I think the label got lost |
this came up once before in kubernetes also with an s390x cross build I think, but I can't seem to recall what the issue is. sorry for the ridiculous delay here, I've set aside time tonight to burn through the PR backlog as opposed to incoming stuff and only just noticed this one was still lingering |
golang/go#40949 seems last time we decided it was qemu. will open another PR to upgrade qemu |
possibly #2324 |
/retest |
@guirish: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
@BenTheElder We are investigating on the build failure specific to s390x with respective QEMU versions. |
there is another popular image for binfmt_misc qemu now, but it also seems to lack a LICENSE tonistiigi/binfmt#46 we are on the latest version of the current image AFAICT, though perhaps an older version works better? |
tongstii/binfmt was updated, I think we should give it a shot here, the other image was last updated 6 months ago but qemu released as recently as april 29 for 6.0.0 |
Hi @BenTheElder , we were able to resolve the build failure for s390x using diff --git a/hack/build/init-buildx.sh b/hack/build/init-buildx.sh
index 6fd26e25..ee3b7f80 100755
--- a/hack/build/init-buildx.sh
+++ b/hack/build/init-buildx.sh
@@ -32,7 +32,9 @@ fi
# We only need to do this setup on linux hosts
if [ "$(uname)" == 'Linux' ]; then
# NOTE: this is pinned to a digest for a reason!
- docker run --rm --privileged multiarch/qemu-user-static:register@sha256:0434e870ebbe9d28d254c1e65b46969bef458490be5df04d3266ef87380518e2 --reset -p yes
+ docker run --rm --privileged tonistiigi/binfmt:qemu-v6.0.0 --install all
fi
diff --git a/images/kindnetd/Dockerfile b/images/kindnetd/Dockerfile
index 9d87b16e..040e8d31 100644
--- a/images/kindnetd/Dockerfile
+++ b/images/kindnetd/Dockerfile
@@ -14,14 +14,18 @@
# first stage build kindnetd binary
# NOTE: tentatively follow upstream kubernetes go version based on k8s in go.mod
-FROM golang:1.15
+FROM --platform=$TARGETPLATFORM golang:1.15
+ARG TARGETPLATFORM
+
WORKDIR /go/src
# make deps fetching cacheable
COPY go.mod go.sum ./
-RUN go mod download
+
+RUN if [ "$TARGETPLATFORM" != "linux/s390x" ] ; then go mod download ; else GODEBUG=asyncpreemptoff=1 go mod download ; fi
+
# build
COPY . .
-RUN CGO_ENABLED=0 go build -o ./kindnetd ./cmd/kindnetd
+RUN if [ "$TARGETPLATFORM" != "linux/s390x" ] ; then CGO_ENABLED=0 go build -o ./kindnetd ./cmd/kindnetd ; else CGO_ENABLED=0 GODEBUG=asyncpreemptoff=1 go build -o ./kindnetd ./cmd/kindnetd ; fi
# build real kindnetd image
FROM k8s.gcr.io/build-image/debian-iptables:buster-v1.6.3 |
@aojea WDYT about generally updating kindnetd deps to 1.16 instead? IIRC 1.15 had these async issues. I think we should also do a PR to update the qemu image, regardless 👍 |
👍 are you asking me to do it or is a general question? 😄 |
not asking to do it, just asking if you think this is a good plan, I haven't kept up closely enough with kindnetd dependencies recently, I think we should be fine to roll everything to the latest k8s etc.? |
|
@guirish: PR needs rebase. 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. |
We are keeping the task of Rebasing the PR changes on hold for now, due to below mentioned reason. We are awaiting for the new release of |
@guirish where are we standing here? |
@BenTheElder @aojea I am closing this PR, I have added changes in a new PR #2494 . |
|
Added support for cross building s390x kind binary and associated images namely base, kindnetd and haproxy.