mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 08:18:32 +00:00
Update build scripts to set libnvidia-container version
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
52d5021b76
commit
d75f364b27
@ -25,7 +25,7 @@ function assert_usage() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
set -e -x
|
set -e
|
||||||
|
|
||||||
SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../scripts && pwd )"
|
SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../scripts && pwd )"
|
||||||
PROJECT_ROOT="$( cd ${SCRIPTS_DIR}/.. && pwd )"
|
PROJECT_ROOT="$( cd ${SCRIPTS_DIR}/.. && pwd )"
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
# as well as the components included in the third_party folder.
|
# as well as the components included in the third_party folder.
|
||||||
# All required packages are generated in the specified dist folder.
|
# All required packages are generated in the specified dist folder.
|
||||||
|
|
||||||
set -e -x
|
set -e
|
||||||
|
|
||||||
SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../scripts && pwd )"
|
SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../scripts && pwd )"
|
||||||
PROJECT_ROOT="$( cd ${SCRIPTS_DIR}/.. && pwd )"
|
PROJECT_ROOT="$( cd ${SCRIPTS_DIR}/.. && pwd )"
|
||||||
@ -61,11 +61,11 @@ fi
|
|||||||
|
|
||||||
eval $(${SCRIPTS_DIR}/get-component-versions.sh)
|
eval $(${SCRIPTS_DIR}/get-component-versions.sh)
|
||||||
|
|
||||||
if [[ "${NVIDIA_CONTAINER_TOOLKIT_VERSION}${NVIDIA_CONTAINER_TOOLKIT_TAG:+~${NVIDIA_CONTAINER_TOOLKIT_TAG}}" != "${LIBNVIDIA_CONTAINER_VERSION}" ]]; then
|
if [[ "${NVIDIA_CONTAINER_TOOLKIT_PACKAGE_VERSION}" != "${LIBNVIDIA_CONTAINER_PACKAGE_VERSION}" ]]; then
|
||||||
set +x
|
set +x
|
||||||
echo "The libnvidia-container and nvidia-container-toolkit versions do not match."
|
echo "The libnvidia-container and nvidia-container-toolkit versions do not match."
|
||||||
echo "lib: '${LIBNVIDIA_CONTAINER_VERSION}'"
|
echo "lib: '${LIBNVIDIA_CONTAINER_PACKAGE_VERSION}'"
|
||||||
echo "toolkit: '${NVIDIA_CONTAINER_TOOLKIT_VERSION}${NVIDIA_CONTAINER_TOOLKIT_TAG:+~${NVIDIA_CONTAINER_TOOLKIT_TAG}}'"
|
echo "toolkit: '${NVIDIA_CONTAINER_TOOLKIT_PACKAGE_VERSION}'"
|
||||||
set -x
|
set -x
|
||||||
[[ ${ALLOW_VERSION_MISMATCH} == "true" ]] || exit 1
|
[[ ${ALLOW_VERSION_MISMATCH} == "true" ]] || exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -36,6 +36,9 @@ NVIDIA_DOCKER_ROOT=${PROJECT_ROOT}/third_party/nvidia-docker
|
|||||||
# Get version for libnvidia-container
|
# Get version for libnvidia-container
|
||||||
libnvidia_container_version_tag=$(grep "#define NVC_VERSION" ${LIBNVIDIA_CONTAINER_ROOT}/src/nvc.h \
|
libnvidia_container_version_tag=$(grep "#define NVC_VERSION" ${LIBNVIDIA_CONTAINER_ROOT}/src/nvc.h \
|
||||||
| sed -e 's/#define NVC_VERSION[[:space:]]"\(.*\)"/\1/')
|
| 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
|
versions_makefile=${NVIDIA_CONTAINER_TOOLKIT_ROOT}/versions.mk
|
||||||
# Get version for nvidia-container-toolit
|
# Get version for nvidia-container-toolit
|
||||||
@ -53,7 +56,8 @@ nvidia_docker_version=$(grep -m 1 "^NVIDIA_DOCKER_VERSION := " ${versions_makefi
|
|||||||
nvidia_docker_tag=${nvidia_container_toolkit_tag}
|
nvidia_docker_tag=${nvidia_container_toolkit_tag}
|
||||||
nvidia_docker_version_tag="${nvidia_docker_version}${nvidia_docker_tag:+~${nvidia_docker_tag}}"
|
nvidia_docker_version_tag="${nvidia_docker_version}${nvidia_docker_tag:+~${nvidia_docker_tag}}"
|
||||||
|
|
||||||
echo "LIBNVIDIA_CONTAINER_VERSION=${libnvidia_container_version_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 "LIBNVIDIA_CONTAINER_PACKAGE_VERSION=${libnvidia_container_version_tag//\~/-}"
|
||||||
echo "NVIDIA_CONTAINER_TOOLKIT_VERSION=${nvidia_container_toolkit_version}"
|
echo "NVIDIA_CONTAINER_TOOLKIT_VERSION=${nvidia_container_toolkit_version}"
|
||||||
echo "NVIDIA_CONTAINER_TOOLKIT_TAG=${nvidia_container_toolkit_tag}"
|
echo "NVIDIA_CONTAINER_TOOLKIT_TAG=${nvidia_container_toolkit_tag}"
|
||||||
|
Loading…
Reference in New Issue
Block a user