Jeevesh Narang
Jeevesh Narang

Reputation: 51

Buildbot stuck on preparing worker stage with DockerLatentWorker

I am trying to make DockerLatentWorker in buildbot work.But so far buildbot always gets stuck on preparing worker stage for hours. This is the output at that time on the terminal

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 For master I modified https://hub.docker.com/r/buildbot/buildbot-master/~/dockerfile/ this dockerfile to add docker-py dependency.

I am using buildbot 0.9.7 with Docker version 17.03.1-ce, build c6d412e.

Here is my master.cfg file (snippet of it)

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",
}

I have configured my Docker daemon to listen to tcp://0.0.0.0:2375 too, and the also pulled the buildbot/buildbot-worker:master image.

Here is the screenshot of Buildbot

Screenshot

I can't figure out where the problem is.

Upvotes: 0

Views: 698

Answers (1)

tardyp
tardyp

Reputation: 1242

The docker preparation should takes a few hundred of millisecond as long as the docker image is present on the system. No need to wait for hours. There are a number of reasons why you docker worker would not start.

  • the worker container cannot access the master's container worker tcp port.
  • the worker container cannot start at all

You can use the DockerLatentWorker debug parameter followStartupLogs=True on the to have the master show the worker's logs inside twisted.log

Upvotes: 1

Related Questions