避免构建器在buildbot中同时运行 [英] avoid that builders will run at the same time in buildbot
问题描述
我需要从服务器获取数据,这需要时间。通常是30分钟或更长时间。
我有一个构建器,可以从该服务器获取数据;如果我仍在运行此构建器,我希望该从属上的其他构建器都不会运行。完成后,其他构建器可以并发运行,并遵守我与最大并发构建相关的设置。
如何实现此目标?我当时在看锁,但是手册中没有一个清晰的示例,显示了如何设置构建器以阻止所有其他构建器,直到完成。
任何人都有我可以用来设置配置的示例,以及每个示例的去向?谢谢
锁定示例为:
从buildbot导入sys
导入锁
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('计数)))))
在互锁部分中,没有不好解释的更复杂的示例文档
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
解决方案 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
这篇关于避免构建器在buildbot中同时运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!