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

Jump to navigation Jump to search
 
(25 intermediate revisions by 3 users not shown)
Line 6: Line 6:
* A buildbot master running as user buildbot on the server.
* A buildbot master running as user buildbot on the server.
* A set of VirtualBox VMs running buildbot slaves.
* A set of VirtualBox VMs running buildbot slaves.
** '''ubuntu32''': i686 deb, i686 static
** '''ubuntu32''' (192.168.5.50): i686 static
** '''ubuntu64''': x86_64 deb, x86_64 static
** '''ubuntu64''' (192.168.5.51): x86_64 static
** '''macosx''': universal (i386+x86_64) dmg with app.
** '''macosx''' (192.168.5.52): universal (i386+x86_64) dmg with app.
** '''win32''': i386 windows static
** '''win32''' (192.168.5.53): i386 windows static
** '''win64''': x64 windows static
** '''win64''' (192.168.5.54): x64 windows static
** '''fedora''': i686 sugar static
** '''fedora''' (192.168.5.55): i686 sugar static (''kiwixdev'')
** '''arm''': armel kiwix-serve static
** '''arm''' (no direct IP. ssh on localhost through port 5022 ''10.0.2.2'' ''192.168.5.56''): armel kiwix-serve static
** '''debian32''' (192.168.5.57): i686 wheezy deb
** '''debian64''' (192.168.5.58): x86_64 wheezy deb
 
=== Usage ===
 
A utility script, ''kbox'' is present to facilitate start and stop of the VMs.
 
<code><pre>(buildbot)buildbot@www:~/buildbot$ kbox --help
Usage: kbox [options]
 
Handy wrapper around virtualbox for kiwix
 
Options:
  -h, --help  show this help message and exit
  --listlocal  list names of VMs. Edit script to change.
  --listall    list all VMs with their status.
  --usb        list all USB devices on the host.
  --startall  start all VMs.
  --stopall    sends shutdown to all VMs.
  --start=VM  starts the VM named [VM].
  --stop=VM    sends shutdown to the VM named [VM].
  --info=VM    displays info for the VM named [VM].
  --ssh=VM    connects via SSH to the VM named [VM].</pre></code>
 
* Example connection to ''ubuntu32'' VM:
<code><pre>kbox --ssh ubuntu32</pre></code>


== Master Setup ==
== Master Setup ==


* Install required packages
* Install required packages
<code><pre># apt-get install build-essential subversion zip unzip python-pip vim python-dev
<code><pre># apt-get install build-essential git zip unzip python-pip vim python-dev
pip install virtualenv virtualenvwrapper</pre></code>
pip install virtualenv virtualenvwrapper</pre></code>
* Create user ''buildbot''
* Create user ''buildbot''
Line 34: Line 60:
buildbot create-master master</pre></code>
buildbot create-master master</pre></code>
* Deploy configuration
* Deploy configuration
<code><pre>svn co https://kiwix.svn.sourceforge.net/svnroot/kiwix/buildbot/ code
<code><pre>git archive --prefix=code/ --remote git://git.code.sf.net/p/kiwix/kiwix HEAD:buildbot | tar x
cd master && ln -sf ../code/master.cfg master.cfg && cd -
cd master && ln -sf ../code/master.cfg master.cfg && cd -
cp code/secret_pass.py master/secret_pass.py</pre></code>
cp code/secret_pass.py master/secret_pass.py</pre></code>
Line 77: Line 103:
* Use whole disk partitioning
* Use whole disk partitioning
* Install packages:
* Install packages:
<code><pre># 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</pre></code>
<code lang="bash"><pre># apt-get install --fix-missing acpi acpid build-essential autoconf automake libtool pkg-config fastjar libssl-dev  
libexpat1-dev libxml2-dev libgnutls-dev libgpg-error-dev libgcrypt-dev uuid-dev libuuid1 git zip unzip python-pip vim python-dev</pre></code>
* Install python tools
* Install python tools
<code><pre># pip install virtualenv virtualenvwrapper</pre></code>
<code><pre># pip install virtualenv virtualenvwrapper</pre></code>
Line 88: Line 115:


export WORKON_HOME=~/envs
export WORKON_HOME=~/envs
source /usr/local/bin/virtualenvwrapper.sh</pre></code>
source /usr/local/bin/virtualenvwrapper.sh
source ${WORKON_HOME}/buildbot/bin/activate</pre></code>
* Log out then log-in again (to activate virtualenvwrapper)
* Log out then log-in again (to activate virtualenvwrapper)
* Create virtualenv
* Create virtualenv
Line 96: Line 124:
* Create the slave
* Create the slave
<code><pre>mkdir -p buildbot && cd buildbot
<code><pre>mkdir -p buildbot && cd buildbot
buildslave create-slave slave SERVER_IP:9989 BUILDER_ID BUILDER_PASS</pre></code>
buildslave create-slave slave 192.168.5.1:9989 ubuntu32 BUILDER_PASS</pre></code>
* Edit files in ''slave/info/'' and put host description and maintainer
* Edit files in ''slave/info/'' and put host description and maintainer
* Start the slave
* Start the slave
Line 102: Line 130:
buildslave start</pre></code>
buildslave start</pre></code>


