Skip to content

service: add Trigger(name) to trigger bundle rebuild #124

Draft
srenatus wants to merge 3 commits intomainfrom
sr/rwpqrqqwtrrw
Draft

service: add Trigger(name) to trigger bundle rebuild #124
srenatus wants to merge 3 commits intomainfrom
sr/rwpqrqqwtrrw

Conversation

@srenatus
Copy link
Contributor

@srenatus srenatus commented Oct 2, 2025

Adds the machinery to pool and service to trigger bundle rebuilds by name. If the bundle worker is queued, it'll be pulled into the front of the line, to be picked up next; if it's currently not in the queue, it must be executing: if so, we're overriding the next deadline to be now, causing an immediate re-run of the build process.

Use a config snippet like this

service:
  bundle_rebuild_interval: 1h
  reconfiguration_interval: 1h

to put the automatic rebuilds and config checks almost on hold.

It's now exposed with a a new role, "automation", and via HTTP, POST /v1/bundles/{name}. These are things we should probably discuss.

Next steps:

  1. Figure out of this is the right thing, and
  2. Find answers to the remaining questions related to exposing this trigger via an HTTP endpoint

@srenatus srenatus force-pushed the sr/rwpqrqqwtrrw branch 3 times, most recently from bf196bb to afffedd Compare October 2, 2025 13:15
@srenatus srenatus force-pushed the sr/rwpqrqqwtrrw branch 2 times, most recently from ba4cbc7 to f3e7408 Compare October 6, 2025 09:20
@srenatus srenatus force-pushed the sr/rwpqrqqwtrrw branch 3 times, most recently from b3850e5 to 9267b67 Compare October 8, 2025 07:01
@srenatus srenatus force-pushed the sr/rwpqrqqwtrrw branch 3 times, most recently from 6e4a514 to b7d8386 Compare October 30, 2025 12:04
@mjungsbluth
Copy link

@srenatus this looks like a great start but I think we can simplify this (and also solve the horizontal scalability issues):

  • I would add a configuration flag like bundle_rebuild_periodically: true/false to allow disabling any kind of intrinsic periodicity. This would allow to just horizontally scale and have more than once OCP instance running
  • It would actually be nice if the trigger would block until the build is complete which would make it a lot simpler for clients in CI/CD pipelines to wait until the build is done (and pushed to S3 for example). This otherwise becomes a problem of all clients to implement some waiting mechanism and error propagation (build errors, ...) becomes a bit harder to report.

@mefarazath
Copy link

mefarazath commented Dec 8, 2025

@srenatus is this feature/improvement pending due to unanswered questions highlighted in "Next steps:" in the PR description?

@srenatus
Copy link
Contributor Author

srenatus commented Dec 8, 2025

Yeah this needs some love. @mefarazath Do you have a similar use case? Would it help as implemented there? If so, I can put in some time this week to land this.

@srenatus
Copy link
Contributor Author

srenatus commented Dec 9, 2025

@mjungsbluth Sorry for the radio silence! (Must have overlooked that notification... 😓)

I would add a configuration flag like bundle_rebuild_periodically: true/false to allow disabling any kind of intrinsic periodicity. This would allow to just horizontally scale and have more than once OCP instance running

Horizontal scaling is something we're definitely keen on with OCP. That said, if you configure your rebuild period to, say, 10 years, you'll have the same effect now. But obviously without an external trigger, nothing would ever happen.

Which is why I'll refresh this PR. 🙃

It would actually be nice if the trigger would block until the build is complete which would make it a lot simpler for clients in CI/CD pipelines to wait until the build is done (and pushed to S3 for example).

Yeah I can see that. Let's see what we can do.

Adds the machinery to pool and service to trigger bundle rebuilds
by name. If the bundle worker is queued, it'll be pulled into the
front of the line, to be picked up next; if it's currently not in
the queue, it must be executing: if so, we're overriding the next
deadline to be _now_, causing an immediate re-run of the build
process.

For now, this is only wired up with signal handling: send a HUP signal
to rebuild. This is because we haven't discussed proper permissions
and HTTP API design for this yet.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
Some arbitrary choices here that we'll need to discuss before merging!

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
@srenatus srenatus force-pushed the sr/rwpqrqqwtrrw branch 2 times, most recently from 80fab93 to 36c10db Compare December 10, 2025 12:06
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants