Skip to content

Commit 503ed96

Browse files
author
Evan Lezar
committed
Merge branch 'fix-release-tooling' into 'main'
Ensure CLI versions are set correctly for RPM packages See merge request nvidia/container-toolkit/container-toolkit!211
2 parents 8daa257 + d8ba84d commit 503ed96

File tree

12 files changed

+124
-21
lines changed

12 files changed

+124
-21
lines changed

docker/Dockerfile.opensuse-leap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
2828
ARG PKG_NAME
2929
ARG PKG_VERS
3030
ARG PKG_REV
31-
32-
ENV VERSION $PKG_VERS
33-
ENV RELEASE $PKG_REV
31+
ENV PKG_NAME ${PKG_NAME}
32+
ENV PKG_VERS ${PKG_VERS}
33+
ENV PKG_REV ${PKG_REV}
3434

3535
# output directory
3636
ENV DIST_DIR=/tmp/nvidia-container-toolkit-$PKG_VERS/SOURCES
@@ -65,8 +65,8 @@ CMD arch=$(uname -m) && \
6565
-D "_topdir $PWD" \
6666
-D "release_date $(date +'%a %b %d %Y')" \
6767
-D "git_commit ${GIT_COMMIT}" \
68-
-D "version $VERSION" \
68+
-D "version ${PKG_VERS}" \
6969
-D "libnvidia_container_tools_version ${LIBNVIDIA_CONTAINER_TOOLS_VERSION}" \
70-
-D "release $RELEASE" \
70+
-D "release ${PKG_REV}" \
7171
SPECS/nvidia-container-toolkit.spec && \
7272
mv RPMS/$arch/*.rpm /dist

docker/Dockerfile.rpm-yum

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
4646
ARG PKG_NAME
4747
ARG PKG_VERS
4848
ARG PKG_REV
49-
50-
ENV VERSION $PKG_VERS
51-
ENV RELEASE $PKG_REV
49+
ENV PKG_NAME ${PKG_NAME}
50+
ENV PKG_VERS ${PKG_VERS}
51+
ENV PKG_REV ${PKG_REV}
5252

5353
# output directory
5454
ENV DIST_DIR=/tmp/nvidia-container-toolkit-$PKG_VERS/SOURCES
@@ -83,8 +83,8 @@ CMD arch=$(uname -m) && \
8383
-D "_topdir $PWD" \
8484
-D "release_date $(date +'%a %b %d %Y')" \
8585
-D "git_commit ${GIT_COMMIT}" \
86-
-D "version $VERSION" \
86+
-D "version ${PKG_VERS}" \
8787
-D "libnvidia_container_tools_version ${LIBNVIDIA_CONTAINER_TOOLS_VERSION}" \
88-
-D "release $RELEASE" \
88+
-D "release ${PKG_REV}" \
8989
SPECS/nvidia-container-toolkit.spec && \
9090
mv RPMS/$arch/*.rpm /dist

scripts/packages-sign-all.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ function sign() {
6161
;;
6262
debian*) pkg_type=deb
6363
;;
64+
fedora*) pkg_type=rpm
65+
;;
6466
opensuse-leap*) pkg_type=rpm
6567
;;
6668
ubuntu*) pkg_type=deb

scripts/release-packages.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ function sync() {
9494
;;
9595
debian*) pkg_type=deb
9696
;;
97+
fedora*) pkg_type=rpm
98+
;;
9799
opensuse-leap*) pkg_type=rpm
98100
;;
99101
ubuntu*) pkg_type=deb

test/release/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
WORKFLOW ?= nvidia-docker
1616

17-
DISTRIBUTIONS := ubuntu18.04 centos8
17+
DISTRIBUTIONS := ubuntu18.04 centos8 fedora35
1818

1919
IMAGE_TARGETS := $(patsubst %,image-%, $(DISTRIBUTIONS))
2020
RUN_TARGETS := $(patsubst %,run-%, $(DISTRIBUTIONS))
@@ -28,14 +28,14 @@ image-%: DOCKERFILE = docker/$(*)/Dockerfile
2828
images: $(IMAGE_TARGETS)
2929
$(IMAGE_TARGETS): image-%: $(DOCKERFILE)
3030
docker build ${PLATFORM_ARGS} \
31-
--build-arg WORKFLOW="$(WORKFLOW)" \
3231
-t nvidia-container-toolkit-repo-test:$(*) \
3332
-f $(DOCKERFILE) \
3433
$(shell dirname $(DOCKERFILE))
3534

3635

3736
%-ubuntu18.04: ARCH ?= amd64
3837
%-centos8: ARCH ?= x86_64
38+
%-fedora35: ARCH ?= x86_64
3939

4040
PLATFORM_ARGS = --platform=linux/${ARCH}
4141

test/release/docker/centos8/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ RUN fpm -s empty \
2525
rm -f /tmp/docker.rpm
2626

2727

28-
ARG WORKFLOW=nvidia-docker
29-
RUN curl -s -L https://nvidia.github.io/${WORKFLOW}/centos8/nvidia-docker.repo \
30-
| tee /etc/yum.repos.d/nvidia-docker.repo
28+
RUN curl -s -L https://nvidia.github.io/libnvidia-container/centos8/libnvidia-container.repo \
29+
| tee /etc/yum.repos.d/nvidia-container-toolkit.repo
3130

3231
COPY entrypoint.sh /
3332
COPY install_repo.sh /

test/release/docker/centos8/install_repo.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121

2222
test_repo=$1
2323
echo "Setting up TEST repo: ${test_repo}"
24-
sed -i -e "s#nvidia\.github\.io/libnvidia-container#${test_repo}/libnvidia-container#g" /etc/yum.repos.d/nvidia-docker.repo
24+
sed -i -e "s#nvidia\.github\.io/libnvidia-container#${test_repo}/libnvidia-container#g" /etc/yum.repos.d/nvidia-container-toolkit.repo
2525
yum-config-manager --enable libnvidia-container-experimental
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
ARG BASEIMAGE=fedora:35
2+
FROM ${BASEIMAGE}
3+
4+
RUN yum install -y \
5+
yum-utils \
6+
ruby-devel \
7+
gcc \
8+
make \
9+
rpm-build \
10+
rubygems \
11+
createrepo
12+
13+
RUN gem install --no-document fpm
14+
15+
# We create and install a dummy docker package since these dependencies are out of
16+
# scope for the tests performed here.
17+
RUN fpm -s empty \
18+
-t rpm \
19+
--description "A dummy package for docker-ce_18.06.3.ce-3.el7" \
20+
-n docker-ce --version 18.06.3.ce-3.el7 \
21+
-p /tmp/docker.rpm \
22+
&& \
23+
yum localinstall -y /tmp/docker.rpm \
24+
&& \
25+
rm -f /tmp/docker.rpm
26+
27+
28+
RUN curl -s -L https://nvidia.github.io/libnvidia-container/fedora35/nvidia-container-toolkit.repo \
29+
| tee /etc/yum.repos.d/nvidia-container-toolkit.repo
30+
31+
COPY entrypoint.sh /
32+
COPY install_repo.sh /
33+
34+
ENTRYPOINT [ "/entrypoint.sh" ]
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# This script is used to build the packages for the components of the NVIDIA
18+
# Container Stack. These include the nvidia-container-toolkit in this repository
19+
# as well as the components included in the third_party folder.
20+
# All required packages are generated in the specified dist folder.
21+
22+
: ${LOCAL_REPO_DIRECTORY:=/local-repository}
23+
if [[ -d ${LOCAL_REPO_DIRECTORY} ]]; then
24+
echo "Setting up local-repository"
25+
createrepo /local-repository
26+
27+
cat >/etc/yum.repos.d/local.repo <<EOL
28+
[local-repository]
29+
name=NVIDIA Container Toolkit Local Packages
30+
baseurl=file:///local-repository
31+
enabled=0
32+
gpgcheck=0
33+
protect=1
34+
EOL
35+
yum-config-manager --enable local-repository
36+
elif [[ -n ${TEST_REPO} ]]; then
37+
./install_repo.sh ${TEST_REPO}
38+
else
39+
echo "Skipping repo setup"
40+
fi
41+
42+
exec bash $@
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# This script is used to build the packages for the components of the NVIDIA
18+
# Container Stack. These include the nvidia-container-toolkit in this repository
19+
# as well as the components included in the third_party folder.
20+
# All required packages are generated in the specified dist folder.
21+
22+
test_repo=$1
23+
echo "Setting up TEST repo: ${test_repo}"
24+
sed -i -e "s#nvidia\.github\.io/libnvidia-container#${test_repo}/libnvidia-container#g" /etc/yum.repos.d/nvidia-container-toolkit.repo
25+
yum-config-manager --enable libnvidia-container-experimental

0 commit comments

Comments
 (0)