Consider allowing draft builds for ELN #3621
Labels
No labels
Closed As
Accepted
Closed As
Duplicate
Closed As
Insufficient data
Closed As
Invalid
Closed As
Rejected
document it
fast track
meeting
next release
nonresponsive maintainer
packager revocation
pending announcement
provenpackager
python 2 exception
self contained change
stalled
system wide change
updates policy exception
vote-in-progress
No milestone
No project
No assignees
9 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
fesco/tickets#3621
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@kevin asked me to bring this to FESCo. I'm requesting that we allow the use of Draft Builds in the ELN rebuild process to help us handle situations where the ELNBuildSync (EBS) service crashes or the cluster it's running on otherwise terminates it while it's in the middle of batch processing. The technical details are in the Infrastructure ticket, but I'll reiterate what I'm asking for here:
eln-build).eln-buildsyncuser. (From testing I did today, this is already technically possible, but I'd prefer to have it also be sanctioned.)The purpose of this would be for EBS to perform its batches as draft builds into a side-tag. Once the batch is complete, we would promote the drafts to real builds and submit a side-tag to Bodhi as an erratum. If the batch is interrupted (crash, pod reboot, etc.) the draft builds would just be left behind to be garbage-collected in a reasonable timeframe.
Draft Builds are already available on the version of Koji in production, but the current policy is essentially "no draft build may be tagged anywhere", so they don't work for our needs, which is to have them tagged into a side-tag for the benefit of subsequent builds in that tag.
I can submit this as a Change Proposal if FESCo would prefer, but as it's very ELN-centric, I'm starting with just a FESCo ticket.
If needed, I wrote up an overview of how our builds are handled today.
Thanks for the writeup! This part from the Infra ticket concerns me a bit.
I worry that this will just put more strain on our build resources, which is already an ongoing issue, especially for certain architectures. If EBS crashes after building 999/1000 packages in a build batch, it would be ideal if it didn't just restart and build all those packages again. But if EBS crashes are very infrequent, maybe this is fine. How difficult would it be for EBS to properly store its state so it can resume building a batch after a crash?
Yes, the worst-case scenario is quite bad. In theory, we could crash just before submitting the Bodhi updates for a mass-rebuild and effectively need to re-run the entire batch. That would be painful.
However, looking at https://bodhi.fedoraproject.org/users/eln-buildsync it looks like the overwhelming majority of batches contain fewer than ten packages (with the exceptions being big side-tag merges and mass-rebuilds).
EBS has crashed twice in 2026 so far as I can recall. We've had a few outages for upgrades, but in those instances we pause processing so it doesn't start any new batches and wait for any in-progress ones to conclude before we shut things down.
(That's actually a secondary benefit here: if we needed to perform emergency maintenance on EBS, such as for a critical security flaw, this would also allow us to do that immediately without awaiting the conclusion of the current batch.)
It turns out to be extremely difficult. It's not impossible, but I strongly feel that it is not at all worth the effort to implement an exceptionally complex and possibly fragile resumption strategy to mitigate a problem that occurs infrequently.
Let's take the example of a batch and see the possible states that an affected package could be in.
(This description leaves out some places where we may also have to await repo regeneration, which adds more possible states.)
Also, ELN is offering to be a "canary in the coal mine" here with regards to draft builds: our use of them exercises some (but not all) of this feature in Fedora. If we want to explore more interesting uses of draft builds later on, such as merge request testing with draft builds promoted on merge, ELN will have already validated that basic functionality is working properly.
Okay, thanks for the additional context. I'm amenable to allowing draft builds for this (assuming that there's not something else I'm missing here and Infra/Releng is on board), but it would be nice to do something to prevent the worse case scenarios that would tax the buildsystem for everyone, particularly:
I understand that figuring out how to auto resume from various possible failure states is difficult, but is implementing some sort of NEVRs seen check that stops processing if a certain build or batch of builds has crashed multiple times or a previously seen batch that crashed is very large more feasible?
FWIW I'm not sure doing that is worth the complexity, since all the existing testing and gating Infra is already wired through Bodhi, but that's another conversation. In this case, though, it seems like draft builds will solve a concrete problem that ELN is having, so I'm more open to it.
I assume that with this use case, we'd never get into the situation where draft builds get invalidated, they'd only ever get promoted or the entire batch is discarded?
I'll be up-front about this: I'm not going to implement any special checking for this unless reality demonstrates that it's causing a real problem. I don't know what you'd expect for the fallback situation to be, either. Would we just skip every package from the batch? What if it's a really important one, like a Python version-bump rebuild?
I appreciate that rebuilding everything could mean a waste of CPU cycles and the equivalent power costs, but trying to design a solution for a case that should hopefully be a statistical blip would be a waste of human time. I think that's worse.
Similarly, I think this is overblown as well; notwithstanding the possibility that we suddenly started allowing emojis in package names, most crashes have historically been with places where we didn't adequately account for a timeout or unexpected 500 error when talking to Koji, Bodhi, etc.
If something like this were to happen, we can just ask Infra to delete a single row from the database table containing the pending builds (or lie and add a "completed_at" date on it) and EBS would stop seeing it. Realistically, if we were seeing that many errors, we'd temporarily disable EBS, fix whatever bug was causing the crash and then resume it.
I'm about 75% sure that abandoning a batch is going to cause more cleanup problems (requiring a human) than just retrying it will.
I don't know what "invalidated" means in this context. Either a build would be draft for a few minutes/hours as the batch processes through and then every successful build would be promoted into a real build, or else EBS crashes and the batch would be essentially orphaned and cleaned up by garbage collection after some TBD time period.
If you are asking whether EBS would go looking for abandoned draft builds and mark them for deletion, that's something we might be able to do, but it's definitely not going to be high on my priority list unless we somehow got really unlucky and started accruing many abandoned batches.
By skipping/abandoning a batch, do you mean ignoring it and moving on to the next batch? Because yeah, I guess then any later builds that depend on changes in the earlier builds could fail. But I meant having a check that stops processing of messages entirely until a human intervenes to prevent EBS from getting stuck in a failure state that wastes a lot of Koji resources.
I'm not going to push too hard for these things here since the EBS error rate is low and you obviously know more about EBS's architecture than I do, but I would feel more confident in this change if there was a fail-safe in place (or some movement on getting more builder resources in Koji).
Yes, this is what I meant. Apparently in CentOS Stream it's possible to do draft build A-1 from MR#1, draft build B-1 from MR#2, draft build A-2 from force-pushed PR#1, and then submit B-1 and A-2, even though B-1 was built against A-1, which never got promoted to un-draft build. I don't think this should be problem for ELN.
I think this is a great idea in general. There are interesting proposals for workflows using draft builds in Fedora proper, and using ELN as a test bed for draft build policies will give us useful experience and hopefully make it easier to decide whether and how we want to use draft builds in more places.
All four bullet points in the OP seem very reasonable.
That seems iffy. In particular, IIUC, it makes it impossible to do a reproducible build of B-1. So far our policy in koji was that "every build that was ever used to do another official build is available", and it's a property that we should preserve.
To be clear: this cannot happen in the EBS design (because everything in the buildroot is either from Rawhide or an earlier "slice" of this batch) and is therefore always submitted together. I urge people not to get sidetracked on this topic; I'd like to land the implementation of this proposal sooner, rather than later.
I didn't want to side-track, I only wanted your confirmation of my suspicion that this issue couldn't happen with ELN builds - which you did. So I'm OK with this mechanism. +1
I'm +1 for allowing draft builds for EBS batches to be tagged into ELN-inheriting side tags. If it's technically not feasible to be narrow I'm OK with that being 'any side-tag'.
+1, it sounds like this is pretty unlikely to cause problems.
After a week: APPROVED (+3, 0, 0)(see below)Hmmm, what exactly was approved? There was no specific text proposal, and the discussion was ongoing. It's not entirely clear to me that any formal voting was even happening.
@zbyszek wrote in #3621 (comment):
While I didn't write a literal "Proposal:" string, I thought that the four bullet points that I listed as "what I'm asking for" would have been sufficiently clear.
I didn't vote because there was no formal proposal. It sounded like an opening for a discussion.
@supakeen also had a "+1" in a comment, but apparently that didn't get counted. (And it probably shouldn't, because it's not clear that it is a vote for the proposal.)
I would prefer to restart this with a delineated proposal and a clear voting period.
My +1 was meant as a vote on "I'm requesting that we allow the use of Draft Builds in the ELN rebuild process" 🙂
I counted
+1s from @decathorpe, @supakeen, and @gotmax23 (myself). Did I miss someone else? I thought it was clear that we were voting on allowing draft builds in the ELN rebuild sidetags, following the steps in the bullet points in the ticket description. Since that wasn't clear to everyone (mea culpa!), then yes, I'll put forward a concrete proposal to vote on:Proposal: FESCo permits the ELNBuildSync (EBS) service to use draft builds in Koji sidetags inherited from
eln-buildfor the purpose of ELN rebuild batches. The Kojihub policy will be updated to grant theeln-buildsyncuser permissions to tag and promote the draft builds in these sidetags.(@sgallagh, is that summarized proposal inline with what you're asking for?)
Other than the open question of whether the tag policy is granular enough to limit it to ELN-derived side-tags, yes. I'd slightly prefer to have approval cover "any side tag" for the policy, just in case.
Based on the policy example in https://docs.pagure.org/koji/draft_builds/#policies-for-draft-builds, it looks like it would be possible to limit this to the glob
eln-build-side-*. I think that should satisfy the conditions in the proposal.+1
What about @sgallagh? (I actually don't remember our policy here. Proposals made in the meeting certainly count as +1 from the proposer. I'm not sure if that covers proposals made in the ticket too.)
I am not currently serving on FESCo, so my vote doesn't count.
I suppose this is ok. It seems like working around things instead of properly doing it, but I understand why that would be a lot of work.
We also do need to decide a GC policy for (unporomosted) draft builds. We don't want to keep them around forever, and by their nature there will possibly be more than 1 of them per real promoted build.
Absolutely. FWIW, I can't really see a need for us to keep them longer than two weeks, but I was planning to ask for 30 days out of an abundance of caution.
We try really hard to avoid crashes in EBS and I think we've had a grand total of two so far this calendar year (both due to infra issues that caused python-fedora-messaging to explode). The other situations where this could be involved is if we push out a service upgrade to EBS or the OpenShift node is terminated for some reason. In the case of EBS upgrades, we'd generally aim to "pause" activity and let any running batches complete first, so that shouldn't leave any drafts around.
So, if we assume a very paranoid rate of two crashes per month, a generous batch size of 20 builds (most are fewer than ten, but the average is pulled up by the occasional big side-tag merge) and an average of 10 MiB of data per package, we're looking at about 5 GiB worth of storage a year per year in leftover Draft Builds if we don't have a garbage-collection policy. That is almost certain to be a significant overestimation.
@decathorpe, @supakeen, are you still
+1to the new proposal?I'm +1 to the proposal, provided we can restrict it to just eln tags. If we can't, I'm worried we could have problems if it's accidentally allowed across all tags.
Still +1.
If it's not possible to implement this as written in koji hub policy, then doing the "next best" thing (within reason) is fine with me too.
Yep, still +1.
(counted supakeen, decathorpe, ngompa, gotmax23, zbyszek)
After one week: APPROVED (+5, 0, -0) FESCo permits the ELNBuildSync (EBS) service to use draft builds in Koji sidetags inherited from
eln-buildfor the purpose of ELN rebuild batches. The Kojihub policy will be updated to grant theeln-buildsyncuser permissions to tag and promote the draft builds in these sidetags.I'm late to the party here and I don't really understand the topic and the implications so '0' for me.
Announced in https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/AFF4NYSCZMHAPIHCDR4CPNI3ILPCHWYO/
I drafted (heh) a new policy document for this, please take a look:
https://forge.fedoraproject.org/fesco/docs/pulls/147