-
Notifications
You must be signed in to change notification settings - Fork 17
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 build reverse dependencies research #212
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
title: Build reverse dependencies in Packit | ||
authors: mmassari | ||
--- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Second part of the general comment about the supported project structures. Where are the packages to be rebuilt
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think there is a need for changing the project structure but I am not sure I am following you. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, this is for pre-release/pre-packaging. Referencing a git-repo under packit would be sufficient for that.
The main supported upstream model here sould be to build in copr with dist-git source (probably from
I was thinking of the structure of monorepo, just because it would be more natural to navigate a dependency tree and it would share much of the scheduling logic that is needed for monorepo dependencies. Indeed an alternative would be to have it in Jobs, but I'm afraid complex dependencies would become harder to manage. These would be another upstream model for when some dependencies are not yet packaged. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (self-promotion) I was starting to implement this as a tmt-plugin (tmt-copr and also tmt-koji, but need to finish 1 first :D)
This can solve some of the issues of "Build our own solution", especially w.r.t. viewing the results |
||
|
||
Already existing solutions: | ||
|
||
- [Koschei service](https://github.com/fedora-infra/koschei) | ||
- [Mass Prebuild CLI](https://gitlab.com/fedora/packager-tools/mass-prebuild) | ||
- [mini mass rebuild](https://github.com/hroncok/mini-mass-rebuild) | ||
- [copr-autorebuilder](https://pagure.io/copr-autorebuilder/tree/master) | ||
- [copr-rebuild-tools](https://github.com/fedora-copr/copr-rebuild-tools/tree/main) | ||
Comment on lines
+10
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume these would probably not be a good fit since they are not included, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, they are mass rebuild tools not focused on reverse dependencies. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. makes sense, thanks! |
||
|
||
The first two in the above list are specifically designed for resolving reverse dependencies and this research will focus on them. | ||
|
||
## Koschei | ||
|
||
[Koschei](https://apps.fedoraproject.org/koschei) is a **continuous integration service** for RPM packages that tracks package dependency changes in Fedora Rawhide and rebuilds packages whose dependencies change too much. | ||
|
||
**Koschei depends on Koji**. New Koji builds "trigger" Koschei and Koschei rebuilds reverse dependencies as Koji scratch builds. | ||
**Koji scratch builds do not trigger Koshei** at the moment. | ||
This means that Koschei can be used as a CI service only after a _downstream release synchronization_ but **our users would like to check changes before making a downstream release synchronization.** | ||
|
||
If we want to use Koshei as an upstream CI service (or even downstream but without the need of a downstream release synchronization) we need to **make it react to scratch builds**. | ||
|
||
The Koschei project is not much lively, at least upstream; different reported issues are not being answered or worked on. For this reason I fear integrating new features in the Koschei production service could take a long time. | ||
|
||
If we want to use Koschei we could also think about **fork the project** and create our own instance inside the Packit cluster. This approach could give us two advantages: | ||
|
||
- Shorter time to production and our changes can always be taken back by the original project at some point. | ||
- We can re-enable COPR as a backend for Koschei builds. Accordingly to [this thread](https://pagure.io/fedora-ci/general/issue/45) Koschei has had a COPR backend for a while, but it has been removed (because COPR is a third party service not supported by the Fedora Infrastructure). Enabling COPR as a backend will allow the service to work even for those upstream projects which are not completely integrated in Fedora (if needed). | ||
|
||
What are the **PROs** I see in re-using Koshei: | ||
|
||
- We could benefit from an already well known somehow "standardized" user interface (the Koschei frontend). | ||
- We shouldn't need to be able to calculate reverse dependencies in Packit and submit builds from Packit if we will reuse (the Koschei backend). | ||
|
||
What are the **CONs** I see in re-using Koshei: | ||
|
||
- As far as I can understand it, the guy who wrote Koshei does not work anymore in Red Hat. We can not ask him for any help dealing with the Koschei code. | ||
- We could face unknown problems. | ||
|
||
## Mass Prebuild | ||
|
||
This is a CLI tool that resolves reverse dependencies and rebuild them all. It can work with both Koji and COPR. | ||
Even if it is a CLI tool we can not easily integrate it in packit-service because of two main design choices: | ||
|
||
- the tool interacts with a database | ||
- the tool keeps a session and can interact with the user | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so there is no way of disabling this interactive mode? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, you can decide to submit one step at time, specifying which step you want, but still the code is highly coupled with the "entire session idea" and the database. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. understood 👍 |
||
|
||
The above design choices make the command line tool and also the code behind it not reusable as it is. | ||
|
||
## Build our own solution | ||
|
||
We will need: | ||
|
||
1. a way to resolve reverse dependencies | ||
|
||
- we can follow the [Koschei way](https://github.com/fedora-infra/koschei/blob/master/koschei/backend/depsolve.py) which uses `hawkey` from `libdnf` | ||
- or we can follow the [Mass prebuild way](https://gitlab.com/fedora/packager-tools/mass-prebuild/-/blob/main/mass_prebuild/utils/whatrequires.py?ref_type=heads): given a package or a set of packages, namely "main packages", the mass pre-builder will calculate the list of its direct reverse dependencies: packages that explicitly mark one of the main packages in their "BuildRequires" field. As far as I can understand it, this is a **less deep** and thus **less complete** approach compared with the Koschei solution. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related to option 2 here. I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I will give it a look. |
||
- we can **avoid calculating dependencies** and let the user specify them in a static way. | ||
|
||
2. a way to schedule builds in Koji or COPR (or both). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This point 2 is needed more generally, e.g. for monorepo |
||
|
||
We are quite good at submitting builds in both services but we are not good at dealing with dependencies. | ||
|
||
- **if we don't need to interact with the rebuild process** we can depend upon: | ||
|
||
- the [COPR build batches](https://docs.pagure.org/copr.copr/user_documentation.html#build-batches) feature that allows you to define the order of your builds in advance. | ||
|
||
``` | ||
$ copr build <project> --no-wait <first.src.rpm> | ||
Created builds: 101010 | ||
$ copr build <project> --no-wait <second.src.rpm> --after-build-id 101010 | ||
Created builds: 101020 | ||
$ copr build <project> --no-wait <third.src.rpm> --with-build-id 101020 | ||
Created builds: 101030 | ||
``` | ||
|
||
- or/and the [Koji chained builds](https://docs.fedoraproject.org/en-US/package-maintainers/Using_the_Koji_Build_System/#chained_builds) | ||
|
||
``` | ||
fedpkg chain-build --target=side-tag-name libwidget libaselib : libgizmo : | ||
``` | ||
|
||
- but we should be aware that **the mass prebuild tool is designed in a way that lets you interact with every single step of the long rebuild process**. I don't know exactly why, but if I got it correctly, this process is error prone and the user may like to be able to continue it from a point of failure or may like to resubmit a failed build. I think it is worth discussing with the mass pre build developer why he has chosen to go this way. | ||
|
||
If we want the user to be able to interact with every step in this long process we should probably be capable of dealing with **job dependencies**. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hope the more straightforward way, i.e. using batch builds/ chain builds without the need to solve the dependencies ourselves will be enough. We should probably get feedback from the potential users for this so that we can decide. |
||
|
||
3. Besides a quick check status in the PR we should need also a new (dashboard) view with the summary status of all the reverse dependencies builds (probably something like our actual pipeline view). | ||
|
||
**PROs**: | ||
|
||
- If we don't need to deal with **job dependencies** probably this is the solution with **less unknowns**. More easily planned. | ||
|
||
**CONs**: | ||
|
||
- Both designing a good dashboard view and dealing with job dependencies could be not that easy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General comment, what are the project structures that would support such reverse dependencies. Firstly w.r.t. where the builds will live
additional_repos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not decided yet. However I think it probably will be a new copr project created by Packit (if we will go in the way of using COPR) or a Koji
side-tag
and in this case, you are right, it could not be for all upstream projects.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re: side-tag, that's for the case of making the reverse dependency build a production workflow right? Can scratch builds also have side-tag or equivalent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If for production workflow you mean you need to have your commit released in dist-git. This is already supported in Koshei. We are looking for a way to have the workflow triggered before a new release in dist-git.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking w.r.t. the end result. Will it eventually be used in a bodhi update, or will it be used only for testing dependencies. The former might be needed only sporadically, like for SOVERSION bump, etc. but the latter could be used more freely. Also the former could be covered by the dist-git label workflow