avoid that builders will run at the same time in buildbot

拜拜、爱过 提交于 2019-12-11 09:59:56

问题


I need to get data from a server, and this takes time; usually 30 min or more.

I have a builder that gets data from this server; I would like that no other builders on this slave, will run, if I am still running this builder. Once done, the other builder can run concurrently, respecting my settings related to the max concurrent build.

How do I achieve this? I was looking at locks, but the manual does not have a clear example that show how do I setup a builder to block all the others until is done.

Does anyone has an example that I can use to setup my configuration, and where every piece goes? Thanks


回答1:


A lock example would be:

import sys
from buildbot import locks
build_lock = locks.SlaveLock("slave_builds",
                             maxCount=sys.maxint)

c['builders'].append(BuilderConfig(name=exclusive_builder,
                                   slavenames=['my_slave'],
                                   factory=my_factory,
                                   locks=[build_lock.access('exclusive')]))
c['builders'].append(BuilderConfig(name=other_builder,
                                   slavenames=['my_slave'],
                                   factory=my_other_factory,
                                   locks=[build_lock.access('counting')]))

A build with this lock will have exclusive access to the slave. There are not badly explained, more complex examples in Interlocks section of the documentation



来源:https://stackoverflow.com/questions/23861906/avoid-that-builders-will-run-at-the-same-time-in-buildbot

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!