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 multi-arch support for nvidia-device-plugin #422

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ollyplance
Copy link

  • update Dockerfile to cross-build on arm
  • update Makefile to use buildx with --platforms arg

* update Dockerfile to cross-build on arm
* update Makefile to use buildx with `--platforms` arg
@Jiaqicao257 Jiaqicao257 requested a review from elfinhe December 16, 2024 19:10
Copy link
Contributor

@elfinhe elfinhe left a comment

Choose a reason for hiding this comment

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

LGTM in general.

WORKDIR /go/src/github.com/GoogleCloudPlatform/container-engine-accelerators
COPY . .
RUN go build cmd/nvidia_gpu/nvidia_gpu.go
RUN if [ "${TARGETARCH}" = "arm64" ] && [ "${BUILDARCH}" != "arm64" ]; then \
Copy link
Contributor

@elfinhe elfinhe Dec 19, 2024

Choose a reason for hiding this comment

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

can we double check the conditions here? Is it assuming the build machine is on X86?

Copy link
Author

@ollyplance ollyplance Dec 19, 2024

Choose a reason for hiding this comment

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

Yes the current build machine is x86. These conditions are ensuring that we only install the cross-compiler if the host machine is x86 AND we are building for arm. It may be a good point to ensure that the host machine is nothing other than x86 or arm though, if that is what you were getting at?

@grac3gao grac3gao self-requested a review December 19, 2024 21:47
apt install -yq --no-install-recommends \
gcc-aarch64-linux-gnu libc6-dev-arm64-cross; \
CC=aarch64-linux-gnu-gcc; \
fi && \
Copy link
Member

Choose a reason for hiding this comment

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

This dockerfile is used to internally build image for release, also need to double check if the currently louhi pipeline can work successfully after this update.

Copy link
Author

@ollyplance ollyplance Dec 19, 2024

Choose a reason for hiding this comment

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

Yes, currently the Louhi pipeline runs make container. Locally make container performs the exact same as before, only using the dockerx wrapper around docker -- as we are using an amd64 machine to build an amd64 image (thus will not activate this cross-complier install). For actually building the multi-arch build in louhi, I separated out that build into a different make command. I will create a seperate louhi flow to verify that works before proceeding with changing the pipeline.

@grac3gao
Copy link
Member

LGTMed. Please ensure existing path will not be broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants