docs: Move documentation of worker upgrading to a single document

This commit is contained in:
Povilas Kanapickas
2020-06-14 17:52:39 +03:00
parent 91aa1a513f
commit b96b716867
3 changed files with 52 additions and 108 deletions

View File

@@ -285,109 +285,3 @@ Worker TLS Configuration
.. _ConnectionStrings: https://twistedmatrix.com/documents/current/core/howto/endpoints.html
.. _clientFromString: https://twistedmatrix.com/documents/current/api/twisted.internet.endpoints.clientFromString.html
.. _Upgrading-an-Existing-Worker:
Upgrading an Existing Worker
----------------------------
.. _Worker-Version-specific-Notes:
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 :file:`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 :file:`buildbot.tac` is simple.
On line 3, replace:
.. code-block:: python
from buildbot.slave.bot import BuildSlave
with:
.. code-block:: python
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
.. code-block:: bash
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 :file:`buildbot.tac` in the following way:
1. Replace:
.. code-block:: python
from buildslave.bot import BuildSlave
with:
.. code-block:: python
from buildbot_worker.bot import Worker
2. Replace:
.. code-block:: python
application = service.Application('buildslave')
with:
.. code-block:: python
application = service.Application('buildbot-worker')
3. Replace:
.. code-block:: python
s = BuildSlave(buildmaster_host, port, slavename, passwd, basedir,
keepalive, usepty, umask=umask, maxdelay=maxdelay,
numcpus=numcpus, allow_shutdown=allow_shutdown)
with:
.. code-block:: python
s = Worker(buildmaster_host, port, slavename, passwd, basedir,
keepalive, umask=umask, maxdelay=maxdelay,
numcpus=numcpus, allow_shutdown=allow_shutdown)
See :ref:`Transition to "Worker" Terminology <Worker-Transition-Buildbot-Worker>` for details of changes in version Buildbot ``0.9.0``.

View File

@@ -212,6 +212,55 @@ The old ``c['logHorizon']`` way of configuring is not supported anymore.
See :bb:configurator:`JanitorConfigurator` to learn how to configure.
A new ``__Janitor`` builder will be created to help keep an eye on the cleanup activities.
Upgrading worker
----------------
Upgrading worker requires updating the :file:`buildbot.tac` file to use the new APIs.
The easiest solution is to simply delete the worker directory and re-run ``buildbot-worker create-worker`` to get the stock `buildbot.tac`.
If the loss of the cached worker state is a problem, then the `buildbot.tac` can be updated manually:
1. Replace:
.. code-block:: python
from buildslave.bot import BuildSlave
with:
.. code-block:: python
from buildbot_worker.bot import Worker
2. Replace:
.. code-block:: python
application = service.Application('buildslave')
with:
.. code-block:: python
application = service.Application('buildbot-worker')
3. Replace:
.. code-block:: python
s = BuildSlave(buildmaster_host, port, slavename, passwd, basedir,
keepalive, usepty, umask=umask, maxdelay=maxdelay,
numcpus=numcpus, allow_shutdown=allow_shutdown)
with:
.. code-block:: python
s = Worker(buildmaster_host, port, slavename, passwd, basedir,
keepalive, umask=umask, maxdelay=maxdelay,
numcpus=numcpus, allow_shutdown=allow_shutdown)
More Information
----------------

View File

@@ -1,2 +1,3 @@
For information on ugprading a worker, see the section "Upgrading an
Existing Worker" in the buildbot documentation.
For information on ugprading Buildbot, see the section "Upgrading" in the buildbot documentation.
This may be found locally in docs/manual/upgrading/index.rst of the buildbot-master package.