|
| 1 | +# NVIDIA Container Toolkit Release Tooling |
| 2 | + |
| 3 | +This repository allows for the components of the NVIDIA container stack to be |
| 4 | +built and released as the NVIDIA Container Toolkit from a single repository. The components: |
| 5 | +* `libnvidia-container` |
| 6 | +* `nvidia-container-runtime` |
| 7 | +* `nvidia-docker` |
| 8 | +are included as submodules in the `third_party` folder. |
| 9 | + |
| 10 | +The `nvidia-container-toolkit` resides in this repo directly. |
| 11 | + |
| 12 | +## Building |
| 13 | + |
| 14 | +In oder to build the packages, the following command is executed |
| 15 | +```sh |
| 16 | +./scripts/build-all-components.sh TARGET |
| 17 | +``` |
| 18 | +where `TARGET` is a make target that is valid for each of the sub-components. |
| 19 | + |
| 20 | +These include: |
| 21 | +* `ubuntu18.04-amd64` |
| 22 | +* `docker-all` |
| 23 | +with the later generating for all supported distribution and platform combinations. |
| 24 | + |
| 25 | +The packages are generated in the `dist` folder. |
| 26 | + |
| 27 | +## Testing local changes |
| 28 | + |
| 29 | +In oder to use the same build logic to be used to generate packages with local changes, |
| 30 | +the location of the individual components can be overridded using the: `LIBNVIDIA_CONTAINER_ROOT`, |
| 31 | +`NVIDIA_CONTAINER_TOOLKIT_ROOT`, `NVIDIA_CONTAINER_RUNTIME_ROOT`, and `NVIDIA_DOCKER_ROOT` |
| 32 | +environment variables. |
| 33 | + |
| 34 | +## Testing packages locally |
| 35 | + |
| 36 | +### Ubuntu |
| 37 | + |
| 38 | +Launch a docker container: |
| 39 | + |
| 40 | +``` |
| 41 | +docker run --rm -it \ |
| 42 | + -v $(pwd):/work \ |
| 43 | + -v $(pwd)/dist/ubuntu18.04/amd64:/local-repository \ |
| 44 | + -w /work \ |
| 45 | + ubuntu:18.04 |
| 46 | +``` |
| 47 | + |
| 48 | + |
| 49 | +``` |
| 50 | +apt-get update && apt-get install -y apt-utils |
| 51 | +``` |
| 52 | + |
| 53 | +``` |
| 54 | +echo "deb [trusted=yes] file:/local-repository/ ./" > /etc/apt/sources.list.d/local.list |
| 55 | +``` |
| 56 | + |
| 57 | +``` |
| 58 | +cd /local-repository && apt-ftparchive packages . > Packages |
| 59 | +``` |
| 60 | + |
| 61 | +``` |
| 62 | +apt-get update |
| 63 | +``` |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | +### Centos |
| 68 | + |
| 69 | +``` |
| 70 | +docker run --rm -it \ |
| 71 | + -v $(pwd):/work \ |
| 72 | + -v $(pwd)/dist/centos8/x86_64:/local-repository \ |
| 73 | + -w /work \ |
| 74 | + centos:8 |
| 75 | +``` |
| 76 | + |
| 77 | +``` |
| 78 | +yum install -y createrepo |
| 79 | +``` |
| 80 | + |
| 81 | +``` |
| 82 | +createrepo /local-repository |
| 83 | +``` |
| 84 | + |
| 85 | +``` |
| 86 | +cat >/etc/yum.repos.d/local.repo <<EOL |
| 87 | +[local] |
| 88 | +name=NVIDIA Container Toolkit Local Packages |
| 89 | +baseurl=file:///local-repository |
| 90 | +enabled=1 |
| 91 | +gpgcheck=0 |
| 92 | +protect=1 |
| 93 | +EOL |
| 94 | +``` |
0 commit comments