Build priorities

We are trying to setup buildkite, but were surprised to find that there is no way to prioritize some branches.
We use aws with autoscaling.

Usecase:

We want builds from master branch to be connected to agents first (before other branches).
Usually, CI has a “priority branches” setting or way to prioritize some build.

We’d also like to see this. We have a limited pool of agents that each is connected to some custom HW. We’d like to be able to use buildkite as a reservation system of sorts. When a user manually runs a build, it would be great if these builds would take priority over scheduled or triggered builds.

I run Buildkite in a kubernetes cluster. I put together different pods of buildkite-agent with different “resource_class” tags, and agent priorities.

In the way I have set it up, our scheduled builds uses a smaller pool of agents and our rebuilar builds uses a larger pool of agents. With the agent priority, builds are scheduled into our standard pods, but can overflow into our “long-running” pods as needed.

Since I am using K8S, I configured the resource requests to “burst” and then oversubscribe the pods.

I have not thought about branch priorities, but I could probably set something up like that too. We had not needed it though, because there is enough capacity to build both master and feature branches together, and the lead time for deploying from master is reasonably fast, even when there are feature branches being built.

FWIW I’d love to see this too. This is the one feature I was surprised to find missing. We run the usual automated builds and manual builds, and would like to be able to ask Buildkite to schedule manual builds over all others.

When I raised this initially it was suggested we run separate high-priority only agents, which is a solution we could pursue but I’d prefer the cleaner option of build priorities. Overall it’s been more of an annoyance than a huge problem for us. When it does pop up we temporarily disable the automatic builds, or ask people not to commit for the day, or just straight-up cancel all the scheduled automatic builds to let the manual one through.

2 Likes

100% on this Feature!

We have many developers submitting PRs, and when merged, they generate many more jobs than are run pre-merge. For example, a proposed changeset to our Android app directory will run about common jobs and about 5 Android test jobs, for a total of 10 jobs, but then post-merge runs the entire pipeline of 70 jobs. The post-merge jobs should ideally be scheduled at a lower priority, since developers are not waiting on these results to continue development, whereas pre-merge jobs should return results as quickly as possible.

What we would ideally like to do is dynamically assign step priorities based on whether the build is a pull request, or branch build, by modifying the pipeline yaml that is uploaded to Buildkite.

Feature Spec

Add a numeric priority field to the step block of an uploaded pipeline. When Buildkite schedules jobs against agents, it will first assign higher priority jobs in order of creation, then submit lower priority jobs in order of creation, and so on.

For example, if 100 jobs with priority 4 are waiting for agents, and a PR is submitted with 10 jobs that have priority 8, then those 10 jobs would effectively jump the queue and be assigned before the remaining 100 jobs would be assigned.

2 Likes

Any updates on this feature request?

Hi @josh!

Welcome to the community! :slightly_smiling_face:
We’re in the middle of strategic planning which will inform our product roadmap, and job priority is definitely on our map, but unfortunately, we don’t have a resolution time yet.
When is ready, it’s going to be informed in our changelog.

Thanks!

Just echoing @josh, this’d be a really valuable piece of functionality, as we often have a lot of builds in flight, but would always want to prioritise master without needing to cancel a bunch of other builds temporarily (which is our current workaround)

1 Like