=== Automatic Startup ===
* ''crontab -e'' on ''dev'' user
<code><pre>@reboot /home/dev/envs/buildbot/bin/buildslave start /home/dev/buildbot/slave</pre></code>


== VirtualBox Setup ==
== VirtualBox Setup ==
Line 111: Line 142:
apt-get install virtualbox-4.1
apt-get install virtualbox-4.1
apt-get install linux-headers
apt-get install linux-headers
/etc/init.d/vboxdrv setup</pre></code>
/etc/init.d/vboxdrv setup
wget -c http://download.virtualbox.org/virtualbox/4.1.14/Oracle_VM_VirtualBox_Extension_Pack-4.1.14-77440.vbox-extpack
VBoxManage extpack install /home/buildbot/vms/Oracle_VM_VirtualBox_Extension_Pack-4.1.14-77440.vbox-extpack</pre></code>


* VMs will be stored in /home/buildbot/vms
* VMs will be stored in /home/buildbot/vms
Line 123: Line 156:
<code><pre>VBoxManage createhd --filename ~/vms/ubuntu32/ubuntu32.vdi --size 20480 --variant Standard</pre></code>
<code><pre>VBoxManage createhd --filename ~/vms/ubuntu32/ubuntu32.vdi --size 20480 --variant Standard</pre></code>


* Create VM
* Create VM (VBoxManage list ostypes for types list)
<code><pre>VBoxManage createvm --register --name ubuntu32 --ostype Ubuntu --basefolder ~/vms/
<code><pre>VBoxManage createvm --register --name ubuntu32 --ostype Ubuntu --basefolder ~/vms/
VBoxManage modifyvm ubuntu32 --memory 512 --audio none --clipboard disabled --usb off --usbehci off --nic1 nat --nictype1 82543GC --nic2 hostonly --nictype2 82543GC --vrde on --boot1 dvd --boot2 disk
VBoxManage modifyvm ubuntu32 --memory 512 --audio none --clipboard disabled --usb off --usbehci off --nic1 nat --nictype1 82543GC --nic2 hostonly --nictype2 82543GC --hostonlyadapter2 vboxnet0 --vrde on --boot1 dvd --boot2 disk
VBoxManage storagectl ubuntu32 --name hdd --add sata --controller IntelAhci --bootable on
VBoxManage storagectl ubuntu32 --name hdd --add sata --controller IntelAhci --bootable on
VBoxManage storagectl ubuntu32 --name cd --add ide --controller PIIX4 --bootable on
VBoxManage storagectl ubuntu32 --name cd --add ide --controller PIIX4 --bootable on
Line 131: Line 164:
VBoxManage storageattach ubuntu32 --storagectl cd --type dvddrive --port 1 --device 1 --medium ~/vms/ubuntu-10.04.4-server-i386.iso
VBoxManage storageattach ubuntu32 --storagectl cd --type dvddrive --port 1 --device 1 --medium ~/vms/ubuntu-10.04.4-server-i386.iso
</pre></code>
</pre></code>
* Start VM & Install System using rdesktop
<code><pre>VBoxManage startvm ubuntu32 --type headless</pre></code>
On your computer, connect with:
<code><pre>rdesktop download.kiwix.org:3389</pre></code>
* Configure Network (eth1) with a static IP according to mapping above in ''/etc/network/interfaces''
<code><pre>iface eth1 inet static
    address    192.168.5.50
    netmask    255.255.255.0
    gateway    192.168.5.1
auto eth1
</pre></code>
* Once installed, tweak the VM
<code><pre>VBoxManage storageattach ubuntu32 --storagectl cd --type dvddrive --port 1 --device 1 --medium none
VBoxManage modifyvm ubuntu32  --vrde off</pre></code>
From now, connection to the VM will be SSH only.


== Post B&W todo ==
== Post B&W todo ==
* Start VM automaticaly/transparently if a compilation is required - otherwise VM is offline.
* Start VM automaticaly/transparently if a compilation is required - otherwise VM is offline.
* Start chained compilations : only the first one is planned, and all other ones occur one by one afterwards.
* Start chained compilations : only the first one is planned, and all other ones occur one by one afterwards.
* Bump code with bumpVersion.sh to have a version like svn-[date]
* Rename bin packages
== Tips ==
* win32 upload issue: VBoxManage modifyvm win32 --natsettings1 1500,64,64,64,1024
* [https://people.debian.org/~aurel32/qemu/armel/ qemu arm VM]

Navigation menu