【发布时间】:2017-07-10 01:02:10
【问题描述】:
First Run 教程非常好。一切都正确安装并显示 WebUI。但是,runtests 无法运行。本教程将学生引导至瀑布视图以查看runtests 构建器。 runtests 不会出现在瀑布页面的任何位置。要强制运行,请转到构建器页面并单击强制按钮。不幸的是,我的 WebUI 中没有该按钮。我确实在日志中看到了令人不安的一行。但我不知道该怎么做:
2017-07-10 00:09:15+0000 [Broker,0,127.0.0.1] Worker example-worker attached to runtests
2017-07-10 00:09:37+0000 [-] dropping connection to peer tcp4:127.0.0.1:48686 with abort=False
... 因为工作人员从 IPv4Address 附加到 (TCP, '127.0.0.1', 39436)。所以我不确定哪个连接被丢弃了。
以下是 buildbotNetUsageData 发送的信息。我在 AWS 上的 ec2 实例中运行它。只有我打开的端口是 80、443、22、9989。worker 和 master 在同一台机器上。我使用 Nginx 到 proxy_pass localhost:8010 到公共端口 80。在 Ubuntu 16.04 服务器上使用默认 Python。
我的第一直觉是我忽略了一些明显的东西。这是我第一次使用 buildbot。但是我不确定如何调试它。我在任何地方都没有错误和失败。
Web UI 也在做一些时髦的事情。 example-worker 出现在 /#/workers 页面中的唯一方法是,如果我首先查看 /#/builders 页面。如果我来自/#/(家)或/#/waterfall,它不会显示。我必须先去/#/builders,然后去/#/workers。这是example-worker 出现的唯一方式。
我已经研究了一段时间了。我试过使用 ubuntu 14.04,但在安装 buildbot 时遇到了麻烦。与 REHL 相同。我正在通过 ansible 执行此操作,我也在学习。所以我花了很多时间来调整我的剧本和角色。
问题:
我的问题是这样的。我该如何解决这个问题并强制使用 runtests 构建器?
不是答案:
This question 不是答案,因为我没有看到 force 按钮。
buildbotNetUsageData:
{
"versions": {
"Python": "3.5.2",
"Twisted": "17.5.0",
"Buildbot": "0.9.9.post2"
},
"platform": {
"system": "Linux",
"version": "#22-Ubuntu SMP Fri Mar",
"python_implementation": "CPython",
"machine": "x86_64",
"processor": "x86_64",
"platform": "Linux-4.4.0-1013-aws-x86_64-with-Ubuntu-16.04-xenial",
"distro": "ubuntu:16.04"
},
"mq": "simple",
"db": "sqlite",
"www_plugins": [
"waterfall_view",
"console_view"
],
"plugins": {
"buildbot/changes/gitpoller/GitPoller": 1,
"buildbot/schedulers/basic/SingleBranchScheduler": 1,
"buildbot/config/BuilderConfig": 1,
"buildbot/schedulers/forcesched/ForceScheduler": 1,
"buildbot/worker/base/Worker": 1,
"buildbot/steps/shell/ShellCommand": 1,
"buildbot/steps/source/git/Git": 1
},
"installid": "<some long number>"
}
编辑#1:
这是默认的master.cfg,我没有对其进行任何编辑:
# -*- python -*-
# ex: set filetype=python:
from buildbot.plugins import *
# This is a sample buildmaster config file. It must be installed as
# 'master.cfg' in your buildmaster's base directory.
# This is the dictionary that the buildmaster pays attention to. We also use
# a shorter alias to save typing.
c = BuildmasterConfig = {}
####### WORKERS
# The 'workers' list defines the set of recognized workers. Each element is
# a Worker object, specifying a unique worker name and password. The same
# worker name and password must be configured on the worker.
c['workers'] = [worker.Worker("example-worker", "pass")]
# 'protocols' contains information about protocols which master will use for
# communicating with workers. You must define at least 'port' option that workers
# could connect to your master with this protocol.
# 'port' must match the value configured into the workers (with their
# --master option)
c['protocols'] = {'pb': {'port': 9989}}
####### CHANGESOURCES
# the 'change_source' setting tells the buildmaster how it should find out
# about source code changes. Here we point to the buildbot clone of pyflakes.
c['change_source'] = []
c['change_source'].append(changes.GitPoller(
'git://github.com/buildbot/pyflakes.git',
workdir='gitpoller-workdir', branch='master',
pollinterval=300))
####### SCHEDULERS
# Configure the Schedulers, which decide how to react to incoming changes. In this
# case, just kick off a 'runtests' build
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"]))
####### BUILDERS
# The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
# what steps, and which workers can execute them. Note that any particular build will
# only take place on one worker.
factory = util.BuildFactory()
# check out the source
factory.addStep(steps.Git(repourl='git://github.com/buildbot/pyflakes.git', mode='incremental'))
# run the tests (note that this will require that 'trial' is installed)
factory.addStep(steps.ShellCommand(command=["trial", "pyflakes"]))
c['builders'] = []
c['builders'].append(
util.BuilderConfig(name="runtests",
workernames=["example-worker"],
factory=factory))
####### BUILDBOT SERVICES
# 'services' is a list of BuildbotService items like reporter targets. The
# status of each build will be pushed to these targets. buildbot/reporters/*.py
# has a variety to choose from, like IRC bots.
c['services'] = []
####### PROJECT IDENTITY
# the 'title' string will appear at the top of this buildbot installation's
# home pages (linked to the 'titleURL').
c['title'] = "Pyflakes"
c['titleURL'] = "https://launchpad.net/pyflakes"
# the 'buildbotURL' string should point to the location where the buildbot's
# internal web server is visible. This typically uses the port number set in
# the 'www' entry below, but with an externally-visible host name which the
# buildbot cannot figure out without some help.
c['buildbotURL'] = "http://localhost:8010/"
# minimalistic config to activate new web UI
c['www'] = dict(port=8010,
plugins=dict(waterfall_view={}, console_view={}))
####### DB URL
c['db'] = {
# This specifies what database buildbot uses to store its state. You can leave
# this at its default for all but the largest installations.
'db_url' : "sqlite:///state.sqlite",
}
【问题讨论】:
-
你能上传你的配置吗?主要是设置调度程序的位。还有您的 nginx 配置 - 您是否复制了 buildbot 教程中提供的示例配置?
-
是的,这是您在执行
mv master.cfg.sample master.cfg时获得的默认配置。我已将其添加为编辑。 -
我与 tardyp 进行了简短的交谈,他回答了以下问题,他说这可能是因为我没有正确转发 websockets。我正在使用 Nginx,websocket 转发指令不适用于简单的 http。我还没有尝试使用https。那将是我的下一次尝试。
-
是的,我在使用 nginx 时遇到了同样的问题,必须修改教程中的 nginx 配置才能使其正常工作,您的 nginx 配置是什么样的?
-
我有完全相同的问题,虽然配置略有不同。我在 rkt 容器中运行它们。不过,我也使用 nginx。有人愿意分享一个有效的 nginx 配置吗?