What algorithm does buildbot use to assign builders to slaves?
Asked Answered
S

1

6

I have a buildbot with some builders and two slave machines.

Some of the builders can run on one slave, and some of them can run on both machines.

What algorithm will buildbot use to schedule the builds? Will it notice that some builders can run on just one slave and that it should assign those that can run on both slaves to the less demanded one?

(I know buildbot can be used to run the same build on multiple architectures, say Windows, Linux, etc. We are using it to distribute builds for performance, because a single build is enough for us).

Sizemore answered 9/2, 2010 at 13:50 Comment(1)
Related questionTern
F
11

First it gets a list of all the slaves attached to that builder. Then it picks one at random. If the slave is already running more than slave.max_builds builds, it picks another.

You can override the nextSlave method on the Builder to change the way slaves are chosen. The arguments passed to your function will be the Builder object, and a list of buildbot.buildslave.BuildSlave objects. You have to return one of the items of the latter list, or None.

Fidelity answered 24/2, 2010 at 2:49 Comment(2)
But how can you detect , wether the slaver is running a builder ?Berley
In the slaves you have a field build_status which contains a list named runningBuilds, what I don't know is if the list also contains enqueued buildsTern

© 2022 - 2024 — McMap. All rights reserved.