[Buildbot-devel] Prioritize slaves with nextSlave not working

Julia S.S. hithwen at gmail.com
Mon May 12 14:26:51 UTC 2014


mm, seems that reconfig applies the config but does not make logs appear,
after restart I start seing logs so I can debug my function. You're right
about the slave builder list, the typo is reported here
here<https://mailtrack.io/trace/link/57e4c941f84f3b69d2383f12a2215421de9e780f>but
ist not fixed
here<https://mailtrack.io/trace/link/279cf1af77431621c5c125bfe25ba2f55763acb6>
.

Thanks a lot!

Sent with MailTrack<https://mailtrack.io/install?source=signature&lang=en&referral=hithwen@gmail.com&idSignature=22>


On Fri, May 9, 2014 at 5:45 PM, Jared Grubb <jared.grubb at gmail.com> wrote:

> FWIW, here is one that I use:
>
> SLAVE_PRIORITY = {
>     'slave_1': 100,
>     'slave_2': 75,
>     'slave_3': 50,
> }
>
> def useBestSlave(bldr, buildslaves):
>     if not buildslaves:
>         return None
>     try:
>         slaves = sorted(buildslaves, key=lambda s:
> SLAVE_PRIORITY.get(s.slave.slavename, 0))
>         twisted_log.msg("useBestSlave: Of %d slaves, picked: %s" %
> (len(buildslaves), slaves[-1].slave.slavename))
>         return slaves[-1]
>     except Exception, e:
>         twisted_log.msg("useBestSlave: got exception: %r" % (e))
>         return random.choice(buildslaves)
>
> ...
>
> c['builders'].append({
>         'name': '...',
>         'factory': BuildFactory(steps),
>         'builddir': builddir,
>         ....,
>         'nextSlave':  useBestSlave,
>     })
>
>
>
> On May 9, 2014, at 3:04, Julia S.S. <hithwen at gmail.com> wrote:
>
> Hi Jared,
> I'm using 0.8.8
>
> In case of exception i'd expect to see  at least the first logged message
> (which is the first line of the function): logger.msg('nextSlave called')
> and when i'm passing lambda _,slaves: random.choice(slaves) if slaves else
> None if should not hang anyway.
> I gave a try to the try/catch->log but i got same result: build pending
> and nothing in the log.
>
> Thanks anyway
>
>
>
>
> Sent with MailTrack<https://mailtrack.io/install?source=signature&lang=en&referral=hithwen@gmail.com&idSignature=22>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20140512/4fc928ec/attachment.html>


More information about the devel mailing list