我试图让 DockerLatentWorker 在 buildbot 工作。但到目前为止,buildbot 总是卡在准备工作阶段几个小时。这是当时终端上的输出
2017-06-09 14:16:55+0000 [-] starting build <Build runtests number:None results:success> using worker <LatentWorkerForBuilder builder=u'runtests' worker=u'example-worker' state=AVAILABLE>
2017-06-09 14:16:55+0000 [-] <Build runtests number:None results:success>.startBuild
2017-06-09 14:16:57+0000 [-] acquireLocks(worker <DockerLatentWorker u'example-worker'>, locks [])
2017-06-09 14:16:57+0000 [-] substantiating worker <LatentWorkerForBuilder builder=u'runtests' worker=u'example-worker' state=DETACHED>
2017-06-09 14:16:58+0000 [-] Container created, Id: b6eb4d...
2017-06-09 14:16:58+0000 [-] Container started
对于主人,我修改了https://hub.docker.com/r/buildbot/buildbot-master/~/dockerfile/这个 dockerfile 添加 docker-py 依赖项。
我正在使用带有 Docker 版本 17.03.1-ce 的 buildbot 0.9.7,构建 c6d412e。
这是我的 master.cfg 文件(它的片段)
from buildbot.plugins import *
c = BuildmasterConfig = {}
####### WORKERS
c['workers'] = [
worker.DockerLatentWorker('example-worker', 'password',
docker_host='tcp://10.29.21.172:2375',
image='buildbot/buildbot-worker:master')
]
c['protocols'] = {'pb': {'port': 9989}}
####### CHANGESOURCES
c['change_source'] = []
c['change_source'].append(changes.GitPoller(
'git://github.com/buildbot/pyflakes.git',
workdir='gitpoller-workdir', branch='master',
pollinterval=300))
####### SCHEDULERS
c['schedulers'] = []
c['schedulers'].append(schedulers.SingleBranchScheduler(
name="all",
change_filter=util.ChangeFilter(branch='master'),
treeStableTimer=None,
builderNames=["runtests"]))
c['schedulers'].append(schedulers.ForceScheduler(
name="force",
builderNames=["runtests"]))
c['builders'] = []
c['builders'].append(
util.BuilderConfig(name="runtests",
workernames=["example-worker"],
factory=factory))
####### PROJECT IDENTITY
c['title'] = "Pyflakes"
c['titleURL'] = "https://launchpad.net/pyflakes"
c['buildbotURL'] = "http://localhost:8010/"
c['www'] = dict(port=8010,
plugins=dict(waterfall_view={}, console_view={}))
####### DB URL
c['db'] = {
'db_url' : "sqlite:///state.sqlite",
}
我也将我的 Docker 守护进程配置为监听 tcp://0.0.0.0:2375,并且还提取了 buildbot/buildbot-worker:master 映像。
这是Buildbot的截图
我无法弄清楚问题出在哪里。