We can’t use priorities, unfortunately. We already use priorities for actual prioritization (or plan to very soon) for their intended purpose.
Moreover, it would not be enough to use priorities since some agents should not be able to accept jobs because some agents simply can’t run the jobs of other agents. For us this means macOS vs Linux, but I can see this being very useful for other things - end-to-end tests vs builds, say.
Moreover, the build matrix will not work for us because we do not know up-front which jobs will be scheduled for any particular build. We make heavy use of buildkite-agent upload
(it’s a killer feature!) and there is simply no way to know which platform will need to build before the upload. Also, the jobs for each platform will be different, so a matrix, even with adjustments, simply will not work for us.
Without the ability to restrict the kinds of jobs an agent can accept, we have quite a lot of CI capacity issues. We run a lot of agents on a central planning machine and have each job trigger a remote build. We have limited macOS build capacity so it is easy to get into a scenario like the following:
10 agents on the planning machine
2 macOS build machines
8 Linux build machines
build1 uploaded with 4 macOS jobs, 10 linux jobs
job queue: (build1, linux6), (build1, linux7), ...
agent1: (build1, macos1)
agent2: (build1, macos2)
agent3: (build1, macos3)
agent4: (build1, macos4)
agent5: (build1, linux1)
agent6: (build1, linux2)
agent7: (build1, linux3)
agent8: (build1, linux4)
agent9: (build1, linux5)
agent10: (build1, linux6)
builders:
macos1: (build1, macos1)
macos2: (build1, macos2)
linux1: (build1, linux1)
linux2: (build1, linux2)
linux3: (build1, linux3)
linux4: (build1, linux4)
linux5: (build1, linux5)
linux6: idle
linux7: idle
linux8: idle
This situation only gets worse because new builds after build1
can easily take up all the agents waiting for the slow macOS builds. What we really need is to reserve some agents for macos
only, so the situation would look like this:
10 agents on the planning machine
2 macOS build machines
8 Linux build machines
build1 uploaded with 4 macOS jobs, 10 linux jobs
job queue: (build1, macos3), (build1, macos4), (build1, linux9), (build1, linux10)
agent1: (build1, macos1)
agent2: (build1, macos2)
agent3: (build1, linux1)
agent4: (build1, linux2)
agent5: (build1, linux3)
agent6: (build1, linux4)
agent7: (build1, linux5)
agent8: (build1, linux6)
agent9: (build1, linux7)
agent10: (build1, linux8)
builders:
macos1: (build1, macos1)
macos2: (build1, macos2)
linux1: (build1, linux1)
linux2: (build1, linux2)
linux3: (build1, linux3)
linux4: (build1, linux4)
linux5: (build1, linux5)
linux6: (build1, linux6)
linux7: (build1, linux7)
linux8: (build1, linux8)