BuildBot configuration for Maxscale
In order not to pollute the base system with the BuildBot dependencies it is adviced to use the python virtual environment.
- Install python3 dependencies:
sudo apt install python3 python3-pip. - Install pipenv to manage virtual environment:
sudo pip3 install pipenv - Go to the
maxscale-buildbotdirectory and install dependenciespipenv install - Enable virtual environment
pipenv shell.
When done you can leave Python virtual environment by leaving the shell.
If you have installed BuildBot into the virtual environment, then you should either activate environment before running buildbot and buildbot-worker commands, or use absolute paths to them in the virtual environment directory.
For production purposes the BuildBot uses the MariaDB database. Use the following template to create the database:
create database maxscale_buildbot character set utf8 collate utf8_bin;
grant all privileges on maxscale_buildbot.* to buildbot@localhost identified by '<password>';In order to mitigate the issue of short build step names, the database schema must be updated:
ALTER TABLE steps MODIFY name varchar(300);- Clone repository or get a repository slice.
- Install python3 dependencies:
sudo apt install python3 python3-pip. - Install pipenv to manage virtual environment:
sudo pip3 install pipenv - Go to the
maxscale-buildbotdirectory and install dependenciespipenv install - Configure database access in
master/maxscale/config/database_config.pyfile. The template for this file can be found inmaster/maxscale/config/datababes_config.pyfile. - Configure mail client in
master/maxscale/config/mailer_config.pyfile. The template for this file can be found inmaster/maxscale/config/mailer_config_example.pyfile. - Configure github client in
master/maxscale/config/github_client_config.pyfile. The template for this file can be found inmaster/maxscale/config/github_client_config_example.pyfile. - Configure authorization rights for users in
master/maxscale/config/auth_config.pyfile. The template for this file can be found inmaster/maxscale/config/auth_config_example.pyfile. - Configure the list of workers that are allowed to access BuildBot master in
master/maxscale/config/workers.pyfile. The template for this file can be found inmaster/maxscale/config/workers_example.pyfile. - Configure the access name of the server in
master/maxscale/conifg/server_config.pyfile. The template for this file can be found inmaster/maxscale/config/server_config_example.pyfile. - Create or update BuildBot master configuration:
buildbot upgrade-master master - Start the BuildBot master service:
buildbot start master.
You must create the OAuth application in GitHub using the form
The URL of the application must be BUILDBOT_URL/auth/login.
The received client identity and secret must be put into github_client_config.py file.
- Update the repository configuration.
- Reload BuildBot configuration:
buildbot reconfig master.
- Configure the list of workers for the BuildBot master.
- Go to the
worker-managementdirectory and call the./manage.py --help.
- If you wish to install workers on the host
first-hostthen execute./manage.py install --host first-host. - If you with to restart all workers on all hosts then execute
./manage.py restart.
- Clone the repository or get a repository slice.
- Install packages that are required to run the worker:
pip3 install -r worker-management/requirements-worker.txt. - Create configuration for the worker:
buildbot-worker create-worker --umask=0o002 DIRECTORY SERVER NAME PASSWORD, whereDIRECTORY- path to the worker configuration and build directory.SERVER- URI of the server to connect to.NAME- name of the worker as specified on the server.PASSWORD- password for the specified name.--umask- umask for a worker process which determines permission of files created by the worker. The default value for workers is 077. See Worker Options
- Fill-in information about the administrator in
DIRECTORY/info/adminfile. - Fill-in host description in
DIRECTORY/info/hostfile. - Start the worker daemon:
bildbot-worker start DIRECTORY.
In order to efficiently work with the BuildBot codebase you should install development tools:
$ pip install -U -r requirements-development.txt
The common development tasks are automated using the Paver. There are two common tasks automated:
paver check_code- check Python source code with static code linters.paver check_config- check BuildBot master configuration.paver buildbot -c start- run start command for BuildBot in the development mode. You can pass all commands to the BuildBot via this command and-cflag.paver restart_buildbot- restart the BuildBot in the development mode and restartworker-devassociated with the environment. You should create the latter one by youself.
The BuildBot project is based on the Twisted framework and uses it's code standard. Therefore the code of BuildBot configuration must follow this coding standard.
The list of Python packages that are required to install the BuildBot master is stored in Pipfile.lock file. In this file the tested and proved to work versions are specified.
In order to migrate to the newer versions you should use Pipenv update command.
pipenv updateWhen the Pipfile.lock file has been updated, the dependencies should be installed.
pipenv install- Activate the virtual environment:
pipenv shell. - Restart the BuildBot master in order to activate installed dependencies:
buildbot restart master.
The same should be done to the worker requirements file, requirements-worker.txt.