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

Add apt2aptly, parallel package uploads #9

Merged
merged 13 commits into from
Aug 4, 2023

Conversation

refi64
Copy link
Collaborator

@refi64 refi64 commented Jul 11, 2023

No description provided.

apt2aptly/src/lib.rs Outdated Show resolved Hide resolved
This adds new tool, apt2aptly, to mirror an existing apt repository in
aptly. To reuse obs2aptly's core logic, that was pulled out into a
shared crate, sync2aptly.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
On full runs, this can drastically reduce the runtime (which also makes
testing significatly easier).

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
This requires refactoring in sync2aptly to generalize the location of
files, as well as backoff integration to retry on download / upload
failure.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
This is how our actual layout on OBS is, so it needs to be matched here.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
obs2aptly keeps its version computations, because sync2aptly is generic
over URLs and files, which makes moving it harder, and other origin
sources like apt2aptly can more easily obtain the versions anyway.
Unfortunately, the version can't just be pre-computed while gathering
the origin content; because that would result in a rather large amount
of version lookups in contexts where we currently don't need to. To
work around this, the version—and the function used to compute it—are
stored in a OnceCell + Box<dyn Fn> pair. *Technically* the caching isn't
entirely needed, but while reworking all of this code anyway, might as
well also avoid the reduntant version parsing.

Additionally, analyzing arch-independent packages switches from using
(source package, source version) pairs to (source package, package
version) pairs. This should have the equivalent effect of deduplicating
the packages for each architecture without relying on the source
version, which is hard to obtain from apt2aptly.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
--apt-snapshot has been replaced with --apt-snapshots, which will point
to a file containing one snapshot to process per line. Already-existing
snapshots will now result in skipping the entire scan process, which
required some refactoring to get out a component list without also
doing a full scan.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
This cleans up the code a bit and improves the parallel structure.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
It's a bit clearer as to the actual purpose of the code.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
This adds a new option, --publish-to, to publish to the given prefix,
as well as additional options to control signing and re-publishing
snapshots.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
sjoerdsimons
sjoerdsimons previously approved these changes Aug 1, 2023
Copy link
Contributor

@sjoerdsimons sjoerdsimons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@refi64 I'll leave it to you what to do with the lazyversion bits; I'm fine with keeping it for now and potentially change it later. So approving the changes overall

This is useful because the tool already knows the repo names to use.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
aptly sorts the filenames before hashing them, but the .dsc files coming
from reprepro often aren't sorted.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
We already do this in the normal OBS integration for performance
reasons.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
@sjoerdsimons sjoerdsimons added this pull request to the merge queue Aug 4, 2023
Merged via the queue into collabora:main with commit 1a510ba Aug 4, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants