[users at bb.net] builds per node

Greg MacDonald gmacdonald at trionworlds.com
Fri Feb 12 01:04:50 UTC 2016


So as a test I created a nextSlave function to allow a job only if the slave is idle. It sort of works except when getNext is called back to back. In that case I get two builds scheduled on one machine when there should only be one. It looks like the builder’s current builds hasn’t had time to be updated. Is there a lock I could use? Or a pending builds list somewhere?

Thx.

def getNextSlaveIfIdle(builder, slaveBuilders, buildRequest):
    master = builder.master

    busySlaveNames = set()
    for builder in master.botmaster.builders.values():
        for b in builder.builder_status.getCurrentBuilds():
            busySlaveNames.add(b.getSlavename())

    for slaveBuilder in slaveBuilders:
        if slaveBuilder.slave.name in busySlaveNames:
            continue
        print '*** Using %s for next build.' % slaveBuilder.slave.name
        return slaveBuilder

    print '*** No slaves available.'
    return None

From: users [mailto:users-bounces at buildbot.net] On Behalf Of Greg MacDonald
Sent: Thursday, February 11, 2016 11:20 AM
To: Cipi Bad
Cc: users at buildbot.net
Subject: Re: [users at bb.net] builds per node

Thanks! I’ll give that a shot.

-Greg

From: Cipi Bad [mailto:cipibad at gmail.com]
Sent: Wednesday, February 10, 2016 9:50 PM
To: Greg MacDonald
Cc: users at buildbot.net<mailto:users at buildbot.net>
Subject: Re: [users at bb.net] builds per node

Hi,

The solution should be in custom nextSlave function.

For similar problem, I tried to use custom nextSlave(that should be the natural solution)  without success.
Currently I am using a 'ugly' combination of "nextBuild" /max_builds

Good luck,
Ciprian

On Thu, Feb 11, 2016 at 2:11 AM, Greg MacDonald <gmacdonald at trionworlds.com<mailto:gmacdonald at trionworlds.com>> wrote:
Hi Everyone,

Is there a way to limit the number of builds per node for a set of builders? I’m using a slave lock for that purpose on the builder and it’s not quite what I’d like to happen. The builds start on a specific slave in the starting state. But they’re waiting not starting and it makes it difficult in the UI to see what is currently running. Also I’d rather the scheduling be performed dynamically at the time slaves become free. Is there another way to do this?

-Greg

_______________________________________________
users mailing list
users at buildbot.net<mailto:users at buildbot.net>
https://lists.buildbot.net/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/users/attachments/20160212/84ed870a/attachment.html>


More information about the users mailing list