【问题标题】:Buildbot firstrun, Web UI does not show ForceScheduler in waterfall viewBuildbot firstrun,Web UI 在瀑布视图中不显示 ForceScheduler
【发布时间】: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 配置吗?

标签: ansible buildbot


【解决方案1】:

我遇到了同样的问题。看起来问题出在WebSocket上。来自 Nginx doco (https://nginx.org/en/docs/http/websocket.html):

将客户端和服务器之间的连接从 HTTP/1.1 转换为 WebSocket,HTTP/1.1 中可用的协议切换机制是 用过。

但是有一个微妙之处:因为“升级”是逐跳的 标头,它不会从客户端传递到代理服务器。带前锋 代理,客户端可以使用 CONNECT 方法来规避这个问题。 然而,这不适用于反向代理,因为客户端是 不知道任何代理服务器,以及代理上的特殊处理 服务器是必需的。

基本上你需要正确代理 WebSocket 连接。为此,将以下内容添加到 Nginx 配置中:

http {
    ...
    server {
        ...
        location ... {
        proxy_pass ...;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }
}

【讨论】:

    【解决方案2】:

    强制按钮不会出现在瀑布视图中。它仅出现在构建器页面中。 转到Builders页面/#builders,选择你的builder,你会在右上角看到强制按钮。

    【讨论】:

    【解决方案3】:

    我确实遇到了这些问题,但首先我删除了 nginx 配置并使用带有 :8010/ 的 URL。也许是懒惰,但它确实有效。这解决了问题的一部分。然后我在这里发现了一个旧的错误报告:Link to cached version since the tracker is down atm,标题为 #2731:[九] Force build in new UI is not working in chrome

    所以我只是在 Firefox 中尝试了这个。哪个有效。这个错误据说是一年前修复的,但仍然存在。让它在 Firefox 中运行后,它现在也可以在 Chrome 中运行。

    无论如何。这两件事解决了我所有的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-14
      • 1970-01-01
      • 1970-01-01
      • 2012-06-27
      • 1970-01-01
      相关资源
      最近更新 更多