About assigning builder

Asked by zhouganqing

I'm thinking about how to make Launchpad assign a specific builder to a specific build instead of the default random assignment.
For example, when I need to build the Linux kernel DEB package, I prefer that the most powerful builder on the build farm can be used to build it. So I would spend less time in compiling it.

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Colin Watson
Solved:
Last query:
Last reply:
Revision history for this message
zhouganqing (zhouganqing) said (last edit ):
#1

This idea is based on my experience with my local launchpad. (for testing)
If I can implement this idea, the relevant changes will only apply to my local launchpad. It will not involve the official code branch of Launchpad.

Revision history for this message
Best Colin Watson (cjwatson) said :
#2

Launchpad doesn't currently have any support for this sort of builder affinity, and it's not something that's a particularly high priority for our build farm (we generally prefer to keep all our builders for a given architecture as close to homogeneous as we can). You're of course welcome to implement whatever you like locally.

The way in which builds are assigned to builders doesn't necessarily make this sort of thing conceptually straightforward, because it doesn't work by examining a build and then finding a suitable builder. Rather, buildd-manager polls all builders frequently, and when it notices that a builder is idle, it finds a job to run that's a suitable candidate for that builder and then dispatches it (lib/lp/buildmaster/interactor.py:BuilderInteractor.findAndStartJob). So to implement what you're asking for, you'd need to find some way to declare that certain builds are only eligible to build on certain builders.

The ideal place to put such code would probably be in the SQL query made by lib/lp/buildmaster/model/buildqueue.py:BuildQueueSet.findBuildCandidates, though you'd also need to come up with somewhere to encode the policy. Alternatively, perhaps you could leave that query in place and just skip candidates that aren't eligible for the builder currently being considered, maybe by adding the builder to the postprocessCandidate interface and changing lib/lp/soyuz/model/binarypackagebuild.py:BinaryPackageBuildSet.postprocessCandidate to return False if attempting to build a kernel on an insufficiently powerful builder.

Revision history for this message
zhouganqing (zhouganqing) said :
#3

Thanks Colin Watson, that solved my question.