|
| 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 $@ |
0 commit comments