Skip components for patch releases

This change ensures that the nvidia-docker2 and nvidia-container-runtime
components are not build and distributed for patch releases.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar 2023-04-24 13:33:45 +02:00
parent 926ac77bc0
commit c0fe8f27eb
2 changed files with 16 additions and 7 deletions

View File

@ -62,7 +62,12 @@ make -C "${NVIDIA_CONTAINER_TOOLKIT_ROOT}" \
LIBNVIDIA_CONTAINER_TAG="${LIBNVIDIA_CONTAINER_TAG}" \ LIBNVIDIA_CONTAINER_TAG="${LIBNVIDIA_CONTAINER_TAG}" \
"${TARGET}" "${TARGET}"
if [[ -z ${NVIDIA_CONTAINER_TOOLKIT_TAG} ]]; then # If required we also build the nvidia-container-runtime and nvidia-docker packages.
# Since these are essentially meta packages intended to allow for users to
# transition from older installation workflows, we skip these for rc builds
# (NVIDIA_CONTAINER_TOOLKIT_TAG != "") and releases with a non-zero patch
# version of 0.
if [[ -z ${NVIDIA_CONTAINER_TOOLKIT_TAG} && "${NVIDIA_CONTAINER_TOOLKIT_VERSION%.0}" != "${NVIDIA_CONTAINER_TOOLKIT_VERSION}" ]]; then
# We set the TOOLKIT_VERSION, TOOLKIT_TAG for the nvidia-container-runtime and nvidia-docker targets # We set the TOOLKIT_VERSION, TOOLKIT_TAG for the nvidia-container-runtime and nvidia-docker targets
# The LIB_TAG is also overridden to match the TOOLKIT_TAG. # The LIB_TAG is also overridden to match the TOOLKIT_TAG.
# Build nvidia-container-runtime # Build nvidia-container-runtime
@ -82,5 +87,5 @@ if [[ -z ${NVIDIA_CONTAINER_TOOLKIT_TAG} ]]; then
${TARGET} ${TARGET}
else else
echo "Skipping nvidia-container-runtime and nvidia-docker builds for release candidate" echo "Skipping nvidia-container-runtime and nvidia-docker builds."
fi fi

View File

@ -45,17 +45,21 @@ function skip-for-release-candidate() {
return 0 return 0
fi fi
# We allow all other packages for non-rc versions. local is_non_patch_full_release=1
if [[ "${VERSION/rc./}" == "${VERSION}" ]]; then # We allow all other packages for non-rc and non-patch release versions.
return 1 if [[ "${VERSION/rc./}" != "${VERSION}" ]]; then
is_non_patch_full_release=0
fi
if [[ "${VERSION%.0}" == "${VERSION}" ]]; then
is_non_patch_full_release=0
fi fi
local package_name=$1 local package_name=$1
if [[ "${package_name/"nvidia-docker2"/}" != "${package_name}" ]]; then if [[ "${package_name/"nvidia-docker2"/}" != "${package_name}" ]]; then
return 0 return ${is_non_patch_full_release}
fi fi
if [[ "${package_name/"nvidia-container-runtime"/}" != "${package_name}" ]]; then if [[ "${package_name/"nvidia-container-runtime"/}" != "${package_name}" ]]; then
return 0 return ${is_non_patch_full_release}
fi fi
return 1 return 1
} }