This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

{i} Note those instructions are deprecated, see BuildBrigade/DocsAndGuides for uptodate instructions.

Gnome Buildbot Installation

OlavVitters: Some script to handle below things would be really nice to get say 50+ slaves provides by various users :-)

Gnome Buildbot Slave Installation

0. Ensure you have python >= 2.3 installed in your system.

1. Create a user account for the slave (i.e. gnomeslave or buildslave).

OlavVitters: Should decide on a username and use that for all machines.

2. Create the following directory structure (this is not mandatory, but helps with keeping things clean and easy to maintain):

   # Directory where Gnome-Buildbot scripts will be deployed (<gnome>)
   $ mkdir -p ~/gnome

   # Directories for the actual build process (<work>)
   $ mkdir -p ~/gnome/work/src
   $ mkdir -p ~/gnome/work/bin
   $ mkdir -p ~/gnome/work/slaves

   # Directory to keep downloaded sources (<sources>)
   $ mkdir ~/sources   

3. Download and unpack Buildbot to the <sources> directory.

4. Download and unpack Twisted to the <sources> directory.

OlavVitters: I want a RHEL5 RPM from a trusted source.

5. Install Twisted in the slave user account:

  $ cd ~/<sources>/Twisted-2.5.0/zope.interface-3.3.0/
  $ python ./setup.py build
  $ python ./setup.py install --home=~
  $ cat << END >> ~/.bashrc
  
  export PATH=~/bin:$PATH
  export PYTHONPATH=$PYTHONPATH:~/lib/python
  export LANG=C
  export LANGUAGE=C
  END
  $ . ~/.bashrc
  $ cd ..
  $ python ./setup.py build
  $ python ./setup.py install --home=~

6. Install Buildbot in the slave user account.

  $ cd ~/<sources>/buildbot-0.7.5/
  $ python ./setup.py build
  $ python ./setup.py install --home=~

7. Download jhbuild in <sources>:

  $ cd ~/<sources>
  $ svn co http://svn.gnome.org/svn/jhbuild/trunk ./jhbuild

8. Install jhbuild and edit ~/.jhbuildrc to fit your deployment.

  $ cd ~/<sources>/jhbuild
  $ make -f Makefile.plain install

  makeclean = 'yes'
  alwaysautogen = True
  checkout_mode = 'clobber'
  os.environ['CFLAGS'] = '-g3 -O0 -fprofile-arcs -ftest-coverage'
  os.environ['CXXFLAGS'] = '-g -O0 -fprofile-arcs -ftest-coverage'
  os.environ['CPPFLAGS'] = '-g -O0 -fprofile-arcs -ftest-coverage'

  # Uncomment this if you are using gcc 4.1 (not tested with gcc 4.0)
  # os.environ['LDFLAGS'] = '-lgcov'

9. Run jhbuild bootstrap as the slave user.

10. Install lcov in your system. This is used for code coverage statistics.

11. Install xvfb in your system. This is used to provide an X server for those modules which run tests that require one.

OlavVitters: Need a RHEL5 script.

12. Download Gnome-Buildbot scripts:

  $ cd <sources>
  $ cvs -d :pserver:anonymous@cvs.igalia.com:/var/publiccvs co jhbuild-buildbot-scripts 

OlavVitters: Please provide your SVN username and a CVS dump of above and I'll set it up. Send an email to svnmaster@gnome.org and provide a LINK to the CVS dump.

13. Copy the files under the "slave" subdirectory to the <gnome> directory. Also, copy the files under the "slave/scripts" subdir to the ~/bin directory.

OlavVitters: I want to avoid above&below step. I want to be able to only update the SVN checkout and have the slave do the right thing.

14. Copy the buildslave.list file to the <gnome> directory.

OlavVitters: Why can't this file also be in SVN?

15. Setup the multislave.cfg file to fit your deployment.

16. Edit ~/bin/module-reports.sh script.

     export REPORTSDIR="/var/www/gnomebuild"
     export REPORTSURL="http://buildbot.gnome.org/gnomebuild"

17. Setup a webserver that properly servers REPORTSURL. The web view in the master will link that kind of URLs to access code coverage statistics.

18. Start the slaves with make start and stop them with make stop.

    $ cd <gnome>
    $ make start && tail -f twistd.log
    ...
    $ make stop

