Difference between revisions of "Black&White Project/Compilation Farm/Setup"

From Kiwix
Jump to navigation Jump to search
Line 16: Line 16:
== Master Setup ==
== Master Setup ==


* Install required packages
<code><pre># apt-get install build-essential subversion zip unzip python-pip vim python-dev
pip install virtualenv virtualenvwrapper</pre></code>
* Create user ''buildbot''
* Log-in as user buildbot
* Edit ''.bashrc'' and add at the end
<code><pre>export EDITOR="vim -v"
export WORKON_HOME=~/envs
source /usr/local/bin/virtualenvwrapper.sh</pre></code>
* Log-out then log-in to enable virtualenvwrapper
* Create virtualenv
<code><pre>mkvirtualenv --no-site-packages buildbot
mkdir -p buildbot && cd buildbot</pre></code>
* Install builbot and create master
<code><pre>easy_install buildbot
buildbot create-master master</pre></code>
* Deploy configuration
<code><pre>svn co https://kiwix.svn.sourceforge.net/svnroot/kiwix/buildbot/ code
cd master && ln -sf ../code/master.cfg master.cfg && cd -
cp code/secret_pass.py master/secret_pass.py</pre></code>
* Edit the password file in ''master/secret_pass.py''
* Start the master
<code><pre>buildbot start master</pre></code>


== Slave Setup ==
== Slave Setup ==

Revision as of 18:23, 3 May 2012

Organization

The Compilation Farm is installed on the download.kiwix.org server. It is organized as:

  • A buildbot master running as user buildbot on the server.
  • A set of VirtualBox VMs running buildbot slaves.
    • ubuntu32: i686 deb, i686 static
    • ubuntu64: x86_64 deb, x86_64 static
    • macosx: universal (i386+x86_64) dmg with app.
    • win32: i386 windows static
    • win64: x64 windows static
    • fedora: i686 sugar static
    • arm: armv5 kiwix-serve static

Master Setup

  • Install required packages
# apt-get install build-essential subversion zip unzip python-pip vim python-dev
pip install virtualenv virtualenvwrapper
  • Create user buildbot
  • Log-in as user buildbot
  • Edit .bashrc and add at the end
export EDITOR="vim -v"

export WORKON_HOME=~/envs
source /usr/local/bin/virtualenvwrapper.sh
  • Log-out then log-in to enable virtualenvwrapper
  • Create virtualenv
mkvirtualenv --no-site-packages buildbot
mkdir -p buildbot && cd buildbot
  • Install builbot and create master
easy_install buildbot
buildbot create-master master
  • Deploy configuration
svn co https://kiwix.svn.sourceforge.net/svnroot/kiwix/buildbot/ code
cd master && ln -sf ../code/master.cfg master.cfg && cd -
cp code/secret_pass.py master/secret_pass.py
  • Edit the password file in master/secret_pass.py
  • Start the master
buildbot start master

Slave Setup

buildbot slave does not require much: a working python/setuptools environnment.

Linux Slave Setup

  • Create a VirtualBox VM
  • Install Ubuntu 10.04.4 (Newer versions of Ubuntu uses a recent glibc)
  • Select OpenSSH server during install.
  • Create a regular user (dev)
  • Use whole disk partitioning
  • Install packages:
# apt-get install --fix-missing build-essential autoconf automake libtool pkg-config fastjar libssl-dev libexpat1-dev libxml2-dev libgnutls-dev libgpg-error-dev libgcrypt-dev uuid-dev libuuid1 subversion zip unzip python-pip vim python-dev
  • Install python tools
# pip install virtualenv virtualenvwrapper

From now, you won't need root privileges anymore.

  • Log in as dev user
  • Edit ~.bashrc and add at the end
export EDITOR="vim -v"

export WORKON_HOME=~/envs
source /usr/local/bin/virtualenvwrapper.sh
  • Log out then log-in again (to activate virtualenvwrapper)
  • Create virtualenv
mkvirtualenv --no-site-packages buildbot
  • Install buildbot
easy_install buildbot-slave
  • Create the slave
mkdir -p buildbot && cd buildbot
buildslave create-slave slave SERVER_IP:9989 BUILDER_ID BUILDER_PASS
  • Edit files in slave/info/ and put host description and maintainer
  • Start the slave
cd slave/
buildslave start