diff --git a/.common-ci.yml b/.common-ci.yml index c28bf25e..fb2ff90d 100644 --- a/.common-ci.yml +++ b/.common-ci.yml @@ -70,20 +70,6 @@ stages: DIST: debian10 PACKAGE_REPO_TYPE: debian -.dist-debian9: - rules: - - !reference [.main-or-manual, rules] - variables: - DIST: debian9 - PACKAGE_REPO_TYPE: debian - -.dist-fedora35: - rules: - - !reference [.main-or-manual, rules] - variables: - DIST: fedora35 - PACKAGE_REPO_TYPE: rpm - .dist-opensuse-leap15.1: rules: - !reference [.main-or-manual, rules] @@ -99,13 +85,6 @@ stages: CVE_UPDATES: "cyrus-sasl-lib" PACKAGE_REPO_TYPE: rpm -.dist-ubuntu16.04: - rules: - - !reference [.main-or-manual, rules] - variables: - DIST: ubuntu16.04 - PACKAGE_REPO_TYPE: debian - .dist-ubuntu18.04: variables: DIST: ubuntu18.04 @@ -113,8 +92,6 @@ stages: PACKAGE_REPO_TYPE: debian .dist-ubuntu20.04: - rules: - - !reference [.main-or-manual, rules] variables: DIST: ubuntu20.04 CVE_UPDATES: "libsasl2-2 libsasl2-modules-db" @@ -259,22 +236,15 @@ release:staging-ubi8: needs: - image-ubi8 -release:staging-ubuntu18.04: - extends: - - .release:staging - - .dist-ubuntu18.04 - needs: - - test-toolkit-ubuntu18.04 - - test-containerd-ubuntu18.04 - - test-crio-ubuntu18.04 - - test-docker-ubuntu18.04 - release:staging-ubuntu20.04: extends: - .release:staging - .dist-ubuntu20.04 needs: - - image-ubuntu20.04 + - test-toolkit-ubuntu20.04 + - test-containerd-ubuntu20.04 + - test-crio-ubuntu20.04 + - test-docker-ubuntu20.04 release:staging-packaging: extends: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5693a885..7a338002 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -116,12 +116,6 @@ package-amazonlinux2-x86_64: - .dist-amazonlinux2 - .arch-x86_64 -package-centos7-ppc64le: - extends: - - .package-build - - .dist-centos7 - - .arch-ppc64le - package-centos7-x86_64: extends: - .package-build @@ -152,42 +146,12 @@ package-debian10-amd64: - .dist-debian10 - .arch-amd64 -package-debian9-amd64: - extends: - - .package-build - - .dist-debian9 - - .arch-amd64 - -package-fedora35-aarch64: - extends: - - .package-build - - .dist-fedora35 - - .arch-aarch64 - -package-fedora35-x86_64: - extends: - - .package-build - - .dist-fedora35 - - .arch-x86_64 - package-opensuse-leap15.1-x86_64: extends: - .package-build - .dist-opensuse-leap15.1 - .arch-x86_64 -package-ubuntu16.04-amd64: - extends: - - .package-build - - .dist-ubuntu16.04 - - .arch-amd64 - -package-ubuntu16.04-ppc64le: - extends: - - .package-build - - .dist-ubuntu16.04 - - .arch-ppc64le - package-ubuntu18.04-amd64: extends: - .package-build @@ -240,7 +204,6 @@ image-centos7: - .package-artifacts - .dist-centos7 needs: - - package-centos7-ppc64le - package-centos7-x86_64 image-ubi8: @@ -254,17 +217,6 @@ image-ubi8: - package-centos8-x86_64 - package-centos8-ppc64le -image-ubuntu18.04: - extends: - - .image-build - - .package-artifacts - - .dist-ubuntu18.04 - needs: - - package-ubuntu18.04-amd64 - - package-ubuntu18.04-arm64 - - job: package-ubuntu18.04-ppc64le - optional: true - image-ubuntu20.04: extends: - .image-build @@ -273,7 +225,8 @@ image-ubuntu20.04: needs: - package-ubuntu18.04-amd64 - package-ubuntu18.04-arm64 - - package-ubuntu18.04-ppc64le + - job: package-ubuntu18.04-ppc64le + optional: true # The DIST=packaging target creates an image containing all built packages image-packaging: @@ -290,26 +243,14 @@ image-packaging: optional: true - job: package-amazonlinux2-x86_64 optional: true - - job: package-centos7-ppc64le - optional: true - job: package-centos7-x86_64 optional: true - job: package-centos8-ppc64le optional: true - job: package-debian10-amd64 optional: true - - job: package-debian9-amd64 - optional: true - - job: package-fedora35-aarch64 - optional: true - - job: package-fedora35-x86_64 - optional: true - job: package-opensuse-leap15.1-x86_64 optional: true - - job: package-ubuntu16.04-amd64 - optional: true - - job: package-ubuntu16.04-ppc64le - optional: true - job: package-ubuntu18.04-ppc64le optional: true @@ -343,31 +284,31 @@ image-packaging: TEST_CASES: "crio" # Define the test targets -test-toolkit-ubuntu18.04: +test-toolkit-ubuntu20.04: extends: - .test:toolkit - - .dist-ubuntu18.04 + - .dist-ubuntu20.04 needs: - - image-ubuntu18.04 + - image-ubuntu20.04 -test-containerd-ubuntu18.04: +test-containerd-ubuntu20.04: extends: - .test:containerd - - .dist-ubuntu18.04 + - .dist-ubuntu20.04 needs: - - image-ubuntu18.04 + - image-ubuntu20.04 -test-crio-ubuntu18.04: +test-crio-ubuntu20.04: extends: - .test:crio - - .dist-ubuntu18.04 + - .dist-ubuntu20.04 needs: - - image-ubuntu18.04 + - image-ubuntu20.04 -test-docker-ubuntu18.04: +test-docker-ubuntu20.04: extends: - .test:docker - - .dist-ubuntu18.04 + - .dist-ubuntu20.04 needs: - - image-ubuntu18.04 + - image-ubuntu20.04 diff --git a/.nvidia-ci.yml b/.nvidia-ci.yml index 1a82598a..51b3a58a 100644 --- a/.nvidia-ci.yml +++ b/.nvidia-ci.yml @@ -79,11 +79,6 @@ image-ubi8: - .dist-ubi8 - .image-pull -image-ubuntu18.04: - extends: - - .dist-ubuntu18.04 - - .image-pull - image-ubuntu20.04: extends: - .dist-ubuntu20.04 @@ -230,12 +225,12 @@ release:packages:kitmaker: extends: - .release:packages -release:staging-ubuntu18.04: +release:staging-ubuntu20.04: extends: - .release:staging - - .dist-ubuntu18.04 + - .dist-ubuntu20.04 needs: - - image-ubuntu18.04 + - image-ubuntu20.04 # Define the external release targets # Release to NGC @@ -244,11 +239,6 @@ release:ngc-centos7: - .dist-centos7 - .release:ngc -release:ngc-ubuntu18.04: - extends: - - .dist-ubuntu18.04 - - .release:ngc - release:ngc-ubuntu20.04: extends: - .dist-ubuntu20.04 diff --git a/CHANGELOG.md b/CHANGELOG.md index b5930cd5..15f07001 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # NVIDIA Container Toolkit Changelog +## v1.12.1 + +* Don't fail chmod hook if paths are not injected +* Fix possible blank `nvidia-ctk` path in generated CDI specifications +* Fix error in postun scriplet on RPM-based systems +* Fix missing NVML symbols when running `nvidia-ctk` on some platforms [#49] +* Discover all `gsb*.bin` GSP firmware files when generating CDI specification. +* Remove `fedora35` packaging targets +* [libnvidia-container] Include all `gsp*.bin` firmware files if present + ## v1.12.0 * Promote `v1.12.0-rc.5` to `v1.12.0` diff --git a/Makefile b/Makefile index a9fc1ffe..7f7d375b 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,7 @@ cmd-%: COMMAND_BUILD_OPTIONS = -o $(PREFIX)/$(*) endif cmds: $(CMD_TARGETS) $(CMD_TARGETS): cmd-%: - GOOS=$(GOOS) go build -ldflags "-s -w -X $(CLI_VERSION_PACKAGE).gitCommit=$(GIT_COMMIT) -X $(CLI_VERSION_PACKAGE).version=$(CLI_VERSION)" $(COMMAND_BUILD_OPTIONS) $(MODULE)/cmd/$(*) + GOOS=$(GOOS) go build -ldflags "-extldflags=-Wl,-z,lazy -s -w -X $(CLI_VERSION_PACKAGE).gitCommit=$(GIT_COMMIT) -X $(CLI_VERSION_PACKAGE).version=$(CLI_VERSION)" $(COMMAND_BUILD_OPTIONS) $(MODULE)/cmd/$(*) build: GOOS=$(GOOS) go build ./... diff --git a/build/container/Makefile b/build/container/Makefile index 32fd8fa6..da244a53 100644 --- a/build/container/Makefile +++ b/build/container/Makefile @@ -44,7 +44,7 @@ OUT_IMAGE = $(OUT_IMAGE_NAME):$(OUT_IMAGE_TAG) ##### Public rules ##### DEFAULT_PUSH_TARGET := ubuntu20.04 -DISTRIBUTIONS := ubuntu20.04 ubuntu18.04 ubi8 centos7 +DISTRIBUTIONS := ubuntu20.04 ubi8 centos7 META_TARGETS := packaging @@ -146,10 +146,7 @@ test-packaging: @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/centos8/ppc64le" || echo "Missing centos8/ppc64le" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/centos8/x86_64" || echo "Missing centos8/x86_64" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/debian10/amd64" || echo "Missing debian10/amd64" - @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/debian9/amd64" || echo "Missing debian9/amd64" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/opensuse-leap15.1/x86_64" || echo "Missing opensuse-leap15.1/x86_64" - @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/ubuntu16.04/amd64" || echo "Missing ubuntu16.04/amd64" - @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/ubuntu16.04/ppc64le" || echo "Missing ubuntu16.04/ppc64le" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/ubuntu18.04/amd64" || echo "Missing ubuntu18.04/amd64" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/ubuntu18.04/arm64" || echo "Missing ubuntu18.04/arm64" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/ubuntu18.04/ppc64le" || echo "Missing ubuntu18.04/ppc64le" diff --git a/cmd/nvidia-ctk/cdi/generate/driver.go b/cmd/nvidia-ctk/cdi/generate/driver.go index 97f1506a..7e5600fc 100644 --- a/cmd/nvidia-ctk/cdi/generate/driver.go +++ b/cmd/nvidia-ctk/cdi/generate/driver.go @@ -87,7 +87,7 @@ func NewDriverLibraryDiscoverer(logger *logrus.Logger, driverRoot string, nvidia // NewDriverFirmwareDiscoverer creates a discoverer for GSP firmware associated with the specified driver version. func NewDriverFirmwareDiscoverer(logger *logrus.Logger, driverRoot string, version string) discover.Discover { - gspFirmwarePath := filepath.Join("/lib/firmware/nvidia", version, "gsp.bin") + gspFirmwarePath := filepath.Join("/lib/firmware/nvidia", version, "gsp*.bin") return discover.NewMounts( logger, lookup.NewFileLocator( diff --git a/cmd/nvidia-ctk/cdi/generate/generate.go b/cmd/nvidia-ctk/cdi/generate/generate.go index 66fc32dd..79a1cf6e 100644 --- a/cmd/nvidia-ctk/cdi/generate/generate.go +++ b/cmd/nvidia-ctk/cdi/generate/generate.go @@ -122,6 +122,8 @@ func (m command) validateFlags(r *cli.Context, cfg *config) error { return err } + cfg.nvidiaCTKPath = discover.FindNvidiaCTK(m.logger, cfg.nvidiaCTKPath) + return nil } diff --git a/cmd/nvidia-ctk/hook/chmod/chmod.go b/cmd/nvidia-ctk/hook/chmod/chmod.go index cad6edfa..0a78b6e8 100644 --- a/cmd/nvidia-ctk/hook/chmod/chmod.go +++ b/cmd/nvidia-ctk/hook/chmod/chmod.go @@ -18,6 +18,7 @@ package chmod import ( "fmt" + "os" "path/filepath" "strings" "syscall" @@ -133,7 +134,12 @@ func (m command) run(c *cli.Context, cfg *config) error { func (m command) getPaths(root string, paths []string) []string { var pathsInRoot []string for _, f := range paths { - pathsInRoot = append(pathsInRoot, filepath.Join(root, f)) + path := filepath.Join(root, f) + if _, err := os.Stat(path); err != nil { + m.logger.Debugf("Skipping path %q: %v", path, err) + continue + } + pathsInRoot = append(pathsInRoot, path) } return pathsInRoot diff --git a/internal/discover/hooks.go b/internal/discover/hooks.go index 708260e1..dfe98988 100644 --- a/internal/discover/hooks.go +++ b/internal/discover/hooks.go @@ -47,6 +47,9 @@ func FindNvidiaCTK(logger *logrus.Logger, nvidiaCTKPath string) string { return nvidiaCTKPath } + if nvidiaCTKPath == "" { + nvidiaCTKPath = nvidiaCTKExecutable + } logger.Debugf("Locating NVIDIA Container Toolkit CLI as %v", nvidiaCTKPath) lookup := lookup.NewExecutableLocator(logger, "") hookPath := nvidiaCTKDefaultFilePath diff --git a/packaging/rpm/SPECS/nvidia-container-toolkit.spec b/packaging/rpm/SPECS/nvidia-container-toolkit.spec index f206f632..ac47cfa2 100644 --- a/packaging/rpm/SPECS/nvidia-container-toolkit.spec +++ b/packaging/rpm/SPECS/nvidia-container-toolkit.spec @@ -65,7 +65,9 @@ rm -rf %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit ln -sf %{_bindir}/nvidia-container-runtime-hook %{_bindir}/nvidia-container-toolkit %postun -if [ -L %{_bindir}/nvidia-container-toolkit ] then; rm -f %{_bindir}/nvidia-container-toolkit; fi +if [ "$1" = 0 ]; then # package is uninstalled, not upgraded + if [ -L %{_bindir}/nvidia-container-toolkit ]; then rm -f %{_bindir}/nvidia-container-toolkit; fi +fi %files %license LICENSE diff --git a/scripts/build-packages.sh b/scripts/build-packages.sh index 89e28eda..de0d658b 100755 --- a/scripts/build-packages.sh +++ b/scripts/build-packages.sh @@ -29,18 +29,12 @@ SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../scripts && pwd )" all=( amazonlinux2-aarch64 amazonlinux2-x86_64 - centos7-ppc64le centos7-x86_64 centos8-aarch64 centos8-ppc64le centos8-x86_64 debian10-amd64 - debian9-amd64 - fedora35-aarch64 - fedora35-x86_64 opensuse-leap15.1-x86_64 - ubuntu16.04-amd64 - ubuntu16.04-ppc64le ubuntu18.04-amd64 ubuntu18.04-arm64 ubuntu18.04-ppc64le @@ -52,14 +46,6 @@ 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) diff --git a/scripts/release-packages.sh b/scripts/release-packages.sh index d15e2ae6..ee676868 100755 --- a/scripts/release-packages.sh +++ b/scripts/release-packages.sh @@ -152,18 +152,12 @@ function sync() { all=( amazonlinux2-aarch64 amazonlinux2-x86_64 - centos7-ppc64le centos7-x86_64 centos8-aarch64 centos8-ppc64le centos8-x86_64 debian10-amd64 - debian9-amd64 - fedora35-aarch64 - fedora35-x86_64 opensuse-leap15.1-x86_64 - ubuntu16.04-amd64 - ubuntu16.04-ppc64le ubuntu18.04-amd64 ubuntu18.04-arm64 ubuntu18.04-ppc64le diff --git a/third_party/libnvidia-container b/third_party/libnvidia-container index 7678e1af..7440a1ea 160000 --- a/third_party/libnvidia-container +++ b/third_party/libnvidia-container @@ -1 +1 @@ -Subproject commit 7678e1af094d865441d0bc1b97c3e72d15fcab50 +Subproject commit 7440a1ead8e4fe35edf1c973c73a662108b21a1f diff --git a/versions.mk b/versions.mk index 7569e232..aca2ffca 100644 --- a/versions.mk +++ b/versions.mk @@ -13,7 +13,7 @@ # limitations under the License. LIB_NAME := nvidia-container-toolkit -LIB_VERSION := 1.12.0 +LIB_VERSION := 1.12.1 # Specify the nvidia-docker2 and nvidia-container-runtime package versions. # Note: The build tooling uses `LIB_TAG` above as the version tag.