19. Under ~/<gnome> directory, Twisted will create log files that should be deleted after some time to limit the amount of disk being used. You'd probably want to create a cron task to remove all obsolete log files. Something like this should do the trick:

    DAYS=14
    cd <work>/slaves && find . -mindepth 3 -type f -mtime +${DAYS} -exec rm {} \;
    cd <gnome> && find twistd.log.* -mtime +${DAYS} -exec rm {}\;

20. Install check >= 0.9.2. Check is probably included in your Linux distro, so, for example, in the case of debian, just get it with apt-get install check.

Gnome Buildbot Master Installation

0. Ensure you have python >= 2.3 installed in your system.

1. Create a user account for the master (i.e. gnomemaster or buildmaster).

2. Create the following directory structure (this is not mandatory, but helps with keeping things clean and easy to maintain):

   # Directory where Gnome-Buildbot scripts will be deployed (<gnome>)
   $ mkdir -p ~/gnome

   # Directories for the master work (<work>)
   $ mkdir -p ~/gnome/work/src
   $ mkdir -p ~/gnome/work/bin
   $ mkdir -p ~/gnome/work/masters

   # Directory to keep downloaded sources (<sources>)
   $ mkdir ~/sources   

   # Directories to keep www resources (<www>)
   $ mkdir -p ~/www/css
   $ mkdir -p ~/www/images

3. Download and unpack Buildbot to the <sources> directory.

4. Download and unpack Twisted to the <sources> directory.

5. Install Twisted in the master user account:

  $ cd ~/<sources>/Twisted-2.5.0/zope.interface-3.3.0/
  $ python ./setup.py build
  $ python ./setup.py install --home=~
  $ cat << END >> ~/.bashrc
  
  export PATH=~/bin:$PATH
  export PYTHONPATH=$PYTHONPATH:~/lib/python
  export LANG=C
  export LANGUAGE=C
  END
  $ . ~/.bashrc
  $ cd ..
  $ python ./setup.py build
  $ python ./setup.py install --home=~

6. Install Buildbot in the master user account.

  $ cd ~/<sources>/buildbot-0.7.5/

diff -ruP ./buildbot/status/html.py ../buildbot-0.7.5.patched/buildbot/status/html.py
--- ./buildbot/status/html.py   2006-12-11 06:40:11.000000000 +0100
+++ ../buildbot-0.7.5.patched/buildbot/status/html.py   2007-05-10 18:11:37.000000000 +0200
@@ -1114,7 +1114,7 @@
             return self.phase0(request, (changeNames + builderNames),
                                timestamps, eventGrid)
         # start the table: top-header material
-        data += '<table border="0" cellspacing="0">\n'
+        data += '<table border="0" cellspacing="2" cellpadding="4">\n'

         if projectName and projectURL:
             # TODO: this is going to look really ugly

  $ python ./setup.py build
  $ python ./setup.py install --home=~

7. Download and install jhbuild:

  $ cd ~/<sources>
  $ svn co http://svn.gnome.org/svn/jhbuild/trunk jhbuild
  $ cd jhbuild
  $ make && make install

8. Setup your ~/.jhbuildrc file to fit your deployment.

9. Download Gnome-Buildbot scripts:

  $ cd ~/<sources>
  $ cvs -d :pserver:anonymous@cvs.igalia.com:/var/publiccvs co jhbuild-buildbot-scripts 

10. Copy the files under the "master" directory to the <gnome> directory. Also, overwrite default buildbot css file with the one under "master/style":

  $ cp ~/<sources>/jhbuild-buildbot-scripts/master/* ~/<gnome>
  $ cp ~/<sources>/jhbuild-buildbot-scripts/master/style/classic.css ~/<www>/css/classic.css
  $ cp ~/<sources>/jhbuild-buildbot-scripts/master/style/*.png ~/<www>/images/

11. Setup the ~/<gnome>/multimaster.cfg file to fit your deployment.

12. Execute the update-buildmasters script:

  $ cd ~/<gnome>
  $ ./update-buildmasters

13. Start the master with make start and stop it with make stop.

    $ cd ~/<gnome>
    $ make start && tail -f twistd.log
    ...
    $ make stop

14. You can access your web frontend using http://<host>:<port>/, where:

15. Under ~/<gnome> directory, Twisted and Buildbot will create log files that should be deleted after some time to limit the amount of disk being used. You'd probably want to create a cron task to remove all obsolete log files. Something like this should do the trick:

    DAYS=14
    cd <work>/masters && find . -mindepth 3 -type f -mtime +${DAYS} -exec rm {} \;
    cd <gnome> && find twistd.log.* -mtime +${DAYS} -exec rm {}\;

2024-10-23 11:00