NVIDIA / nvidia-container-toolkit

Build and run containers leveraging NVIDIA GPUs
Apache License 2.0
2.5k stars 270 forks source link

DEB822-STYLE format for Ubuntu 24.04+ apt repository instructions (.sources) #774

Open berglh opened 2 weeks ago

berglh commented 2 weeks ago

Ubuntu from 24.04 is now migrating to defaulting to the use of DEB822-STYLE sources.list.d format files, in particularly when you use add-apt-repository. There should be instructions of creating a /etc/apt/sources.list.d/nvidia-container-toolkit.sources file in the https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html website.

My current sources file looks like below, but it's also possible to embed the GPG key into the file as well, the key needs to be indented by one space below Signed-By.

Enabled: yes
Types: deb
URIs: https://nvidia.github.io/libnvidia-container/
Suites: stable
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/nvidia-container-toolkit-keyring.gpg

Or

Enabled: yes
Types: deb
URIs: https://nvidia.github.io/libnvidia-container/
Suites: stable
Components: main
Architectures: amd64
Signed-By: -----BEGIN PGP PUBLIC KEY BLOCK-----
 .
 ${ GPG KEY CONTENTS }
 -----END PGP PUBLIC KEY BLOCK-----

My source file looks like the above, however, I am receiving an error Error: The repository 'https://nvidia.github.io/libnvidia-container stable Release' does not have a Release file.. I'm currently on Ubuntu 24.10, but this method was previously working for me on Ubuntu 24.04. Either way, having some instructions for the new source file format would be beneficial. I'll see in the meantime if I can resolve my error.

berglh commented 2 weeks ago

I got this working with Ubuntu 24.10, but with a warning against the InRelease file.

Warning: Conflicting distribution: https://nvidia.github.io/libnvidia-container stable/deb/amd64/ InRelease (expected stable/deb/amd64/ but got stable)

The InRelease file looks like this:

Hash: SHA512

Architectures: amd64
Codename: stable
Components: main
Date: Fri, 27 Apr 2018 21:29:25 +0000
Description: NVIDIA container runtime library repository
Label: NVIDIA CORPORATION <cudatools@nvidia.com>
Origin: https://nvidia.github.io/libnvidia-container/stable
Version: 1.0

My guess is that the path provided using the fields below would match as opposed to the URI path in Suites, however, it expects the InRelease file in the stable directory I think and fails to discover the file if configured in this way. I got around this by specifying the full path in Suites and omitting Components and Architecture. A simple solution might be to update the InRelease file to change the Codename to "stable/deb/amd64/" but I'm unsure how this would impact legacy .list configurations.

Suites: stable
Components: deb
Architecture: $(ARCH)

Either of these are working for me:

Enabled: yes
Types: deb
URIs: https://nvidia.github.io/libnvidia-container
Suites: stable/deb/$(ARCH)/
Signed-By: /etc/apt/keyrings/nvidia-container-toolkit-keyring.gpg

Or, with the GPG key embeded in the .sources file.

Enabled: yes
Types: deb
URIs: https://nvidia.github.io/libnvidia-container
Suites: stable/deb/$(ARCH)/
Signed-By: -----BEGIN PGP PUBLIC KEY BLOCK-----
 .
 mQINBFnNWDEBEACiX68rxIWvqH3h2GykO25oK9BAqV8fDtb6lXEbw3eKx4g87BRz
 M3DQBA0S0IfkQ72ovJ33H50+gVTXuu+Zme5muWk72m3pApccZVDLqdzYlpWPruNb
 MC+IlWr70yo8Jw8Zr1ihbWjFvMbDJTkgqPt2djNq3xxvdiKoZlgnpLRKIpSu9iBQ
 lNoZLHxTQKFH4219L77prRogv2QV1ckBL5lDVOERJuHo4jHE8mm9/NZ6v3m2HGuu
 AEZ7T9nWlPGiAIP8Pww4ZRTJcBANcI2EFKPLdfP61HTH6w0kVMkoAaGlemadTDl3
 ZcLpUpTFLc+ko/2uQ1qVPx9QYyoMrorS3kUmlXrhsA7FvcB09aIcb+JX6SVkcbO5
 A5+baCa3owwUtFBXMHM5hqpLv4P3/GsuW6283YwLZCf53dJY4lJZePqzPGsvs/wS
 vhnZrFvb61i/Aqm0hjhVh7h6VNxUiE8geMcjxy29LtzajoyS0EPVxes4xZu0VbS7
 8LQyCNHSpS7TFmtVUQmbXqDN7cpiyr9+yutr0lZOMc7NYQt0nP/3RtYkWEob6wXa
 rVImHas1OYzlZymdO1uAnqkediS61E2vSD1OEq37/375FB/Q3AYXuNkQzDjYoJJz
 9wsv7Xp0bdPzQ/daLdIFNQXo5MmVIirsWM07JvbZaJhDOiJxGn0MPf11/QARAQAB
 tEBOVklESUEgQ09SUE9S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iXg3TcLZRpv30DQzxoUrx9Ff//rXLFznh+MksuvVD2roUR
 BGz/en31FxAcBoex9nNraeOekbFen5b7Xrq9wnzM5xZvJN2QYB3vS0khz/ZgFyy5
 444ALa9gwb29FZCfA4m59S2QoB8uPQGM+8gnusE6J8y4fvI59ugafidIkt86dZ3m
 FsEME5XNmBGdNEo2flRVFfpG1IWds2Ba3IsdbYd9nzmbBW7/n0InVRDrIg==
 =9QWY
 -----END PGP PUBLIC KEY BLOCK-----

Then I can see the list of packages:

$ sudo apt policy nvidia-container-toolkit
nvidia-container-toolkit:
  Installed: (none)
  Candidate: 1.17.0-1
  Version table:
     1.17.0-1 500
        500 https://nvidia.github.io/libnvidia-container stable/deb/amd64/ Packages
     1.16.2-1 500
        500 https://nvidia.github.io/libnvidia-container stable/deb/amd64/ Packages
     1.16.1-1 500
        500 https://nvidia.github.io/libnvidia-container stable/deb/amd64/ Packages
     1.16.0-1 500
        500 https://nvidia.github.io/libnvidia-container stable/deb/amd64/ Packages
     1.15.0-1 500
        500 https://nvidia.github.io/libnvidia-container stable/deb/amd64/ Packages
     1.14.6-1 500
        500 https://nvidia.github.io/libnvidia-container stable/deb/amd64/ Packages
     1.14.5-1 500
        500 https://nvidia.github.io/libnvidia-container stable/deb/amd64/ Packages
     1.14.4-1 500
        500 https://nvidia.github.io/libnvidia-container stable/deb/amd64/ Packages
     1.14.3-1 500
        500 https://nvidia.github.io/libnvidia-container stable/deb/amd64/ Packages
     1.14.2-1 500
        500 https://nvidia.github.io/libnvidia-container stable/deb/amd64/ Packages
     1.14.1-1 500
        500 https://nvidia.github.io/libnvidia-container stable/deb/amd64/ Packages
     1.14.0-1 500
        500 https://nvidia.github.io/libnvidia-container stable/deb/amd64/ Packages