From ef115045af5ec3d1f8492f8d6f6d1d08be6c87da Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Mon, 6 Sep 2021 15:52:13 +0200 Subject: [PATCH 1/3] Bump version for post 2.6.0 development Signed-off-by: Evan Lezar --- Makefile | 11 +++++++++-- debian/changelog | 6 ++++++ docker/Dockerfile.debian | 3 +-- docker/Dockerfile.ubuntu | 3 +-- rpm/SPECS/nvidia-docker2.spec | 3 +++ 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 8d5a0a2..017b2e4 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,8 @@ MKDIR ?= mkdir DIST_DIR ?= $(CURDIR)/dist LIB_NAME := nvidia-docker2 -LIB_VERSION := 2.6.0 -PKG_REV := 1 +LIB_VERSION := 2.6.1 +LIB_TAG := rc.1 RUNTIME_VERSION := 3.5.0 @@ -77,6 +77,7 @@ docker-all: $(AMD64_TARGETS) $(X86_64_TARGETS) \ # Default variables for all private '--' targets below. # One private target is defined for each OS we support. +--%: PKG_REV = 1 --%: TARGET_PLATFORM = $(*) --%: VERSION = $(patsubst $(OS)%-$(ARCH),%,$(TARGET_PLATFORM)) --%: BASEIMAGE = $(OS):$(VERSION) @@ -88,31 +89,37 @@ docker-all: $(AMD64_TARGETS) $(X86_64_TARGETS) \ # private ubuntu target --ubuntu%: OS := ubuntu +--ubuntu%: LIB_VERSION := $(LIB_VERSION)$(if $(LIB_TAG),~$(LIB_TAG)) --ubuntu%: DOCKER_VERSION := docker-ce (>= 18.06.0~ce~3-0~ubuntu) | docker-ee (>= 18.06.0~ce~3-0~ubuntu) | docker.io (>= 18.06.0) # private debian target --debian%: OS := debian +--debian%: LIB_VERSION := $(LIB_VERSION)$(if $(LIB_TAG),~$(LIB_TAG)) --debian%: DOCKER_VERSION := docker-ce (>= 18.06.0~ce~3-0~debian) | docker-ee (>= 18.06.0~ce~3-0~debian) | docker.io (>= 18.06.0) # private centos target --centos%: OS := centos --centos%: DOCKER_VERSION := docker-ce >= 18.06.3.ce-3.el7 +--centos%: PKG_REV := $(if $(LIB_TAG),0.1.$(LIB_TAG),2) # private amazonlinuxtarget --amazonlinux%: OS := amazonlinux --amazonlinux2%: DOCKER_VERSION := docker >= 18.06.1ce-2.amzn2 --amazonlinux1%: DOCKER_VERSION := docker >= 18.06.1ce-2.16.amzn1 +--amazonlinux%: PKG_REV = $(if $(LIB_TAG),0.1.$(LIB_TAG).amzn$(VERSION),2.amzn$(VERSION)) # private opensuse-leap target --opensuse-leap%: OS := opensuse-leap --opensuse-leap%: BASEIMAGE = opensuse/leap:$(VERSION) --opensuse-leap%: DOCKER_VERSION := docker >= 18.09.1_ce +--opensuse-leap%: PKG_REV := $(if $(LIB_TAG),0.1.$(LIB_TAG),1) # private rhel target (actually built on centos) --rhel%: OS := centos --rhel%: VERSION = $(patsubst rhel%-$(ARCH),%,$(TARGET_PLATFORM)) --rhel%: ARTIFACTS_DIR = $(DIST_DIR)/rhel$(VERSION)/$(ARCH) --rhel%: DOCKER_VERSION := docker-ce >= 18.06.3.ce-3.el7 +--rhel%: PKG_REV := $(if $(LIB_TAG),0.1.$(LIB_TAG),2) docker-build-%: @echo "Building for $(TARGET_PLATFORM)" diff --git a/debian/changelog b/debian/changelog index b5a8155..b300e9a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +nvidia-docker2 (2.6.1~rc.1-1) UNRELEASED; urgency=medium + + * [BUILD] Allow for TAG to be specified in Makfile to match other projects + + -- NVIDIA CORPORATION Thu, 29 Apr 2021 05:25:25 +0000 + nvidia-docker2 (2.6.0-1) UNRELEASED; urgency=medium * Add dependence on nvidia-container-runtime >= 3.5.0 diff --git a/docker/Dockerfile.debian b/docker/Dockerfile.debian index eaee388..aff1222 100644 --- a/docker/Dockerfile.debian +++ b/docker/Dockerfile.debian @@ -34,8 +34,7 @@ COPY daemon.json $DIST_DIR/daemon.json WORKDIR $DIST_DIR COPY debian ./debian -RUN sed -i "s;@VERSION@;${REVISION};" debian/changelog && \ - sed -i "s;@VERSION@;${PKG_VERS};" $DIST_DIR/nvidia-docker && \ +RUN sed -i "s;@VERSION@;${PKG_VERS};" $DIST_DIR/nvidia-docker && \ if [ "$REVISION" != "$(dpkg-parsechangelog --show-field=Version)" ]; then exit 1; fi CMD export DISTRIB="unstable" && \ diff --git a/docker/Dockerfile.ubuntu b/docker/Dockerfile.ubuntu index c84c02a..431493b 100644 --- a/docker/Dockerfile.ubuntu +++ b/docker/Dockerfile.ubuntu @@ -35,8 +35,7 @@ COPY daemon.json $DIST_DIR/daemon.json WORKDIR $DIST_DIR COPY debian ./debian -RUN sed -i "s;@VERSION@;${REVISION};" debian/changelog && \ - sed -i "s;@VERSION@;${PKG_VERS};" $DIST_DIR/nvidia-docker && \ +RUN sed -i "s;@VERSION@;${PKG_VERS};" $DIST_DIR/nvidia-docker && \ if [ "$REVISION" != "$(dpkg-parsechangelog --show-field=Version)" ]; then echo "$(dpkg-parsechangelog --show-field=Version)" && exit 1; fi CMD export DISTRIB="$(lsb_release -cs)" && \ diff --git a/rpm/SPECS/nvidia-docker2.spec b/rpm/SPECS/nvidia-docker2.spec index 6151c5f..9d602c1 100644 --- a/rpm/SPECS/nvidia-docker2.spec +++ b/rpm/SPECS/nvidia-docker2.spec @@ -37,6 +37,9 @@ install -m 644 -t %{buildroot}/etc/docker daemon.json %config /etc/docker/daemon.json %changelog +* Mon Sep 06 2021 NVIDIA CORPORATION 2.6.1-0.1.rc.1 +- [BUILD] Allow for TAG to be specified in Makfile to match other projects + * Thu Apr 29 2021 NVIDIA CORPORATION 2.6.0-1 - Add dependence on nvidia-container-runtime >= 3.5.0 - Add Jenkinsfile for building packages From f4ba99f986bcd01cef7f0656548ebd983b0ea907 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Mon, 6 Sep 2021 15:54:44 +0200 Subject: [PATCH 2/3] Depend on nvidia-container-toolkit instead of nvidia-container-runtime Signed-off-by: Evan Lezar --- Makefile | 4 ++-- debian/changelog | 2 ++ debian/control | 5 ++--- debian/prepare | 2 +- docker/Dockerfile.amazonlinux | 6 +++--- docker/Dockerfile.centos | 6 +++--- docker/Dockerfile.debian | 4 ++-- docker/Dockerfile.opensuse-leap | 6 +++--- docker/Dockerfile.ubuntu | 4 ++-- rpm/SPECS/nvidia-docker2.spec | 5 +++-- 10 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 017b2e4..a1dbfbe 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ LIB_NAME := nvidia-docker2 LIB_VERSION := 2.6.1 LIB_TAG := rc.1 -RUNTIME_VERSION := 3.5.0 +TOOLKIT_VERSION := 1.5.2 # Supported OSs by architecture AMD64_TARGETS := ubuntu20.04 ubuntu18.04 ubuntu16.04 debian10 debian9 @@ -129,7 +129,7 @@ docker-build-%: --progress=plain \ --build-arg BASEIMAGE="$(BASEIMAGE)" \ --build-arg DOCKER_VERSION="$(DOCKER_VERSION)" \ - --build-arg RUNTIME_VERSION="$(RUNTIME_VERSION)" \ + --build-arg TOOLKIT_VERSION="$(TOOLKIT_VERSION)" \ --build-arg PKG_VERS="$(LIB_VERSION)" \ --build-arg PKG_REV="$(PKG_REV)" \ --tag $(BUILDIMAGE) \ diff --git a/debian/changelog b/debian/changelog index b300e9a..4956ab7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ nvidia-docker2 (2.6.1~rc.1-1) UNRELEASED; urgency=medium * [BUILD] Allow for TAG to be specified in Makfile to match other projects + * Replace nvidia-container-runtime dependece with nvidia-container-toolit >= 1.5.2 + -- NVIDIA CORPORATION Thu, 29 Apr 2021 05:25:25 +0000 diff --git a/debian/control b/debian/control index 84bb44a..ee8d0c4 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,6 @@ Package: nvidia-docker2 Architecture: all Breaks: nvidia-docker (<< 2.0.0) Replaces: nvidia-docker (<< 2.0.0) -Depends: ${misc:Depends}, nvidia-container-runtime (>= @RUNTIME_VERSION@), @DOCKER_VERSION@ +Depends: ${misc:Depends}, nvidia-container-toolkit (>= @TOOLKIT_VERSION@), @DOCKER_VERSION@ Description: nvidia-docker CLI wrapper - Replaces nvidia-docker with a new implementation based on - nvidia-container-runtime + Replaces nvidia-docker with a new implementation based on the NVIDIA Container Toolkit diff --git a/debian/prepare b/debian/prepare index 5900ca5..04229c7 100755 --- a/debian/prepare +++ b/debian/prepare @@ -3,5 +3,5 @@ set -e sed -i "s;@SECTION@;${SECTION:+$SECTION/};g" debian/control -sed -i "s;@RUNTIME_VERSION@;${RUNTIME_VERSION};g" debian/control +sed -i "s;@TOOLKIT_VERSION@;${TOOLKIT_VERSION};g" debian/control sed -i "s;@DOCKER_VERSION@;${DOCKER_VERSION};g" debian/control diff --git a/docker/Dockerfile.amazonlinux b/docker/Dockerfile.amazonlinux index ade1a06..b6f8a6d 100644 --- a/docker/Dockerfile.amazonlinux +++ b/docker/Dockerfile.amazonlinux @@ -9,13 +9,13 @@ RUN yum install -y \ # packaging ARG PKG_VERS ARG PKG_REV -ARG RUNTIME_VERSION +ARG TOOLKIT_VERSION ARG DOCKER_VERSION ENV VERSION $PKG_VERS ENV RELEASE $PKG_REV ENV DOCKER_VERSION $DOCKER_VERSION -ENV RUNTIME_VERSION $RUNTIME_VERSION +ENV TOOLKIT_VERSION $TOOLKIT_VERSION # output directory ENV DIST_DIR=/tmp/nvidia-container-runtime-$PKG_VERS/SOURCES @@ -34,6 +34,6 @@ CMD rpmbuild --clean -bb \ -D "version $VERSION" \ -D "release $RELEASE" \ -D "docker_version $DOCKER_VERSION" \ - -D "runtime_version $RUNTIME_VERSION" \ + -D "toolkit_version $TOOLKIT_VERSION" \ SPECS/nvidia-docker2.spec && \ mv RPMS/noarch/*.rpm /dist diff --git a/docker/Dockerfile.centos b/docker/Dockerfile.centos index ade1a06..b6f8a6d 100644 --- a/docker/Dockerfile.centos +++ b/docker/Dockerfile.centos @@ -9,13 +9,13 @@ RUN yum install -y \ # packaging ARG PKG_VERS ARG PKG_REV -ARG RUNTIME_VERSION +ARG TOOLKIT_VERSION ARG DOCKER_VERSION ENV VERSION $PKG_VERS ENV RELEASE $PKG_REV ENV DOCKER_VERSION $DOCKER_VERSION -ENV RUNTIME_VERSION $RUNTIME_VERSION +ENV TOOLKIT_VERSION $TOOLKIT_VERSION # output directory ENV DIST_DIR=/tmp/nvidia-container-runtime-$PKG_VERS/SOURCES @@ -34,6 +34,6 @@ CMD rpmbuild --clean -bb \ -D "version $VERSION" \ -D "release $RELEASE" \ -D "docker_version $DOCKER_VERSION" \ - -D "runtime_version $RUNTIME_VERSION" \ + -D "toolkit_version $TOOLKIT_VERSION" \ SPECS/nvidia-docker2.spec && \ mv RPMS/noarch/*.rpm /dist diff --git a/docker/Dockerfile.debian b/docker/Dockerfile.debian index aff1222..1bc7b61 100644 --- a/docker/Dockerfile.debian +++ b/docker/Dockerfile.debian @@ -13,14 +13,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # packaging ARG PKG_VERS ARG PKG_REV -ARG RUNTIME_VERSION +ARG TOOLKIT_VERSION ARG DOCKER_VERSION ENV DEBFULLNAME "NVIDIA CORPORATION" ENV DEBEMAIL "cudatools@nvidia.com" ENV REVISION "$PKG_VERS-$PKG_REV" ENV DOCKER_VERSION $DOCKER_VERSION -ENV RUNTIME_VERSION $RUNTIME_VERSION +ENV TOOLKIT_VERSION $TOOLKIT_VERSION ENV SECTION "" # output directory diff --git a/docker/Dockerfile.opensuse-leap b/docker/Dockerfile.opensuse-leap index ac52917..ccaeab9 100644 --- a/docker/Dockerfile.opensuse-leap +++ b/docker/Dockerfile.opensuse-leap @@ -9,13 +9,13 @@ RUN zypper install -y \ # packaging ARG PKG_VERS ARG PKG_REV -ARG RUNTIME_VERSION +ARG TOOLKIT_VERSION ARG DOCKER_VERSION ENV VERSION $PKG_VERS ENV RELEASE $PKG_REV ENV DOCKER_VERSION $DOCKER_VERSION -ENV RUNTIME_VERSION $RUNTIME_VERSION +ENV TOOLKIT_VERSION $TOOLKIT_VERSION # output directory ENV DIST_DIR=/tmp/nvidia-container-runtime-$PKG_VERS/SOURCES @@ -34,6 +34,6 @@ CMD rpmbuild --clean -bb \ -D "version $VERSION" \ -D "release $RELEASE" \ -D "docker_version $DOCKER_VERSION" \ - -D "runtime_version $RUNTIME_VERSION" \ + -D "toolkit_version $TOOLKIT_VERSION" \ SPECS/nvidia-docker2.spec && \ mv RPMS/noarch/*.rpm /dist diff --git a/docker/Dockerfile.ubuntu b/docker/Dockerfile.ubuntu index 431493b..8ecee60 100644 --- a/docker/Dockerfile.ubuntu +++ b/docker/Dockerfile.ubuntu @@ -14,14 +14,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # packaging ARG PKG_VERS ARG PKG_REV -ARG RUNTIME_VERSION +ARG TOOLKIT_VERSION ARG DOCKER_VERSION ENV DEBFULLNAME "NVIDIA CORPORATION" ENV DEBEMAIL "cudatools@nvidia.com" ENV REVISION "$PKG_VERS-$PKG_REV" ENV DOCKER_VERSION $DOCKER_VERSION -ENV RUNTIME_VERSION $RUNTIME_VERSION +ENV TOOLKIT_VERSION $TOOLKIT_VERSION ENV SECTION "" # output directory diff --git a/rpm/SPECS/nvidia-docker2.spec b/rpm/SPECS/nvidia-docker2.spec index 9d602c1..cf7feda 100644 --- a/rpm/SPECS/nvidia-docker2.spec +++ b/rpm/SPECS/nvidia-docker2.spec @@ -16,11 +16,11 @@ Source1: daemon.json Source2: LICENSE Conflicts: nvidia-docker < 2.0.0 -Requires: nvidia-container-runtime >= %{runtime_version} +Requires: nvidia-container-toolkit >= %{toolkit_version} Requires: %{docker_version} %description -Replaces nvidia-docker with a new implementation based on nvidia-container-runtime +Replaces nvidia-docker with a new implementation based on the NVIDIA Container Toolkit %prep cp %{SOURCE0} %{SOURCE1} %{SOURCE2} . @@ -39,6 +39,7 @@ install -m 644 -t %{buildroot}/etc/docker daemon.json %changelog * Mon Sep 06 2021 NVIDIA CORPORATION 2.6.1-0.1.rc.1 - [BUILD] Allow for TAG to be specified in Makfile to match other projects +- Replace nvidia-container-runtime dependece with nvidia-container-toolit >= 1.5.2 * Thu Apr 29 2021 NVIDIA CORPORATION 2.6.0-1 - Add dependence on nvidia-container-runtime >= 3.5.0 From 8f94f918633e74bea85b7b10e166c2d0886d96bc Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Mon, 6 Sep 2021 15:59:35 +0200 Subject: [PATCH 3/3] Correct DIST_DIR in rpm build docker files Signed-off-by: Evan Lezar --- Makefile | 4 +++- debian/control | 2 +- docker/Dockerfile.amazonlinux | 2 +- docker/Dockerfile.centos | 2 +- docker/Dockerfile.opensuse-leap | 2 +- rpm/SPECS/nvidia-docker2.spec | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index a1dbfbe..d329b7d 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,9 @@ LIB_NAME := nvidia-docker2 LIB_VERSION := 2.6.1 LIB_TAG := rc.1 -TOOLKIT_VERSION := 1.5.2 +# Note: This should be the previous full release of nvidia-container-toolkit to ensure +# that release candidate (e.g. rc.1) work as expected. +TOOLKIT_VERSION := 1.5.1 # Supported OSs by architecture AMD64_TARGETS := ubuntu20.04 ubuntu18.04 ubuntu16.04 debian10 debian9 diff --git a/debian/control b/debian/control index ee8d0c4..caa03a1 100644 --- a/debian/control +++ b/debian/control @@ -12,6 +12,6 @@ Package: nvidia-docker2 Architecture: all Breaks: nvidia-docker (<< 2.0.0) Replaces: nvidia-docker (<< 2.0.0) -Depends: ${misc:Depends}, nvidia-container-toolkit (>= @TOOLKIT_VERSION@), @DOCKER_VERSION@ +Depends: ${misc:Depends}, nvidia-container-toolkit (>> @TOOLKIT_VERSION@), @DOCKER_VERSION@ Description: nvidia-docker CLI wrapper Replaces nvidia-docker with a new implementation based on the NVIDIA Container Toolkit diff --git a/docker/Dockerfile.amazonlinux b/docker/Dockerfile.amazonlinux index b6f8a6d..1970575 100644 --- a/docker/Dockerfile.amazonlinux +++ b/docker/Dockerfile.amazonlinux @@ -18,7 +18,7 @@ ENV DOCKER_VERSION $DOCKER_VERSION ENV TOOLKIT_VERSION $TOOLKIT_VERSION # output directory -ENV DIST_DIR=/tmp/nvidia-container-runtime-$PKG_VERS/SOURCES +ENV DIST_DIR=/tmp/nvidia-docker2-$PKG_VERS/SOURCES RUN mkdir -p $DIST_DIR /dist COPY nvidia-docker $DIST_DIR diff --git a/docker/Dockerfile.centos b/docker/Dockerfile.centos index b6f8a6d..1970575 100644 --- a/docker/Dockerfile.centos +++ b/docker/Dockerfile.centos @@ -18,7 +18,7 @@ ENV DOCKER_VERSION $DOCKER_VERSION ENV TOOLKIT_VERSION $TOOLKIT_VERSION # output directory -ENV DIST_DIR=/tmp/nvidia-container-runtime-$PKG_VERS/SOURCES +ENV DIST_DIR=/tmp/nvidia-docker2-$PKG_VERS/SOURCES RUN mkdir -p $DIST_DIR /dist COPY nvidia-docker $DIST_DIR diff --git a/docker/Dockerfile.opensuse-leap b/docker/Dockerfile.opensuse-leap index ccaeab9..3420ad4 100644 --- a/docker/Dockerfile.opensuse-leap +++ b/docker/Dockerfile.opensuse-leap @@ -18,7 +18,7 @@ ENV DOCKER_VERSION $DOCKER_VERSION ENV TOOLKIT_VERSION $TOOLKIT_VERSION # output directory -ENV DIST_DIR=/tmp/nvidia-container-runtime-$PKG_VERS/SOURCES +ENV DIST_DIR=/tmp/nvidia-docker2-$PKG_VERS/SOURCES RUN mkdir -p $DIST_DIR /dist COPY nvidia-docker $DIST_DIR diff --git a/rpm/SPECS/nvidia-docker2.spec b/rpm/SPECS/nvidia-docker2.spec index cf7feda..8085b45 100644 --- a/rpm/SPECS/nvidia-docker2.spec +++ b/rpm/SPECS/nvidia-docker2.spec @@ -16,7 +16,7 @@ Source1: daemon.json Source2: LICENSE Conflicts: nvidia-docker < 2.0.0 -Requires: nvidia-container-toolkit >= %{toolkit_version} +Requires: nvidia-container-toolkit > %{toolkit_version} Requires: %{docker_version} %description