From c5b0278c582714b9f6d21585a8848f6f7cbcc9c7 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 23 Aug 2022 21:15:41 +0200 Subject: [PATCH 1/4] Ensure CLI versions are set correctly for RPM packages Signed-off-by: Evan Lezar --- docker/Dockerfile.opensuse-leap | 10 +++++----- docker/Dockerfile.rpm-yum | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docker/Dockerfile.opensuse-leap b/docker/Dockerfile.opensuse-leap index 5d1d3acb..09402a89 100644 --- a/docker/Dockerfile.opensuse-leap +++ b/docker/Dockerfile.opensuse-leap @@ -28,9 +28,9 @@ ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH ARG PKG_NAME ARG PKG_VERS ARG PKG_REV - -ENV VERSION $PKG_VERS -ENV RELEASE $PKG_REV +ENV PKG_NAME ${PKG_NAME} +ENV PKG_VERS ${PKG_VERS} +ENV PKG_REV ${PKG_REV} # output directory ENV DIST_DIR=/tmp/nvidia-container-toolkit-$PKG_VERS/SOURCES @@ -65,8 +65,8 @@ CMD arch=$(uname -m) && \ -D "_topdir $PWD" \ -D "release_date $(date +'%a %b %d %Y')" \ -D "git_commit ${GIT_COMMIT}" \ - -D "version $VERSION" \ + -D "version ${PKG_VERS}" \ -D "libnvidia_container_tools_version ${LIBNVIDIA_CONTAINER_TOOLS_VERSION}" \ - -D "release $RELEASE" \ + -D "release ${PKG_REV}" \ SPECS/nvidia-container-toolkit.spec && \ mv RPMS/$arch/*.rpm /dist diff --git a/docker/Dockerfile.rpm-yum b/docker/Dockerfile.rpm-yum index b4c2ed2f..6e5d8456 100644 --- a/docker/Dockerfile.rpm-yum +++ b/docker/Dockerfile.rpm-yum @@ -46,9 +46,9 @@ ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH ARG PKG_NAME ARG PKG_VERS ARG PKG_REV - -ENV VERSION $PKG_VERS -ENV RELEASE $PKG_REV +ENV PKG_NAME ${PKG_NAME} +ENV PKG_VERS ${PKG_VERS} +ENV PKG_REV ${PKG_REV} # output directory ENV DIST_DIR=/tmp/nvidia-container-toolkit-$PKG_VERS/SOURCES @@ -83,8 +83,8 @@ CMD arch=$(uname -m) && \ -D "_topdir $PWD" \ -D "release_date $(date +'%a %b %d %Y')" \ -D "git_commit ${GIT_COMMIT}" \ - -D "version $VERSION" \ + -D "version ${PKG_VERS}" \ -D "libnvidia_container_tools_version ${LIBNVIDIA_CONTAINER_TOOLS_VERSION}" \ - -D "release $RELEASE" \ + -D "release ${PKG_REV}" \ SPECS/nvidia-container-toolkit.spec && \ mv RPMS/$arch/*.rpm /dist From e34fe17b4502893601be37f8c706410e3f7e0d1a Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 23 Aug 2022 21:16:31 +0200 Subject: [PATCH 2/4] Add fedora35 to release and signing scripts Signed-off-by: Evan Lezar --- scripts/packages-sign-all.sh | 2 ++ scripts/release-packages.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/scripts/packages-sign-all.sh b/scripts/packages-sign-all.sh index 1b660feb..11f0b0d9 100755 --- a/scripts/packages-sign-all.sh +++ b/scripts/packages-sign-all.sh @@ -61,6 +61,8 @@ function sign() { ;; debian*) pkg_type=deb ;; + fedora*) pkg_type=rpm + ;; opensuse-leap*) pkg_type=rpm ;; ubuntu*) pkg_type=deb diff --git a/scripts/release-packages.sh b/scripts/release-packages.sh index 6b6a5bed..2c020ebe 100755 --- a/scripts/release-packages.sh +++ b/scripts/release-packages.sh @@ -94,6 +94,8 @@ function sync() { ;; debian*) pkg_type=deb ;; + fedora*) pkg_type=rpm + ;; opensuse-leap*) pkg_type=rpm ;; ubuntu*) pkg_type=deb From 8e8c41a3bc9c0aea595d075619ee72aebae85e8c Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 23 Aug 2022 21:17:00 +0200 Subject: [PATCH 3/4] Clean up repo test scripts Signed-off-by: Evan Lezar --- test/release/docker/centos8/Dockerfile | 5 ++--- test/release/docker/centos8/install_repo.sh | 2 +- test/release/docker/ubuntu18.04/Dockerfile | 5 ++--- test/release/docker/ubuntu18.04/install_repo.sh | 4 ++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/test/release/docker/centos8/Dockerfile b/test/release/docker/centos8/Dockerfile index 32f966e3..ab2152c8 100644 --- a/test/release/docker/centos8/Dockerfile +++ b/test/release/docker/centos8/Dockerfile @@ -25,9 +25,8 @@ RUN fpm -s empty \ rm -f /tmp/docker.rpm -ARG WORKFLOW=nvidia-docker -RUN curl -s -L https://nvidia.github.io/${WORKFLOW}/centos8/nvidia-docker.repo \ - | tee /etc/yum.repos.d/nvidia-docker.repo +RUN curl -s -L https://nvidia.github.io/libnvidia-container/centos8/libnvidia-container.repo \ + | tee /etc/yum.repos.d/nvidia-container-toolkit.repo COPY entrypoint.sh / COPY install_repo.sh / diff --git a/test/release/docker/centos8/install_repo.sh b/test/release/docker/centos8/install_repo.sh index ae65fdf3..cb8b6a13 100755 --- a/test/release/docker/centos8/install_repo.sh +++ b/test/release/docker/centos8/install_repo.sh @@ -21,5 +21,5 @@ test_repo=$1 echo "Setting up TEST repo: ${test_repo}" -sed -i -e "s#nvidia\.github\.io/libnvidia-container#${test_repo}/libnvidia-container#g" /etc/yum.repos.d/nvidia-docker.repo +sed -i -e "s#nvidia\.github\.io/libnvidia-container#${test_repo}/libnvidia-container#g" /etc/yum.repos.d/nvidia-container-toolkit.repo yum-config-manager --enable libnvidia-container-experimental diff --git a/test/release/docker/ubuntu18.04/Dockerfile b/test/release/docker/ubuntu18.04/Dockerfile index a23cca21..e3ba89cb 100644 --- a/test/release/docker/ubuntu18.04/Dockerfile +++ b/test/release/docker/ubuntu18.04/Dockerfile @@ -39,9 +39,8 @@ RUN fpm -s empty \ rm -f /tmp/docker.deb -ARG WORKFLOW=nvidia-docker -RUN curl -s -L https://nvidia.github.io/${WORKFLOW}/gpgkey | apt-key add - \ - && curl -s -L https://nvidia.github.io/${WORKFLOW}/ubuntu18.04/nvidia-docker.list | tee /etc/apt/sources.list.d/nvidia-docker.list \ +RUN curl -s -L https://nvidia.github.io/libnvidia-container/gpgkey | apt-key add - \ + && curl -s -L https://nvidia.github.io/libnvidia-container/ubuntu18.04/libnvidia-container.list | tee /etc/apt/sources.list.d/nvidia-container-toolkit.list \ && apt-get update COPY entrypoint.sh / diff --git a/test/release/docker/ubuntu18.04/install_repo.sh b/test/release/docker/ubuntu18.04/install_repo.sh index a6c0d156..befad329 100755 --- a/test/release/docker/ubuntu18.04/install_repo.sh +++ b/test/release/docker/ubuntu18.04/install_repo.sh @@ -21,5 +21,5 @@ test_repo=$1 echo "Setting up TEST repo: ${test_repo}" -sed -i -e "s#nvidia\.github\.io/libnvidia-container#${test_repo}/libnvidia-container#g" /etc/apt/sources.list.d/nvidia-docker.list -sed -i -e '/experimental/ s/^#//g' /etc/apt/sources.list.d/nvidia-docker.list +sed -i -e "s#nvidia\.github\.io/libnvidia-container#${test_repo}/libnvidia-container#g" /etc/apt/sources.list.d/nvidia-container-toolkit.list +sed -i -e '/experimental/ s/^#//g' /etc/apt/sources.list.d/nvidia-container-toolkit.list From d8ba84d427c0240990458496c0f834a937d15732 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 23 Aug 2022 21:17:24 +0200 Subject: [PATCH 4/4] Add release tests for fedora35 Signed-off-by: Evan Lezar --- test/release/Makefile | 4 +- test/release/docker/fedora35/Dockerfile | 34 ++++++++++++++++ test/release/docker/fedora35/entrypoint.sh | 42 ++++++++++++++++++++ test/release/docker/fedora35/install_repo.sh | 25 ++++++++++++ 4 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 test/release/docker/fedora35/Dockerfile create mode 100755 test/release/docker/fedora35/entrypoint.sh create mode 100755 test/release/docker/fedora35/install_repo.sh diff --git a/test/release/Makefile b/test/release/Makefile index 37cbee25..386468c1 100644 --- a/test/release/Makefile +++ b/test/release/Makefile @@ -14,7 +14,7 @@ WORKFLOW ?= nvidia-docker -DISTRIBUTIONS := ubuntu18.04 centos8 +DISTRIBUTIONS := ubuntu18.04 centos8 fedora35 IMAGE_TARGETS := $(patsubst %,image-%, $(DISTRIBUTIONS)) RUN_TARGETS := $(patsubst %,run-%, $(DISTRIBUTIONS)) @@ -28,7 +28,6 @@ image-%: DOCKERFILE = docker/$(*)/Dockerfile images: $(IMAGE_TARGETS) $(IMAGE_TARGETS): image-%: $(DOCKERFILE) docker build ${PLATFORM_ARGS} \ - --build-arg WORKFLOW="$(WORKFLOW)" \ -t nvidia-container-toolkit-repo-test:$(*) \ -f $(DOCKERFILE) \ $(shell dirname $(DOCKERFILE)) @@ -36,6 +35,7 @@ $(IMAGE_TARGETS): image-%: $(DOCKERFILE) %-ubuntu18.04: ARCH ?= amd64 %-centos8: ARCH ?= x86_64 +%-fedora35: ARCH ?= x86_64 PLATFORM_ARGS = --platform=linux/${ARCH} diff --git a/test/release/docker/fedora35/Dockerfile b/test/release/docker/fedora35/Dockerfile new file mode 100644 index 00000000..0034246d --- /dev/null +++ b/test/release/docker/fedora35/Dockerfile @@ -0,0 +1,34 @@ +ARG BASEIMAGE=fedora:35 +FROM ${BASEIMAGE} + +RUN yum install -y \ + yum-utils \ + ruby-devel \ + gcc \ + make \ + rpm-build \ + rubygems \ + createrepo + +RUN gem install --no-document fpm + +# We create and install a dummy docker package since these dependencies are out of +# scope for the tests performed here. +RUN fpm -s empty \ + -t rpm \ + --description "A dummy package for docker-ce_18.06.3.ce-3.el7" \ + -n docker-ce --version 18.06.3.ce-3.el7 \ + -p /tmp/docker.rpm \ + && \ + yum localinstall -y /tmp/docker.rpm \ + && \ + rm -f /tmp/docker.rpm + + +RUN curl -s -L https://nvidia.github.io/libnvidia-container/fedora35/nvidia-container-toolkit.repo \ + | tee /etc/yum.repos.d/nvidia-container-toolkit.repo + +COPY entrypoint.sh / +COPY install_repo.sh / + +ENTRYPOINT [ "/entrypoint.sh" ] \ No newline at end of file diff --git a/test/release/docker/fedora35/entrypoint.sh b/test/release/docker/fedora35/entrypoint.sh new file mode 100755 index 00000000..c118b1fe --- /dev/null +++ b/test/release/docker/fedora35/entrypoint.sh @@ -0,0 +1,42 @@ +#!/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. + +# This script is used to build the packages for the components of the NVIDIA +# Container Stack. These include the nvidia-container-toolkit in this repository +# as well as the components included in the third_party folder. +# All required packages are generated in the specified dist folder. + +: ${LOCAL_REPO_DIRECTORY:=/local-repository} +if [[ -d ${LOCAL_REPO_DIRECTORY} ]]; then + echo "Setting up local-repository" + createrepo /local-repository + + cat >/etc/yum.repos.d/local.repo <