Skip to content

Commit d8ba84d

Browse files
committed
Add release tests for fedora35
Signed-off-by: Evan Lezar <[email protected]>
1 parent 8e8c41a commit d8ba84d

File tree

4 files changed

+103
-2
lines changed

4 files changed

+103
-2
lines changed

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

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)