-
Notifications
You must be signed in to change notification settings - Fork 164
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
Makefile: Export PLATFORM as docker build argument #4489
Conversation
This commit introduces a new build configuration file (autogenerated) that allows to export build parameters to docker files of packages under pkg/. So far only the PLATFORM is exported as a build argument, which will allow packages to take different actions according to the PLATFORM provided during the build. Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br>
Other than more complexity (and it isn't bad), I see no issues with it. What are you planning on doing with it down the line? Obviously something for the builds, but how will |
@deitch , the nvidia platform will need to be split into two variants: nvidia-jp5 and nvidia-jp6 to support both Jetpack 5 and 6, respectively. Unfortunately this is necessary because of the lack of support for Xavier devices on Jetpack 6. With the changes of this PR, the plan is to use something like the following when processing different files for JP5 and JP6, for instance: ARG PLATFORM=generic
...
# Nvidia Firmwares for Jetpack 5.1.3 and Jetpack 6.0
ENV JETPACK5_DEB=nvidia-l4t-firmware_35.5.0-20240219203809_arm64.deb
ENV JETPACK5_URL=https://repo.download.nvidia.com/jetson/t194/pool/main/n/nvidia-l4t-firmware/${JETPACK5_DEB}
ENV JETPACK6_DEB=nvidia-l4t-firmware_36.3.0-20240506102626_arm64.deb
ENV JETPACK6_URL=https://repo.download.nvidia.com/jetson/t234/pool/main/n/nvidia-l4t-firmware/${JETPACK6_DEB}
FROM build-base AS generic
ENV NVIDIA_FW_TEGRA=${JETPACK5_DEB}
ENV NVIDIA_FW_URL=${JETPACK5_URL}
FROM build-base AS nvidia-jp5
ENV NVIDIA_FW_TEGRA=${JETPACK5_DEB}
ENV NVIDIA_FW_URL=${JETPACK5_URL}
FROM build-base AS nvidia-jp6
ENV NVIDIA_FW_TEGRA=${JETPACK6_DEB}
ENV NVIDIA_FW_URL=${JETPACK6_URL}
FROM ${PLATFORM} AS build
ADD ${NVIDIA_FW_URL} /${NVIDIA_FW_TEGRA} So in a nutshell, |
Got it. Thanks for explaining. |
Are build args meant to be universal, or per |
The idea is to export only those variables that are meant to be global across packages, so no custom variables per package at the moment. |
Makes sense. |
This commit introduces a new build configuration file (autogenerated) that allows to export build parameters to docker files of packages under pkg/. So far only the PLATFORM is exported as a build argument, which will allow packages to take different actions according to the PLATFORM provided during the build.
Note: This PR is needed for upcoming changes for NVIDIA Platform.