SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы

Назад

Upgrading an Existing Worker


Метки: buildbot

Version-specific Notes

During project lifetime worker has transitioned over few states:

  1. Before Buildbot version 0.8.1 worker were integral part of buildbot package distribution.
  2. Starting from Buildbot version 0.8.1 worker were extracted from buildbot package to buildbot-slave package.
  3. Starting from Buildbot version 0.9.0 the buildbot-slave package was renamed to buildbot-worker.

Upgrading a Worker to buildbot-slave 0.8.1

Before Buildbot version 0.8.1, the Buildbot master and worker were part of the same distribution. As of version 0.8.1, the worker is a separate distribution.

As of this release, you will need to install buildbot-slave to run a worker.

Any automatic startup scripts that had run buildbot start for previous versions should be changed to run buildslave start instead.

If you are running a version later than 0.8.1, then you can skip the remainder of this section: the upgrade-slave command will take care of this. If you are upgrading directly to 0.8.1, read on.

The existing buildbot.tac for any workers running older versions will need to be edited or replaced. If the loss of cached worker state (e.g., for Source steps in copy mode) is not problematic, the easiest solution is to simply delete the worker directory and re-run buildslave create-slave.

If deleting the worker directory is problematic, the change to buildbot.tac is simple. On line 3, replace:

from buildbot.slave.bot import BuildSlave

with:

from buildslave.bot import BuildSlave

After this change, the worker should start as usual.

Upgrading from 0.8.1 to the latest 0.8.* version of buildbot-slave

If you have just installed a new version of Buildbot-slave, you may need to take some steps to upgrade it. If you are upgrading to version 0.8.2 or later, you can run

buildslave upgrade-slave /path/to/worker/dir

Upgrading from the latest version of buildbot-slave to buildbot-worker

If the loss of cached worker state (e.g., for Source steps in copy mode) is not problematic, the easiest solution is to simply delete the worker directory and re-run buildbot-worker create-worker.

If deleting the worker directory is problematic, you can change buildbot.tac in the following way:

  1. Replace:

    from buildslave.bot import BuildSlave
    

    with:

    from buildbot_worker.bot import Worker
    
  2. Replace:

    application = service.Application('buildslave')
    

    with:

    application = service.Application('buildbot-worker')
    
  3. Replace:

    s = BuildSlave(buildmaster_host, port, slavename, passwd, basedir,
                   keepalive, usepty, umask=umask, maxdelay=maxdelay,
                   numcpus=numcpus, allow_shutdown=allow_shutdown)
    

    with:

    s = Worker(buildmaster_host, port, slavename, passwd, basedir,
               keepalive, umask=umask, maxdelay=maxdelay,
               numcpus=numcpus, allow_shutdown=allow_shutdown)