From c0fe8f27eb60471ffe062e05e6f5fef2d9552eca Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Mon, 24 Apr 2023 13:33:45 +0200 Subject: [PATCH] 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 --- scripts/build-all-components.sh | 9 +++++++-- scripts/extract-packages.sh | 14 +++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/scripts/build-all-components.sh b/scripts/build-all-components.sh index 79922c59..db874ab3 100755 --- a/scripts/build-all-components.sh +++ b/scripts/build-all-components.sh @@ -62,7 +62,12 @@ make -C "${NVIDIA_CONTAINER_TOOLKIT_ROOT}" \ LIBNVIDIA_CONTAINER_TAG="${LIBNVIDIA_CONTAINER_TAG}" \ "${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 # The LIB_TAG is also overridden to match the TOOLKIT_TAG. # Build nvidia-container-runtime @@ -82,5 +87,5 @@ if [[ -z ${NVIDIA_CONTAINER_TOOLKIT_TAG} ]]; then ${TARGET} else - echo "Skipping nvidia-container-runtime and nvidia-docker builds for release candidate" + echo "Skipping nvidia-container-runtime and nvidia-docker builds." fi diff --git a/scripts/extract-packages.sh b/scripts/extract-packages.sh index 068d79eb..a98d9bd3 100755 --- a/scripts/extract-packages.sh +++ b/scripts/extract-packages.sh @@ -45,17 +45,21 @@ function skip-for-release-candidate() { return 0 fi - # We allow all other packages for non-rc versions. - if [[ "${VERSION/rc./}" == "${VERSION}" ]]; then - return 1 + local is_non_patch_full_release=1 + # We allow all other packages for non-rc and non-patch release versions. + if [[ "${VERSION/rc./}" != "${VERSION}" ]]; then + is_non_patch_full_release=0 + fi + if [[ "${VERSION%.0}" == "${VERSION}" ]]; then + is_non_patch_full_release=0 fi local package_name=$1 if [[ "${package_name/"nvidia-docker2"/}" != "${package_name}" ]]; then - return 0 + return ${is_non_patch_full_release} fi if [[ "${package_name/"nvidia-container-runtime"/}" != "${package_name}" ]]; then - return 0 + return ${is_non_patch_full_release} fi return 1 }