-
Notifications
You must be signed in to change notification settings - Fork 138
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
feat: add arm64 support #140
Conversation
Hi @mayankshah1607. Thanks for your PR. I'm waiting for a kubernetes-csi 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: mayankshah1607 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 |
.github/workflows/image-push.yaml
Outdated
docker buildx build \ | ||
docker push $REPO:$TAG -t $REPO:$TAG \ | ||
--platform=linux/arm64,linux/amd64 \ | ||
--output="type=image" . |
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.
@andyzhangx We need to set the registry details here. Could you share information regarding the registry / credentials? Thanks
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.
make smb-container
is here:
Lines 112 to 121 in e9c2dd3
.PHONY: smb-container | |
smb-container: | |
docker buildx rm container-builder || true | |
docker buildx create --use --name=container-builder | |
ifdef CI | |
make smb smb-windows | |
docker buildx build --no-cache --build-arg LDFLAGS=${LDFLAGS} -t $(IMAGE_TAG)-linux-amd64 -f ./pkg/smbplugin/Dockerfile --platform="linux/amd64" --push . | |
docker buildx build --no-cache --build-arg LDFLAGS=${LDFLAGS} -t $(IMAGE_TAG)-windows-1809-amd64 -f ./pkg/smbplugin/Windows.Dockerfile --platform="windows/amd64" --push . | |
docker manifest create $(IMAGE_TAG) $(IMAGE_TAG)-linux-amd64 $(IMAGE_TAG)-windows-1809-amd64 | |
docker manifest inspect $(IMAGE_TAG) |
I think you need to add one more command to build ARM64 container?
Pull Request Test Coverage Report for Build 354236700
💛 - Coveralls |
/ok-to-test |
1f71ed0
to
52c2182
Compare
@@ -117,6 +117,7 @@ ifdef CI | |||
make smb smb-windows | |||
docker buildx build --no-cache --build-arg LDFLAGS=${LDFLAGS} -t $(IMAGE_TAG)-linux-amd64 -f ./pkg/smbplugin/Dockerfile --platform="linux/amd64" --push . | |||
docker buildx build --no-cache --build-arg LDFLAGS=${LDFLAGS} -t $(IMAGE_TAG)-windows-1809-amd64 -f ./pkg/smbplugin/Windows.Dockerfile --platform="windows/amd64" --push . | |||
docker buildx build --no-cache --build-arg LDFLAGS=${LDFLAGS} -t $(IMAGE_TAG)-linux-arm64 -f ./pkg/smbplugin/Dockerfile --platform="linux/arm64" --push . |
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.
@andyzhangx I think this would do. But is make smb-container
being called in the CI? I.e, the post image job?
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.
let's wait for the test result, I have credentials to push image to Azure Container Registry.
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.
I think it's better move L120 to L119
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.
Our Kubernetes release pipeline supprts multiarch now including arm. But you need to setup the cloudbuild.yaml files like in the other csi repos
Signed-off-by: Mayank Shah <[email protected]>
52c2182
to
231473a
Compare
there is error:
not sure whether it's container image build error or Azure Container Registry not supported issue, need to find out later. |
Related - docker/buildx#138 |
Any luck? I've been following along |
It looks like the base image being used for the failing jobs does not have qemu installed, which is a requirement for building arm64 images (as per this comment) . /Cc @andyzhangx @msau42 |
since it's just a testing image, I think it's ok, could you work on a PR to install qemu? thanks. |
@kferrone I have already built the master branch image with ARM64 support with this PR, you could try now: {
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
"manifests": [
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1163,
"digest": "sha256:2d6616d944e5382175c824c3ff288723e91e736b6318dbd33f2a96cd6082371a",
"platform": {
"architecture": "amd64",
"os": "linux"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1163,
"digest": "sha256:6580abb9e16b557a10dd05a5ecc40f2b40c8d2874a50f6d0878dff118308a10c",
"platform": {
"architecture": "arm",
"os": "linux",
"variant": "v7"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 950,
"digest": "sha256:8f2bad9a5772a4f77774a707804a0f85f60b728723d8e56c770d01d5b500038e",
"platform": {
"architecture": "amd64",
"os": "windows"
}
}
]
} In the meantime, we will figure out how to make CI workflow work for ARM image |
@mayankshah1607 I have pushed some changes in Makefile, it could build binary and docker image with ARM64 support now, following guide: https://www.docker.com/blog/multi-platform-docker-builds/
export DOCKER_CLI_EXPERIMENTAL=enabled
docker run --privileged --rm docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64 |
d27c493
to
bb8ea8d
Compare
@andyzhangx Tried adding the following to the Makefile -
The error still remains. It doesn't look like the handlers are getting registered. Could it be because this is not meant to be run as DinD? In that case we could try to run ARM64 build and push separately on Github Actions |
it could be, I think we can add a build flag in Makefile and then only run arm64 binary build and docker build image verification in GH action. And also we really need a GH action for arm64 test. |
bb8ea8d
to
11e5dd8
Compare
11e5dd8
to
5d75575
Compare
@andyzhangx It works now. I added the following line instead:
|
could you rebase this PR @mayankshah1607 thanks. |
@mayankshah1607: 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. |
Following up with the discussion on Slack regarding multi arch builds, we should move this to build in GCB, and not Prow directly.
Should we add the relevant build commands in a |
@mayankshah1607 since it already works, let's merge this PR first. I believe it would also benefit other CSI drivers too. |
and then continue with #28 |
re: dind ... Prow is dind, but see: https://kubernetes.slack.com/archives/C09QZ4DQB/p1604941946039700?thread_ts=1604921217.035400&cid=C09QZ4DQB |
…-libs go-get-kubernetes.sh: remove unused k8s libs
Signed-off-by: Mayank Shah [email protected]
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #138
Requirements:
Special notes for your reviewer:
Release note: