From 0483eebc7b3535471c8a5665d5e63429579cfd48 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Wed, 9 Aug 2023 13:24:08 +0200 Subject: [PATCH] Set libnvidia-container version to toolkit version Signed-off-by: Evan Lezar --- scripts/build-all-components.sh | 9 ++++++--- scripts/build-packages.sh | 18 ------------------ scripts/get-component-versions.sh | 16 ---------------- 3 files changed, 6 insertions(+), 37 deletions(-) diff --git a/scripts/build-all-components.sh b/scripts/build-all-components.sh index a5a698be..0c34a627 100755 --- a/scripts/build-all-components.sh +++ b/scripts/build-all-components.sh @@ -57,14 +57,17 @@ fi # Build libnvidia-container if [[ -z ${SKIP_LIBNVIDIA_CONTAINER} ]]; then - make -C "${LIBNVIDIA_CONTAINER_ROOT}" -f mk/docker.mk "${TARGET}" + make -C "${LIBNVIDIA_CONTAINER_ROOT}" -f mk/docker.mk \ + LIB_VERSION=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \ + LIB_TAG=${NVIDIA_CONTAINER_TOOLKIT_TAG} \ + "${TARGET}" fi if [[ -z ${SKIP_NVIDIA_CONTAINER_TOOLKIT} ]]; then # Build nvidia-container-toolkit make -C "${NVIDIA_CONTAINER_TOOLKIT_ROOT}" \ - LIBNVIDIA_CONTAINER_VERSION="${LIBNVIDIA_CONTAINER_VERSION}" \ - LIBNVIDIA_CONTAINER_TAG="${LIBNVIDIA_CONTAINER_TAG}" \ + LIBNVIDIA_CONTAINER_VERSION="${NVIDIA_CONTAINER_TOOLKIT_VERSION}" \ + LIBNVIDIA_CONTAINER_TAG="${NVIDIA_CONTAINER_TOOLKIT_TAG}" \ "${TARGET}" fi diff --git a/scripts/build-packages.sh b/scripts/build-packages.sh index b938b1c9..2e91877b 100755 --- a/scripts/build-packages.sh +++ b/scripts/build-packages.sh @@ -45,26 +45,8 @@ fi eval $(${SCRIPTS_DIR}/get-component-versions.sh) - -if [[ -n ${NVIDIA_CONTAINER_TOOLKIT_TAG} ]]; then -echo "Allowing mismatched versions for release candidate " -: "${ALLOW_VERSION_MISMATCH:=true}" -fi - -if [[ "${NVIDIA_CONTAINER_TOOLKIT_PACKAGE_VERSION}" != "${LIBNVIDIA_CONTAINER_PACKAGE_VERSION}" ]]; then - set +x - echo "The libnvidia-container and nvidia-container-toolkit versions do not match." - echo "lib: '${LIBNVIDIA_CONTAINER_PACKAGE_VERSION}'" - echo "toolkit: '${NVIDIA_CONTAINER_TOOLKIT_PACKAGE_VERSION}'" - set -x - [[ ${ALLOW_VERSION_MISMATCH} == "true" ]] || exit 1 - echo "Continuing with mismatched version" -fi - export NVIDIA_CONTAINER_TOOLKIT_VERSION export NVIDIA_CONTAINER_TOOLKIT_TAG -export LIBNVIDIA_CONTAINER_VERSION -export LIBNVIDIA_CONTAINER_TAG export NVIDIA_CONTAINER_RUNTIME_VERSION export NVIDIA_DOCKER_VERSION diff --git a/scripts/get-component-versions.sh b/scripts/get-component-versions.sh index 01db3957..14f4ef66 100755 --- a/scripts/get-component-versions.sh +++ b/scripts/get-component-versions.sh @@ -28,18 +28,10 @@ set -e SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../scripts && pwd )" PROJECT_ROOT="$( cd ${SCRIPTS_DIR}/.. && pwd )" -LIBNVIDIA_CONTAINER_ROOT=${PROJECT_ROOT}/third_party/libnvidia-container NVIDIA_CONTAINER_TOOLKIT_ROOT=${PROJECT_ROOT} NVIDIA_CONTAINER_RUNTIME_ROOT=${PROJECT_ROOT}/third_party/nvidia-container-runtime NVIDIA_DOCKER_ROOT=${PROJECT_ROOT}/third_party/nvidia-docker -# Get version for libnvidia-container -libnvidia_container_version_tag=$(grep "#define NVC_VERSION" ${LIBNVIDIA_CONTAINER_ROOT}/src/nvc.h \ - | sed -e 's/#define NVC_VERSION[[:space:]]"\(.*\)"/\1/') -libnvidia_container_version=${libnvidia_container_version_tag%%-*} -libnvidia_container_tag=${libnvidia_container_version_tag##${libnvidia_container_version}} -libnvidia_container_tag=${libnvidia_container_tag##\-} - versions_makefile=${NVIDIA_CONTAINER_TOOLKIT_ROOT}/versions.mk # Get version for nvidia-container-toolit nvidia_container_toolkit_version=$(grep -m 1 "^LIB_VERSION := " ${versions_makefile} | sed -e 's/LIB_VERSION :=[[:space:]]\(.*\)[[:space:]]*/\1/') @@ -56,17 +48,9 @@ nvidia_docker_version=$(grep -m 1 "^NVIDIA_DOCKER_VERSION := " ${versions_makefi nvidia_docker_tag=${nvidia_container_toolkit_tag} nvidia_docker_version_tag="${nvidia_docker_version}${nvidia_docker_tag:+~${nvidia_docker_tag}}" -echo "LIBNVIDIA_CONTAINER_VERSION=${libnvidia_container_version}" -echo "LIBNVIDIA_CONTAINER_TAG=${libnvidia_container_tag}" -echo "LIBNVIDIA_CONTAINER_PACKAGE_VERSION=${libnvidia_container_version_tag//\~/-}" echo "NVIDIA_CONTAINER_TOOLKIT_VERSION=${nvidia_container_toolkit_version}" echo "NVIDIA_CONTAINER_TOOLKIT_TAG=${nvidia_container_toolkit_tag}" echo "NVIDIA_CONTAINER_TOOLKIT_PACKAGE_VERSION=${nvidia_container_toolkit_version_tag//\~/-}" -if [[ "${LIBNVIDIA_CONTAINER_PACKAGE_VERSION}" != "${NVIDIA_CONTAINER_TOOLKIT_PACKAGE_VERSION}" ]]; then - >&2 echo "WARNING: The libnvidia-container and nvidia-container-toolkit versions do not match" - >&2 echo "WARNING: lib: ${LIBNVIDIA_CONTAINER_PACKAGE_VERSION}" - >&2 echo "WARNING: toolkit: ${NVIDIA_CONTAINER_TOOLKIT_PACKAGE_VERSION}" -fi echo "NVIDIA_CONTAINER_RUNTIME_VERSION=${nvidia_container_runtime_version}" echo "NVIDIA_CONTAINER_RUNTIME_TAG=${nvidia_container_runtime_tag}" echo "NVIDIA_CONTAINER_RUNTIME_PACKAGE_VERSION=${nvidia_container_runtime_version_tag//\~/-}"