Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-filter-with-deps flag isn't including dependencies #1385

Closed
otherjason opened this issue Oct 28, 2024 · 5 comments · Fixed by #1388
Closed

-filter-with-deps flag isn't including dependencies #1385

otherjason opened this issue Oct 28, 2024 · 5 comments · Fixed by #1388
Assignees
Labels

Comments

@otherjason
Copy link

Detailed Description

I am trying to create a mirror from a portion of the repository found at https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/. This repo contains many releases of NVIDIA's CUDA toolkit, which are large in size. I'm trying to create a mirror of just the latest release.

There is a single package, cuda-12-6, that can be used as a top-level installation target; it depends on the other packages in the repo that actually contain the functionality. The output of dpkg -I for this package is:

$ dpkg -I cuda-12-6_12.6.2-1_amd64.deb
 new Debian package, version 2.0.
 size 2522 bytes: control archive=584 bytes.
     492 bytes,    12 lines      control              
      78 bytes,     1 lines      md5sums              
 Package: cuda-12-6
 Version: 12.6.2-1
 Architecture: amd64
 Maintainer: cudatools <[email protected]>
 Installed-Size: 7
 Depends: cuda-runtime-12-6 (>= 12.6.2), cuda-toolkit-12-6 (>= 12.6.2), cuda-demo-suite-12-6 (>= 12.6.77)
 Section: multiverse/devel
 Priority: optional
 Description: CUDA 12.6 meta-package
  Meta-package containing all the available packages required for native CUDA
  development. Contains the toolkit, samples, driver and documentation. Locked
  at CUDA Toolkit version 12.6.

I tried to use this meta-package to create a mirror containing this package only and all of its dependencies. However, when I do so, aptly only downloads the meta-package and does not download the dependencies. Here's what I got:

$ aptly mirror create -filter "cuda-12-6 (= 12.6.2-1)" -filter-with-deps cuda-12.6.2-ubuntu-22.04 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /
Downloading: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64//InRelease
gpgv: Signature made Fri 25 Oct 2024 03:39:17 PM EDT
gpgv:                using RSA key A4B469963BF863CC
gpgv: Good signature from "cudatools <[email protected]>"

Mirror [cuda-12.6.2-ubuntu-22.04]: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ .// successfully added.
You can run 'aptly mirror update cuda-12.6.2-ubuntu-22.04' to download repository contents.
$ aptly mirror update cuda-12.6.2-ubuntu-22.04
Downloading: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64//InRelease
gpgv: Signature made Fri 25 Oct 2024 03:39:17 PM EDT
gpgv:                using RSA key A4B469963BF863CC
gpgv: Good signature from "cudatools <[email protected]>"
Downloading & parsing package files...
Downloading: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64//Packages.gz
Applying filter...
Packages filtered: 4615 -> 1.
Building download queue...
Download queue: 0 items (0 B)
^[[A
Mirror `cuda-12.6.2-ubuntu-22.04` has been successfully updated.

As you can see, the filter only passed the single package I specified and not its dependencies.

Context

This seems to be a bug in the handling of the -filter-with-deps flag.

Your Environment

I am using Ubuntu 22.04, with aptly installed from the nightly repo:

$ aptly version
aptly version: 1.6.0~alpha30+247+g9b62b4e4
@neolynx neolynx added the bug label Nov 1, 2024
@neolynx neolynx self-assigned this Nov 1, 2024
@neolynx
Copy link
Member

neolynx commented Nov 8, 2024

to reproduce:

gpg --no-default-keyring --keyring trustedkeys.gpg --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC

aptly mirror create -filter "cuda-12-6 (= 12.6.2-1)" -filter-with-deps cuda-12.6.2-ubuntu-22.04 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /

aptly mirror update cuda-12.6.2-ubuntu-22.04

@neolynx
Copy link
Member

neolynx commented Nov 8, 2024

aptly actually does not consider dependencies at all, bcs the Architectures for the mirror are not set, somehow. Even if the mirror is created with -architectures=amd4

$ aptly mirror show cuda-12.6.2-ubuntu-22.04 
Name: cuda-12.6.2-ubuntu-22.04
Archive Root URL: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/
Distribution: .//
Components: 
Architectures: 
Download Sources: no
Download .udebs: no
Filter: cuda-12-6 (= 12.6.2-1)
Filter With Deps: yes
Last update: 2024-11-08 11:02:52 UTC
Number of packages: 1

Information from release file:
Acquire-By-Hash: no
Architecture: x86_64
Date: Mon, 04 Nov 2024 16:02:23 +0000
Label: NVIDIA CUDA
Origin: NVIDIA

@neolynx
Copy link
Member

neolynx commented Nov 8, 2024

Here is the culprit: https://github.com/aptly-dev/aptly/blob/master/deb/remote.go#L108

as this is a 'flat' repo, the architectures are ignored even if -force-architectures is specified.

however, without architectures, there is no dependency filtering, as it loops over the architectures.

why would flat repos not have architectures ?

@neolynx
Copy link
Member

neolynx commented Nov 17, 2024

the fix has been merged to master, please try latest CI build !

@otherjason
Copy link
Author

That fixed it, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants