From bc937385927c9bb3dddfc009f843b78ba16a4e55 Mon Sep 17 00:00:00 2001 From: mkunin-nvidia Date: Wed, 16 Nov 2022 16:25:58 +0100 Subject: [PATCH] Airgap documentation update. Update mirror-apt-repos.md. Adding configuration files examples. Update mirror-docker-images.md. Update docker save and docker load commands. --- docs/airgap/mirror-apt-repos.md | 87 ++++++++++++++++++++++++++++- docs/airgap/mirror-docker-images.md | 12 +++- 2 files changed, 94 insertions(+), 5 deletions(-) diff --git a/docs/airgap/mirror-apt-repos.md b/docs/airgap/mirror-apt-repos.md index ba925252a..ccb10ec11 100644 --- a/docs/airgap/mirror-apt-repos.md +++ b/docs/airgap/mirror-apt-repos.md @@ -149,6 +149,13 @@ sudo apt update sudo apt install apt-mirror ``` +The package in the repository is not maintained anymore and has some issues. There are community supported forks. Get updated version of the `apt-mirror`: +``` +git clone https://github.com/Stifler6996/apt-mirror +cd apt-mirror +sudo cp -f apt-mirror /usr/bin/ +``` + After installing `apt-mirror`, edit the `/etc/apt/mirror.list` file make the following changes: - Set the `base_path` to the desired download path for your mirror (here, `/var/repos`) @@ -169,6 +176,57 @@ deb https://download.docker.com/linux/ubuntu bionic stable deb https://nvidia.github.io/nvidia-docker/ubuntu20.04/amd64 / ``` +The full mirror.list file for Deepops: + +``` +############# config ################## +# +set base_path /var/repos +# +# set mirror_path $base_path/mirror +# set skel_path $base_path/skel +# set var_path $base_path/var +# set cleanscript $var_path/clean.sh +# set defaultarch +# set postmirror_script $var_path/postmirror.sh +# set run_postmirror 0 +set nthreads 20 +set _tilde 0 +# +############# end config ############## + +deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse +deb http://archive.ubuntu.com/ubuntu focal-security main restricted universe multiverse +deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse +deb http://archive.ubuntu.com/ubuntu focal-proposed main restricted universe multiverse +deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse +deb http://ppa.launchpad.net/maas/2.9/ubuntu focal main +deb http://archive.canonical.com/ubuntu focal partner + +deb-src http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse +deb-src http://archive.ubuntu.com/ubuntu focal-security main restricted universe multiverse +deb-src http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse +deb-src http://archive.ubuntu.com/ubuntu focal-proposed main restricted universe multiverse +deb-src http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse + +deb https://download.docker.com/linux/ubuntu focal stable +deb https://nvidia.github.io/nvidia-docker/ubuntu20.04/amd64 / +deb https://nvidia.github.io/libnvidia-container/stable/ubuntu20.04/amd64 / +deb https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu20.04/amd64 / + +deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 / + +deb http://repo.download.nvidia.com/baseos/ubuntu/focal/x86_64/ focal common dgx +deb http://repo.download.nvidia.com/baseos/ubuntu/focal/x86_64/ focal-updates common dgx + +clean http://archive.ubuntu.com/ubuntu +clean https://download.docker.com +clean https://nvidia.github.io +clean https://developer.download.nvidia.com +clean http://repo.download.nvidia.com +clean http://ppa.launchpad.net +``` + Then create the target directory and run `apt-mirror`: ```bash @@ -217,7 +275,32 @@ sudo cp -r /var/repos/mirror/nvidia.github.com/nvidia-docker/ /var/www/html/repo At this point, the downloaded package repositories should be available on your offline network via the package server. You can then add these downloaded repos to the `/etc/apt/sources.list` configuration on the servers that need to install the packages, e.g.: + Line added to `/etc/apt/sources.list`: + +``` +deb http://repo-server/ubuntu focal main restricted universe multiverse +deb http://repo-server/ubuntu focal-updates main restricted universe multiverse +deb http://repo-server/ubuntu focal-backports main restricted universe multiverse +deb http://repo-server/ubuntu focal-security main restricted universe multiverse +``` + +Lines added to `/etc/apt/sources.list.d/dgx.list`: + +``` +deb http://repo-server/baseos/ubuntu/focal/x86_64/ focal common dgx +deb http://repo-server/baseos/ubuntu/focal/x86_64/ focal-updates common dgx +``` + +Lines added to `/etc/apt/sources.list.d/cuda-compute-repo.list`: + +``` +deb http://repo-server/cuda/repos/ubuntu2004/x86_64/ / +``` + +Lines add to `/etc/apt/sources.list.d/nvidia-docker.list`: + ``` -# Line added to /etc/apt/sources.list -deb http://repo-server/repos/nvidia-docker/ubuntu20.04/amd64 / +deb [trusted=yes] http://repo-server/libnvidia-container/stable/ubuntu20.04/amd64 / +deb [trusted=yes] http://repo-server/nvidia-container-runtime/stable/ubuntu20.04/amd64 / +deb [trusted=yes] http://repo-server/nvidia-docker/ubuntu20.04/amd64 / ``` diff --git a/docs/airgap/mirror-docker-images.md b/docs/airgap/mirror-docker-images.md index eefd33489..b65d29dcc 100644 --- a/docs/airgap/mirror-docker-images.md +++ b/docs/airgap/mirror-docker-images.md @@ -41,9 +41,10 @@ ansible-playbook playbooks/container/docker.yml Then, for each image you want to download, you should pull the image from the remote registry and save it to a local file. In this example, we're saving all our Docker images to `/tmp/images`: -```bash -docker pull nvidia/cuda:11.1-devel-ubuntu20.04 -docker save nvidia/cuda:11.1-devel-ubuntu20.04 > /tmp/images/nvidia-cuda-11.1-devel-ubuntu20.04.tar +``` +$ docker pull nvidia/cuda:11.1-devel-ubuntu20.04 +$ docker save -o /tmp/images/nvidia-cuda-11.1-devel-ubuntu20.04.tar nvidia/cuda:11.1-devel-ubuntu20.04 +>>>>>>> e1d0a775 (Airgap documentation update.) ``` Additionally, you should download and save the [`registry` image](https://hub.docker.com/_/registry) so that you can deploy a local registry on the offline network. @@ -75,8 +76,13 @@ Additionally, we assume that the `registry` image was included when you transfer Load the registry image into the Docker image cache of your container registry host: +<<<<<<< HEAD ```bash docker load < /tmp/images/registry-2.7.tar +======= +``` +$ docker load -i /tmp/images/registry-2.7.tar +>>>>>>> e1d0a775 (Airgap documentation update.) ``` Then create a Docker volume to store your container images: