Difference between revisions of "Buildbot Network"

From MythTV Official Wiki
Jump to: navigation, search
(Can't force a build in IRC with buildbot >= 0.9)
(17 intermediate revisions by 5 users not shown)
Line 9: Line 9:
 
* Ubuntu LTS
 
* Ubuntu LTS
 
* Fedora
 
* Fedora
 +
* FreeBSD
 +
* OS X
 
* RHEL/Centos6 is not an option due to the Qt version being too old.
 
* RHEL/Centos6 is not an option due to the Qt version being too old.
  
=== Build Master ===
+
Architecture Support:
 +
 
 +
* i386
 +
* x86_64
 +
* arm (currently armhf, armv6, armv7hl)
 +
 
 +
== Build Master ==
  
 
You can look at the progress of current builds or the history of the most recent builds by visiting [https://code.mythtv.org/buildbot BuildMaster]. I'd recommend either the waterfall or console pages.
 
You can look at the progress of current builds or the history of the most recent builds by visiting [https://code.mythtv.org/buildbot BuildMaster]. I'd recommend either the waterfall or console pages.
  
=== Setting up a build slave ===
+
== Setting up a build slave ==
  
 
Setting up a build slave is a relatively simple process. If you have a server capable of running a virtual machine or three, then offers of buildslaves are always welcome. Please contact the developers via IRC #mythtv on freenode.
 
Setting up a build slave is a relatively simple process. If you have a server capable of running a virtual machine or three, then offers of buildslaves are always welcome. Please contact the developers via IRC #mythtv on freenode.
  
==== Basic VM configuration ====
+
=== Basic VM configuration ===
  
 
* 1x CPU
 
* 1x CPU
* 2Gb RAM
+
* 2Gb RAM (preferred, can work with less)
* 8Gb OS Disk
+
* 16Gb OS Disk
 
* 50Gb /home
 
* 50Gb /home
  
 
Notes:
 
Notes:
* 2GB of RAM is required as tv_rec.cpp can take an extremely long time to build and/or timeout the build when running only 1Gb ram
 
 
* 50Gb /home is sufficient to hold at least 3 different builds as well as the whole 10Gb ccache
 
* 50Gb /home is sufficient to hold at least 3 different builds as well as the whole 10Gb ccache
  
==== Installation ====
+
== Installation ==
  
Install the operating system you are planning to use, along with all the required packages. Here are a few recipies for setting up buildslaves
+
Install the operating system you are planning to use.
  
* [[Buildslave Debian]]
+
=== Automated Method (Recommended) ===
* [[Buildslave Ubuntu]]
 
* [[Buildslave Fedora]]
 
* [[Buildslave Fedora Qt5]]
 
  
You should also create a buildslave user, and configure ccache to be allowed to use 10Gb of cache '''ccache -M 10G'''
+
(For CentOS first install epel-release)<br>
 +
Install the ansible, ansible-extras (if a separate package on your distro) and git packages, then clone the MythTV ansible repository
  
==== Connecting to the build network ====
+
    $ git clone https://github.com/MythTV/ansible.git
  
For this you will need to talk to the developers on IRC again. You should create a passwordless ssh key for your buildslave user, this will need to be added to allow the builder to checkout the code from our git repository.
+
Then as root, change into the directory where the playbooks were checked out to and run
  
You will be provided with the following pieces of information
+
    # ansible-playbook -i hosts buildslave.yml
  
* your buildslave's name
+
This will install all the packages required, as well as configuring ccache and setting up the startup script to start the buildslave when the server starts. All that is left to do is configure the buildslave. Continue from the step "Connecting to the build network"
* the password assigned to your buildslave
 
* the hostname and port number of the buildmaster, i.e. buildbot.example.org:8007
 
  
==== Create the buildslave ====
+
=== Manual Method ===
  
run the 'buildslave' command as follows
+
Here is some information on setting up buildslaves by hand
  
  buildslave create-slave BASEDIR MASTERHOST:PORT SLAVENAME PASSWORD
+
* [[Buildslave Debian]]
 +
* [[Buildslave Ubuntu]]
 +
* [[Buildslave Fedora]]
  
I suggest using mythtv as your BASEDIR. Please make sure you edit info/host and info/admin in your BASEDIR so we know some information about your buildslave and your contact details
+
You should also create a buildslave user, and configure ccache to be allowed to use 10Gb of cache '''ccache -M 10G'''
  
Then a build can be forced by talking to MythBuild on irc in #mythtv-commits
+
==== Autostart on boot ====
  
  MythBuild: force build <buildslave_name> <message>
+
''NOTE: Only required if you used the manual installation method''
  
==== Autostart on boot ====
+
Configuring the buildslave to autostart on system boot is a very simple step. Create a script '''~/bin/start-buildslave.sh''' with the following contents if you are using buildbot < 0.9
 
 
Configuring the buildslave to autostart on system boot is a very simple step. Create a script '''~/bin/start-buildslave.sh''' with the following contents
 
  
 
   #!/bin/bash
 
   #!/bin/bash
Line 71: Line 74:
 
   /usr/bin/buildslave stop
 
   /usr/bin/buildslave stop
 
   exec /usr/bin/buildslave start
 
   exec /usr/bin/buildslave start
 +
 +
Or this if you are using buildbot >= 0.9
 +
 +
  #!/bin/bash
 +
  cd ~/mythtv
 +
  /usr/bin/buildbot-worker stop
 +
  exec /usr/bin/buildbot-worker start
  
 
Notes:
 
Notes:
Line 80: Line 90:
  
 
   @reboot /home/buildslave/bin/start-buildslave.sh
 
   @reboot /home/buildslave/bin/start-buildslave.sh
 +
 +
 +
== Connecting to the build network ==
 +
 +
For this you will need to talk to the developers on IRC again. You should create a passwordless ssh key for your buildslave user, this will need to be added to allow the builder to checkout the code from our git repository.
 +
 +
You will be provided with the following pieces of information
 +
 +
* your buildslave's name
 +
* the password assigned to your buildslave
 +
* the hostname and port number of the buildmaster, i.e. buildbot.mythtv.org:9989
 +
 +
=== Configure the buildslave ===
 +
 +
Run the 'buildslave' command as follows for buildbot < 0.9
 +
 +
  # su - buildslave
 +
  $ mkdir mythtv
 +
  $ buildslave create-slave mythtv buildbot.mythtv.org:9989 SLAVENAME PASSWORD
 +
  $ ssh git@code.mythtv.org ''(accept the host key otherwise you will get git failures on builds.)''
 +
                            ''(Also check it completes the connection and outputs the git repos available.)''
 +
 +
Or like this for buildbot >= 0.9
 +
 +
  # su - buildslave
 +
  $ mkdir mythtv
 +
  $ buildbot-worker create-worker mythtv buildbot.mythtv.org:9989 SLAVENAME PASSWORD
 +
  $ ssh git@code.mythtv.org ''(accept the host key otherwise you will get git failures on builds.)''
 +
                            ''(Also check it completes the connection and outputs the git repos available.)''
 +
 +
Please make sure you edit info/host and info/admin in ~buildslave/mythtv so we know some information about your buildslave and your contact details.
 +
NOTE: The startup script installed by the automated method will automatically populate info/host at startup
 +
 +
buildslave needs to be started if not already running by either reboot, or by running the following as the buildslave user
 +
 +
    ~/bin/start-buildslave.sh

Revision as of 15:53, 11 January 2019

Buildbot Network

stuarta 13:35, 3 March 2014 (UTC)

MythTV uses an extensive set of buildslaves, running different operating systems, different versions of Qt (Qt4 & Qt5) as well as different compilers. The aim of this is to validate all changesets do not affect our ability to build on the different platforms.

The intention is to ensure that MythTV will build and run on all the current distro flavours, and in particular on the long term stable variants. eg.

  • Debian Stable
  • Ubuntu LTS
  • Fedora
  • FreeBSD
  • OS X
  • RHEL/Centos6 is not an option due to the Qt version being too old.

Architecture Support:

  • i386
  • x86_64
  • arm (currently armhf, armv6, armv7hl)

Build Master

You can look at the progress of current builds or the history of the most recent builds by visiting BuildMaster. I'd recommend either the waterfall or console pages.

Setting up a build slave

Setting up a build slave is a relatively simple process. If you have a server capable of running a virtual machine or three, then offers of buildslaves are always welcome. Please contact the developers via IRC #mythtv on freenode.

Basic VM configuration

  • 1x CPU
  • 2Gb RAM (preferred, can work with less)
  • 16Gb OS Disk
  • 50Gb /home

Notes:

  • 50Gb /home is sufficient to hold at least 3 different builds as well as the whole 10Gb ccache

Installation

Install the operating system you are planning to use.

Automated Method (Recommended)

(For CentOS first install epel-release)
Install the ansible, ansible-extras (if a separate package on your distro) and git packages, then clone the MythTV ansible repository

   $ git clone https://github.com/MythTV/ansible.git

Then as root, change into the directory where the playbooks were checked out to and run

   # ansible-playbook -i hosts buildslave.yml

This will install all the packages required, as well as configuring ccache and setting up the startup script to start the buildslave when the server starts. All that is left to do is configure the buildslave. Continue from the step "Connecting to the build network"

Manual Method

Here is some information on setting up buildslaves by hand

You should also create a buildslave user, and configure ccache to be allowed to use 10Gb of cache ccache -M 10G

Autostart on boot

NOTE: Only required if you used the manual installation method

Configuring the buildslave to autostart on system boot is a very simple step. Create a script ~/bin/start-buildslave.sh with the following contents if you are using buildbot < 0.9

  #!/bin/bash
  cd ~/mythtv
  /usr/bin/buildslave stop
  exec /usr/bin/buildslave start

Or this if you are using buildbot >= 0.9

  #!/bin/bash
  cd ~/mythtv
  /usr/bin/buildbot-worker stop
  exec /usr/bin/buildbot-worker start

Notes:

  • The stop is not a mistake. The stop causes the buildslave to cleanup any old PID files that are present which would otherwise prohibit the buildslave from starting

Then chmod +x ~/bin/start-buildslave.sh.

Next edit crontab to start it at boot time. As the buildslave user run crontab -e and add the following line

 @reboot /home/buildslave/bin/start-buildslave.sh


Connecting to the build network

For this you will need to talk to the developers on IRC again. You should create a passwordless ssh key for your buildslave user, this will need to be added to allow the builder to checkout the code from our git repository.

You will be provided with the following pieces of information

  • your buildslave's name
  • the password assigned to your buildslave
  • the hostname and port number of the buildmaster, i.e. buildbot.mythtv.org:9989

Configure the buildslave

Run the 'buildslave' command as follows for buildbot < 0.9

  # su - buildslave
  $ mkdir mythtv
  $ buildslave create-slave mythtv buildbot.mythtv.org:9989 SLAVENAME PASSWORD
  $ ssh git@code.mythtv.org (accept the host key otherwise you will get git failures on builds.) 
                            (Also check it completes the connection and outputs the git repos available.)

Or like this for buildbot >= 0.9

  # su - buildslave
  $ mkdir mythtv
  $ buildbot-worker create-worker mythtv buildbot.mythtv.org:9989 SLAVENAME PASSWORD
  $ ssh git@code.mythtv.org (accept the host key otherwise you will get git failures on builds.) 
                            (Also check it completes the connection and outputs the git repos available.)

Please make sure you edit info/host and info/admin in ~buildslave/mythtv so we know some information about your buildslave and your contact details. NOTE: The startup script installed by the automated method will automatically populate info/host at startup

buildslave needs to be started if not already running by either reboot, or by running the following as the buildslave user

   ~/bin/start-buildslave.sh