From 50fbcebe31314a566b4bd3468b602cb893280cc0 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 20 Jan 2022 15:07:32 +0100 Subject: [PATCH 1/8] Update CUDA image version to 11.6.0 Signed-off-by: Evan Lezar --- versions.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions.mk b/versions.mk index ff75c4d7..90e862d0 100644 --- a/versions.mk +++ b/versions.mk @@ -20,5 +20,5 @@ LIB_TAG := rc.1 NVIDIA_DOCKER_VERSION := 2.9.0 NVIDIA_CONTAINER_RUNTIME_VERSION := 3.8.0 -CUDA_VERSION := 11.4.2 +CUDA_VERSION := 11.6.0 GOLANG_VERSION := 1.16.4 From b1c9b8bb490eb14f4aee8e35de50879717e4fdf0 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 20 Jan 2022 13:40:17 +0100 Subject: [PATCH 2/8] Bump version to 1.8.0-rc.2 Signed-off-by: Evan Lezar --- packaging/debian/changelog | 8 ++++++-- packaging/rpm/SPECS/nvidia-container-toolkit.spec | 2 ++ versions.mk | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packaging/debian/changelog b/packaging/debian/changelog index 54c8899c..c488f612 100644 --- a/packaging/debian/changelog +++ b/packaging/debian/changelog @@ -1,9 +1,13 @@ -nvidia-container-toolkit (1.8.0~rc.1-1) experimental; urgency=medium +nvidia-container-toolkit (1.8.0~rc.2-1) UNRELEASED; urgency=medium + + -- NVIDIA CORPORATION Thu, 20 Jan 2022 13:38:48 +0100 + +nvidia-container-toolkit (1.8.0~rc.1-1) UNRELEASED; urgency=medium * [libnvidia-container] Add support for cgroupv2 * Release toolkit-container images from nvidia-container-toolkit repository - -- NVIDIA CORPORATION Wed, 08 Dec 2021 12:56:49 +010 + -- NVIDIA CORPORATION Wed, 08 Dec 2021 12:56:49 +0100 nvidia-container-toolkit (1.7.0-1) UNRELEASED; urgency=medium diff --git a/packaging/rpm/SPECS/nvidia-container-toolkit.spec b/packaging/rpm/SPECS/nvidia-container-toolkit.spec index 4f5ad861..04c48731 100644 --- a/packaging/rpm/SPECS/nvidia-container-toolkit.spec +++ b/packaging/rpm/SPECS/nvidia-container-toolkit.spec @@ -64,6 +64,8 @@ rm -f %{_bindir}/nvidia-container-runtime-hook /usr/share/containers/oci/hooks.d/oci-nvidia-hook.json %changelog +* Thu Jan 20 2022 NVIDIA CORPORATION 1.8.0-0.1.rc.2 + * Wed Dec 08 2021 NVIDIA CORPORATION 1.8.0-0.1.rc.1 - [libnvidia-container] Add support for cgroupv2 - Release toolkit-container images from nvidia-container-toolkit repository diff --git a/versions.mk b/versions.mk index ff75c4d7..36c7fe5e 100644 --- a/versions.mk +++ b/versions.mk @@ -14,7 +14,7 @@ LIB_NAME := nvidia-container-toolkit LIB_VERSION := 1.8.0 -LIB_TAG := rc.1 +LIB_TAG := rc.2 # Specify the nvidia-docker2 and nvidia-container-runtime package versions NVIDIA_DOCKER_VERSION := 2.9.0 From 9d34134b3fc931740d4dc57172a2fea8e51082ab Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 20 Jan 2022 13:41:32 +0100 Subject: [PATCH 3/8] Update git submodules Signed-off-by: Evan Lezar --- third_party/libnvidia-container | 2 +- third_party/nvidia-container-runtime | 2 +- third_party/nvidia-docker | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/third_party/libnvidia-container b/third_party/libnvidia-container index 0b7fa90c..b6f85bb4 160000 --- a/third_party/libnvidia-container +++ b/third_party/libnvidia-container @@ -1 +1 @@ -Subproject commit 0b7fa90ce0721b010a5e80ecf53ceb43280a33b4 +Subproject commit b6f85bb45e23eae0447999501fe37c07877e9058 diff --git a/third_party/nvidia-container-runtime b/third_party/nvidia-container-runtime index e54e25d6..3588013b 160000 --- a/third_party/nvidia-container-runtime +++ b/third_party/nvidia-container-runtime @@ -1 +1 @@ -Subproject commit e54e25d6402da53cbb1c073d7a5d7f1e07d252a2 +Subproject commit 3588013b7d2a15783b3ca417b6f992197313ad5b diff --git a/third_party/nvidia-docker b/third_party/nvidia-docker index 9d1e4134..51d3c9e2 160000 --- a/third_party/nvidia-docker +++ b/third_party/nvidia-docker @@ -1 +1 @@ -Subproject commit 9d1e41341776ffb58728adbe0f265d68f497e07d +Subproject commit 51d3c9e22b2b891773ab9525eaf7b3ce1c014ab1 From 41c1c2312a672894a4079a64f1d516ad86abc330 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 20 Jan 2022 14:42:37 +0100 Subject: [PATCH 4/8] Add check for matching toolkit and lib versions to release script Signed-off-by: Evan Lezar --- scripts/release.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/release.sh b/scripts/release.sh index 5b0e74ee..34ae8570 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -53,6 +53,16 @@ else fi eval $(${SCRIPTS_DIR}/get-component-versions.sh) + +if [[ "${NVIDIA_CONTAINER_TOOLKIT_VERSION}${NVIDIA_CONTAINER_TOOLKIT_TAG:+~${NVIDIA_CONTAINER_TOOLKIT_TAG}}" != "${LIBNVIDIA_CONTAINER_VERSION}" ]]; then + set +x + echo "The libnvidia-container and nvidia-container-toolkit versions do not match." + echo "lib: '${LIBNVIDIA_CONTAINER_VERSION}'" + echo "toolkit: '${NVIDIA_CONTAINER_TOOLKIT_VERSION}${NVIDIA_CONTAINER_TOOLKIT_TAG:+~${NVIDIA_CONTAINER_TOOLKIT_TAG}}'" + set -x + [[ ${ALLOW_VERSION_MISMATCH} == "true" ]] || exit 1 +fi + export NVIDIA_CONTAINER_TOOLKIT_VERSION export NVIDIA_CONTAINER_TOOLKIT_TAG export NVIDIA_CONTAINER_RUNTIME_VERSION From 47bc4f90badb29fa152097aca76e1f4bb7e142b1 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Fri, 14 Jan 2022 14:06:46 +0100 Subject: [PATCH 5/8] Remove support for amazonlinux1 This commit removes support for building amazonlinux1 packages. Signed-off-by: Evan Lezar --- .common-ci.yml | 4 ---- .gitlab-ci.yml | 7 ------- build/container/Makefile | 1 - docker/docker.mk | 2 +- packaging/debian/changelog | 2 ++ packaging/rpm/SPECS/nvidia-container-toolkit.spec | 1 + scripts/release.sh | 1 - 7 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.common-ci.yml b/.common-ci.yml index dcb90282..33e61894 100644 --- a/.common-ci.yml +++ b/.common-ci.yml @@ -35,10 +35,6 @@ stages: - build-all # Define the distribution targets -.dist-amazonlinux1: - variables: - DIST: amazonlinux1 - .dist-amazonlinux2: variables: DIST: amazonlinux2 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f716cae0..da446359 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -103,12 +103,6 @@ unit-tests: - ${ARTIFACTS_ROOT} # Define the package build targets -package-amazonlinux1-x86_64: - extends: - - .package-build - - .dist-amazonlinux1 - - .arch-x86_64 - package-amazonlinux2-aarch64: extends: - .package-build @@ -259,7 +253,6 @@ image-packaging: - .package-artifacts - .dist-packaging needs: - - package-amazonlinux1-x86_64 - package-amazonlinux2-aarch64 - package-amazonlinux2-x86_64 - package-centos7-ppc64le diff --git a/build/container/Makefile b/build/container/Makefile index 100c22c1..3bda4970 100644 --- a/build/container/Makefile +++ b/build/container/Makefile @@ -119,7 +119,6 @@ $(TEST_TARGETS): test-%: test-packaging: DIST = packaging test-packaging: @echo "Testing package image contents" - @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/amazonlinux1/x86_64" || echo "Missing amazonlinux1/x86_64" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/amazonlinux2/aarch64" || echo "Missing amazonlinux2/aarch64" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/amazonlinux2/x86_64" || echo "Missing amazonlinux2/x86_64" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/centos7/ppc64le" || echo "Missing centos7/ppc64le" diff --git a/docker/docker.mk b/docker/docker.mk index 085e36da..3a33034c 100644 --- a/docker/docker.mk +++ b/docker/docker.mk @@ -14,7 +14,7 @@ # Supported OSs by architecture AMD64_TARGETS := ubuntu20.04 ubuntu18.04 ubuntu16.04 debian10 debian9 -X86_64_TARGETS := centos7 centos8 rhel7 rhel8 amazonlinux1 amazonlinux2 opensuse-leap15.1 +X86_64_TARGETS := centos7 centos8 rhel7 rhel8 amazonlinux2 opensuse-leap15.1 PPC64LE_TARGETS := ubuntu18.04 ubuntu16.04 centos7 centos8 rhel7 rhel8 ARM64_TARGETS := ubuntu20.04 ubuntu18.04 AARCH64_TARGETS := centos8 rhel8 amazonlinux2 diff --git a/packaging/debian/changelog b/packaging/debian/changelog index c488f612..eb0699f3 100644 --- a/packaging/debian/changelog +++ b/packaging/debian/changelog @@ -1,5 +1,7 @@ nvidia-container-toolkit (1.8.0~rc.2-1) UNRELEASED; urgency=medium + * Remove support for building amazonlinux1 packages + -- NVIDIA CORPORATION Thu, 20 Jan 2022 13:38:48 +0100 nvidia-container-toolkit (1.8.0~rc.1-1) UNRELEASED; urgency=medium diff --git a/packaging/rpm/SPECS/nvidia-container-toolkit.spec b/packaging/rpm/SPECS/nvidia-container-toolkit.spec index 04c48731..27b00c52 100644 --- a/packaging/rpm/SPECS/nvidia-container-toolkit.spec +++ b/packaging/rpm/SPECS/nvidia-container-toolkit.spec @@ -65,6 +65,7 @@ rm -f %{_bindir}/nvidia-container-runtime-hook %changelog * Thu Jan 20 2022 NVIDIA CORPORATION 1.8.0-0.1.rc.2 +- Remove support for building amazonlinux1 packages * Wed Dec 08 2021 NVIDIA CORPORATION 1.8.0-0.1.rc.1 - [libnvidia-container] Add support for cgroupv2 diff --git a/scripts/release.sh b/scripts/release.sh index 34ae8570..a7c9f131 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -28,7 +28,6 @@ PROJECT_ROOT="$( cd ${SCRIPTS_DIR}/.. && pwd )" # to the relevant repositories. This targets forwarded to the build-all-components script # can be overridden by specifying command line arguments. all=( - amazonlinux1-x86_64 amazonlinux2-aarch64 amazonlinux2-x86_64 centos7-ppc64le From 58042d78dfd27005a27ca357c0638d052ccb0d82 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Fri, 21 Jan 2022 14:23:23 +0100 Subject: [PATCH 6/8] Copy libnivida-container-go.so to toolkit directory As of the NVIDIA Container Toolkit 1.8.0-rc.1 the libnvida-container* packages also provide a libnvidia-container-go library. This must also be installed in the toolkit container. Signed-off-by: Evan Lezar --- test/container/toolkit_test.sh | 2 ++ tools/container/toolkit/toolkit.go | 25 +++++++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/test/container/toolkit_test.sh b/test/container/toolkit_test.sh index 5fcc4a08..7a21169c 100644 --- a/test/container/toolkit_test.sh +++ b/test/container/toolkit_test.sh @@ -31,6 +31,8 @@ testing::toolkit::install() { test -L "${shared_dir}/usr/local/nvidia/toolkit/libnvidia-container.so.1" test -e "$(${READLINK} -f "${shared_dir}/usr/local/nvidia/toolkit/libnvidia-container.so.1")" + test -L "${shared_dir}/usr/local/nvidia/toolkit/libnvidia-container-go.so.1" + test -e "$(${READLINK} -f "${shared_dir}/usr/local/nvidia/toolkit/libnvidia-container-go.so.1")" test -e "${shared_dir}/usr/local/nvidia/toolkit/nvidia-container-cli" test -e "${shared_dir}/usr/local/nvidia/toolkit/nvidia-container-toolkit" diff --git a/tools/container/toolkit/toolkit.go b/tools/container/toolkit/toolkit.go index 6aa3fc3b..bcc8f805 100644 --- a/tools/container/toolkit/toolkit.go +++ b/tools/container/toolkit/toolkit.go @@ -152,7 +152,7 @@ func Install(cli *cli.Context) error { return fmt.Errorf("could not create required directories: %v", err) } - err = installContainerLibrary(toolkitDirArg) + err = installContainerLibraries(toolkitDirArg) if err != nil { return fmt.Errorf("error installing NVIDIA container library: %v", err) } @@ -180,14 +180,31 @@ func Install(cli *cli.Context) error { return nil } -// installContainerLibrary locates and installs the libnvidia-container.so.1 library. +// installContainerLibraries locates and installs the libraries that are part of +// the nvidia-container-toolkit. // A predefined set of library candidates are considered, with the first one // resulting in success being installed to the toolkit folder. The install process // resolves the symlink for the library and copies the versioned library itself. -func installContainerLibrary(toolkitDir string) error { +func installContainerLibraries(toolkitDir string) error { log.Infof("Installing NVIDIA container library to '%v'", toolkitDir) - const libName = "libnvidia-container.so.1" + libs := []string{ + "libnvidia-container.so.1", + "libnvidia-container-go.so.1", + } + + for _, l := range libs { + err := installLibrary(l, toolkitDir) + if err != nil { + return fmt.Errorf("failed to install %s: %v", l, err) + } + } + + return nil +} + +// installLibrary installs the specified library to the toolkit directory. +func installLibrary(libName string, toolkitDir string) error { libraryPath, err := findLibrary("", libName) if err != nil { return fmt.Errorf("error locating NVIDIA container library: %v", err) From 6898917f41ccb8c265a917fd90b086f879fbf16f Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 20 Jan 2022 13:51:44 +0100 Subject: [PATCH 7/8] Update components before building release Signed-off-by: Evan Lezar --- scripts/release.sh | 8 ++++++++ scripts/update-components.sh | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100755 scripts/update-components.sh diff --git a/scripts/release.sh b/scripts/release.sh index a7c9f131..355d635a 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -51,6 +51,14 @@ else targets=${all[@]} fi +echo "Updating components" +${SCRIPTS_DIR}/update-components.sh +if [[ -n $(git status -s third_party) && ${ALLOW_LOCAL_COMPONENT_CHANGES} != "true" ]]; then + echo "ERROR: Building with local component changes." + echo "Commit pending changes or rerun with ALLOW_LOCAL_COMPONENT_CHANGES='true'" + exit 1 +fi + eval $(${SCRIPTS_DIR}/get-component-versions.sh) if [[ "${NVIDIA_CONTAINER_TOOLKIT_VERSION}${NVIDIA_CONTAINER_TOOLKIT_TAG:+~${NVIDIA_CONTAINER_TOOLKIT_TAG}}" != "${LIBNVIDIA_CONTAINER_VERSION}" ]]; then diff --git a/scripts/update-components.sh b/scripts/update-components.sh new file mode 100755 index 00000000..f8825313 --- /dev/null +++ b/scripts/update-components.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e -x + +SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../scripts && pwd )" +PROJECT_ROOT="$( cd ${SCRIPTS_DIR}/.. && pwd )" + +git submodule update --init + +echo "Component status before update" +git submodule status + +# We update all submodules from their respective remotes +# NOTE: Appending `-- [PATH]` will limit the update to a specific component +git submodule update --remote + +if [[ -z $(git status -s third_party) ]]; then + echo "Components already up to date" +else + echo "Components updated" + git submodule status +fi From 72e17e86324c0db6f6744b2f80d30b75fb0ba198 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 27 Jan 2022 18:59:08 +0100 Subject: [PATCH 8/8] Update libnvidia-container submodule Signed-off-by: Evan Lezar --- third_party/libnvidia-container | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/libnvidia-container b/third_party/libnvidia-container index b6f85bb4..d48f9b0d 160000 --- a/third_party/libnvidia-container +++ b/third_party/libnvidia-container @@ -1 +1 @@ -Subproject commit b6f85bb45e23eae0447999501fe37c07877e9058 +Subproject commit d48f9b0d505fca0aff7c88cee790f9c56aa1b851