-
Notifications
You must be signed in to change notification settings - Fork 52
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
Investigate Copr as the build system #1795
Comments
After some refreshing of Copr knowledge, digging into current availability, I have put together an initial draft of what our usage of Copr would look like. As acknowledged, there are some open questions around how we configure it, and tooling choices. In order to migrate to Copr, the biggest initial undertaking would be to get the tooling in place. Our previous Copr tooling relied on tito and that would need to be re-vamped. Copr Usage DesignCopr provides the idea of a project that represents one or more repositories which are defined by the chroots (e.g. RHEL, Centos stream) included in the project. The Foreman project would use Copr as a build system and locationg for staging repositories that are tested before being pulled to yum.theforeman.org. Managing ConfigurationIn order to manage the configuration, this can be stored within the foreman-packaging repository RepositoriesNightly Server
Client
ModulesCopr can generate modulemd during repository generation based upon configuration through Copr or by uploading an existing module metadata. This will allow continuity of current modules. Branching
Scratch BuildsCopr does not have the notion of scratch builds as Koji does, instead a new project that is a copy of the primary project must be created. The process, using foreman-nightly example:
There would be a single scratch build repo per pull request, thus all RPM builds in a PR would end up in the same temporary project. Repoclosure would be run against the split project, in theory giving a better repoclosure result. Benefits from what we have today:
ToolingCopr provides a few interfaces: The python-copr library would allow easy integration and building of modules into Obal to support our current workflows through the same interface. CompsComps can be uploaded to the project configuration and are scoped per chroot. This would mean any updates to comps will need to be identified and uploaded to update the chroot after merge. Open Questions
|
One thing that come up somewhere else: Today we have a very crude way to build the foreman-discovery-image and don't ship it as an RPM upstream. Downstream does ship it as an RPM, but builds stuff differently (using koji/brew) and we see a variety of problems due to the differences. This by no means should mean we shouldn't use Copr, just that we should also go and unify fdi builds, and it won't be on the current downstream solution if we use Copr. |
And to answer your open question: I think I prefer a layout as close to the current repo layout as possible, so no dedicated per OS projects. As you say, target chroots can be configured if needed and otherwise I think it's a fair thing to say that if one OS fails, the build as such is faulty. If you're cautious about bootstrapping net-new OSes (like EL9), I think this can be either done in a separate bootstrap project and then copied over or by using the config to limit chroots more granularly. |
Last infra-sig you asked for explicit YAY/NAY on the design. I'd have one question: the client repo currently has no nighty/release differentiation, which matches what we have downstream, but not upstream (right now). I'd be happy to change that, but also don't think that's something we should piggy-back on the copr change? Overall I'm "YAY" tho :) |
I'm mentally going through the tasks that need to be done. First of all: I think we said we want to maintain our That also implies we consider COPR as staging repositories. How do we make it clear for users that they're not intended as real repositories? Do we include Speaking of naming: should we use the chance to rename Katello to use the Foreman version numbering? So That brings us to branching. We'll need to replace the tooling we have to branch and update the procedure. Given we just branched, I do think it's the best time since I'd rather not do it under time pressure. One implication is that (at least for Foreman) https://github.com/theforeman/tool_belt becomes obsolete, which I think is a good thing. During releasing we also sign RPMs with GPG, which relies on Koji. How do we replace this? This is not a YAY/NAY on the design: I think it's incomplete and needs a bit of refinement.
My vote would be |
Sounds like a good approach.
I'll work on tracking down this answer.
+1
I am asking about this one. |
The answer to this is that Copr can generate a key and sign packages with but does not have the ability to allow a key generated outside Copr to be used to sign. We can request this as a feature and see where we get. Generally, this seems like it should work for us, except for the fact that we also sign the tarballs. |
Technically I think we can maintain our current process where we sign manually for a release. That they're signed with another key in copr isn't really a problem. Perhaps then the question becomes what we want to signal to users with it. If you say that it's about integrity and we've verified the bits then I'm not sure how true that really is. And for Debian we sign automatically. Would the same be good enough for RPMs? |
To close this issue out, we'll establish the next steps here, open follow on issues and close this investigation. |
Making a note of a something we will have to handle:
|
@evgeni @ekohl Could y'all read over fedora-copr/copr#2782 and let me know your thoughts on the tradeoffs of the work the Copr team would have to do just for us versus us implementing the necessary steps ourselves until we get off EL8? |
Here is a proposal for how we handle modularity with Copr given modularity is deprecated and asking the Copr team to address this is a lot of work (see: fedora-copr/copr#2782). Process proposal:
This proposal will require us to create a new vhost and ensure we have enough storage on web02 to support the stage repositories. Alternatively, we could continue to use |
I think a new name makes a lot of sense. More than trying to shoe horn it into Koji.
I think we should look at consistency with debs, so deriving from
AFAIK this is something we don't have on Koji now, but do have such a script on the real repos. Having those match would be a good thing for testing quality.
Keeping old releases on Koji it doesn't matter much since they're hard links and we need to keep them anyway, but on web02 they'll have costs. I think we can also adopt cleaning of it. For example, we remove repos for old (unsupported) releases. May need to consider n-2 testing support, though I'd prefer to have the n-2 and n-1 consume the release repos. Overall 👍 for the plan. |
Sorry for the delay, with copr team providing the chroot, that means that we don't have control over the buildroot? I'm trying to find the best design for our necessary packages for python, specially the effort to enable PEP-517 on EL8, my plan was to later create on branch or one project with all the spec files necessary to build the buildroot. |
It depends on what control you have in mind. Copr allows you to specify what packages and modules should be installed in the buildroot and what repositories should be enabled. |
Just for the record, those are already available in Copr. |
@Odilhao Here is the working example of the configuration for Foreman: https://github.com/theforeman/foreman-packaging/pull/9290/files Initially, I have provided support for defining builldroot packages, modules and external repos in Obal: https://github.com/theforeman/obal/blob/master/obal/data/roles/copr_project/tasks/main.yaml#L18C14-L20 |
@FrostyX So we know in the future, are the buildroots based off of latest or |
When I do this on our builders:
it says
Update: You can see the mock config and what repositories are used here: |
Follow up to the staging repository, we will need to decide where the work happens based on storage and parallelization concerns. I've outlined this in the PR that adds the script to do the generation for feedback: |
Let's talk about RPM signing with Copr. At this point we have a workflow that looks like: Copy repository from Copr -> Add modularity -> Copy repository to stagingyum.theforeman.org -> Test We have three options for packaging signing:
|
We have One thing to keep in mind is that copr may have one GPG key per repo. So katello might be different from foreman and yet different from plugins then client is yet another key. That would argue for option 2 from an end user perspective.
This feels error prone. Because if you have:
Then the next time you sync in new files from copr, you will overwrite the already signed files with copr signed files. Today koji takes care of that for us and I'm not sure how I'd rewrite the logic.
I'm not sure I like this approach, because in my mind GPG signing is a fixed point where you "bless" the files that they went through the proper channels. If it's automated, there's no guarantee at all anymore and supply chain attacks may be easier. On the other hand, you could argue that today we barely inspect the RPM files either. Overall I'm still torn. I was slightly leaning to option 1, but having multiple GPG keys for a single release is tedious. We'll need to expand our process to publish them so users can securely sync them (to systems like Pulp). Perhaps the copr team can say if it's technically possible to use a key between multiple repositories. |
@FrostyX what do you think? Any related experiences you have seen for Copr users? |
From some initial testing, it does not appear that comps support in Copr does what we expect of comps in our traditional method so I've reached out to ask if there is a bug here or a native way to exclude packages. This may be another case where we need to handle this filtering during stage repository creation similar to modularity. Tracking issue for Copr -- fedora-copr/copr#2901 |
For the time being I have proposed doing the comps filtering in our stage generation script -- theforeman/theforeman-rel-eng#275 Another OptionBy splitting out repositories based on comps during stage generation, this does open up the possibility to have a single build repository that is then split out into end-user repositories. This would solve the single GPG key issue as well since all packages would build into a single repository signed by a single Copr GPG key. Proposal for using our own keyIf we stick with our own key, I'd propose the following workflow for releases process: Stage 1 Stage 2 |
Hello @ehelm, One of the discussed options was uploading someone's GPG keys to be used for their Copr namespace. We don't want this - I can elaborate if necessary. The other option was to have a checkbox in user/group settings that would make all projects in that namespace use the same GPG key (which would be generated the same way other Copr GPG keys are but it would be assigned to the user/group namespace instead of a project). We can implement this feature if it is a hard requirement for you but it will probably take some time. Tagging @xsuchy and @praiskup in case they want to add something. |
Nah, we understand this one, managing the security of this would be painful at best.
I think for our use case this would be too broad. I would think of it having to be more like:
I would equate this to creating tokens in Github where I can assign different permissions to different tokens and manage them. We are a bigger, possibly more unique in this respect project so I understand not undertaking implementing all of this if you do not have other stakeholders asking for this. |
After some further thought, I am leaning towards this workflow. For Releases
For Nightly
|
I also thought about this and it does make sense, but we don't want to overwrite files which were already signed. I wonder how we prevent that. Practical use case: when we release Foreman 3.9.0-rc2, how do we prevent rewriting all the packages which were already signed when we released RC1? With koji we have download_rpms where we list all tagged packages, including their sigs and any packages not signed with the correct key is downloaded. Can we download the production repo metadata, list all RPMs and then do the same for the staging repo. All files on staging that aren't in production should be downloaded and signed. Is that feasible? |
An example using repodiff to identify only changed packages:
|
That looks hard to parse and you would need to glob to get exact paths, but it is generally the idea that would work. |
How would we handle this? Right now only the |
This feature would be relatively expensive for implementation, and the question is whether it is worth it.
This is an interesting idea.
Seems like you propose GPG signatures outside of Copr, while the building stays in Copr. Correct? |
One question, do we have any quota/limit rate while building on copr? I'm building one projectwith 100+ packages, I'm releasing locally to control the build order, looks like one build got stuck and never started, it's on the same status for 4 hours and counting. |
https://github.com/orgs/theforeman/projects/6 lists various tasks. |
Two things i am noticing that I don't have a clear understanding of:
|
This is the build system now! This is active for nightly and 3.9, so I will close this issue. |
No idea why, but I've read "This is the build system now!" in @zjhuntin's voice. |
Open questions:
The text was updated successfully, but these errors were encountered: