This guide is to show you how to deploy a MeeGo-enabled OBS appliance with two built-in workers in a virtualized environment for developing for and with MeeGo. The tips is based on http://en.opensuse.org/openSUSE:Build_Service_Appliance and I've tested this within VirtualBox.
You'll need a Virtual Machine like this:
This can also be a physical machine with a physical disk where obs-server.i686-2.0.105-Build1.1.raw.bz2 (bunzipped and dd'ed to a USB stick) can be used as boot device.
Power on the machine. At the first setup the image will set itself up to fit with the machine. You'll arrive at a login: prompt where you can log in as 'root'
We need to set up LVM on the virtual disk, sdb. Log in as root and run: (WARNING: this will erase your 'sdb' disk)
# This will partition your disk sfdisk /dev/sdb << EOF ,,8e EOF # This will set up LVM with various file systems. You can adjust sizes as wished. pvcreate /dev/sdb1 vgcreate "OBS" /dev/sdb1 lvcreate -L 50G -n "server" /dev/OBS vgscan mkfs /dev/OBS/server lvcreate -L 20G -n "cache" OBS vgscan mkfs /dev/OBS/cache lvcreate -L 4G -n "worker_root_1" /dev/OBS lvcreate -L 4G -n "worker_root_2" /dev/OBS lvcreate -L 512M -n "worker_swap_1" /dev/OBS lvcreate -L 512M -n "worker_swap_2" /dev/OBS vgscan mkfs /dev/OBS/worker_root_1 mkfs /dev/OBS/worker_root_2
Run the following commands on the machine:
# Install QEMU for ARM support and git. This will ask you a couple of times to accept a repository key zypper install qemu-svn git # This will indicate to the OBS which architectures to work with (ARMv7 and i586) sed s/OBS_SCHEDULER_ARCHITECTURES=\"i586 x86_64\"/OBS_SCHEDULER_ARCHITECTURES=\"i586 armv7el\"/g /etc/sysconfig/obs-server # This will reboot the virtual machine to pick up the LVM partitions from before shutdown -h now
After the reboot, log in as root and do the following commands:
mkdir -p /obs/imports mkdir -p /obs/build ln -s /obs/build /srv/obs/build
A MeeGo release is approximately 4-5 gb each - and this is even without the debug symbols.
Run the following command - this will set up a script which is handy to import MeeGo releases in the future:
cat > /usr/sbin/import-meego-release.sh << EOF #!/bin/sh -e # # SYNTAX: import-meego-release.sh <RELEASE NUMBER> <DOWNLOAD LOCATION> # Example: import-meego-release.sh 188.8.131.52.20101005.1 rsync://mirrors.kernel.org/meego/builds/1.0.99/ # This will set up a OBS project MeeGo:RELEASE NUMBER:Core # You might have to use login for OBS, that is, login Admin password opensuse # Download the RPMs mkdir -p /obs/imports/MeeGo_$1/core/ for x in ia32 armv7l do mkdir -p /obs/imports/MeeGo_$1/core/$x/ cd /obs/imports/MeeGo_$1/core/$x/ rsync -a --progress $2/$1/core/repos/$x/packages/* . done # Set up symlinks to packages mkdir -p /obs/build/MeeGo:$1:Core/standard/i586/:full cd /obs/build/MeeGo:$1:Core/standard/i586/:full find /obs/imports/MeeGo_$1/core/ia32/ -name *.rpm | xargs -I@ ln @ . mkdir -p /obs/build/MeeGo:$1:Core/standard/armv7el/:full cd /obs/build/MeeGo:$1:Core/standard/armv7el/:full find /obs/imports/MeeGo_$1/core/armv7l/ -name *.rpm | xargs -I@ ln @ . chown -R obsrun:obsrun /obs/build/ chown -R obsrun:obsrun /obs/imports/ # Set up prj information in OBS osc -A http://localhost:81 meta prj -F - MeeGo:$1:Core << OTHEREOF <project name="MeeGo:$1"> <title/> <description/> <build> <enable/> </build> <repository name="standard"> <arch>armv7el</arch> <arch>i586</arch> </repository> </project> OTHEREOF for x in i586 armv7el do /usr/lib/obs/server/bs_admin --rescan-repository MeeGo:$1:Core standard $x done echo "MeeGo:$1:Core imported into OBS, after rescan is done." EOF chmod +x /usr/sbin/import-meego-release.sh
Now, go to http://mirrors.kernel.org/meego/ , find a release that suits you. For example, http://mirrors.kernel.org/meego/builds/1.0.99/184.108.40.206.20101005.1/
You'd then need to (please note the http to rsync change):
/usr/sbin/import-meego-release.sh 220.127.116.11.20101005.1 rsync://mirrors.kernel.org/meego/builds/1.0.99/
And it'll import the release.
In addition to that, you now need to set up a prjconf. A prjconf basically is a bunch of settings determining how to resolve dependancies, build settings and so on.
Currently these are not exported in the release directories (bug 8121), so you will have to do it manually.
These prjconfs are hosted in a git repository, http://git.gitorious.org/meego-developer-tools/obs-project-config.git
On your OBS machine, do the following:
git clone http://git.gitorious.org/meego-developer-tools/obs-project-config.git ls obs-project-config
You then need to decide which one matches with your release. Trunk is the one for the next version being released (check http://wiki.meego.com/Release_Engineering ). MeeGo:1.0:Core and MeeGo:1.1:Core would qualify for 1.0 and 1.1.
Then, when you have figured out this, you can then do, if 1.1 was the release we imported and we wanted MeeGo:1.1:Core:
osc -A http://localhost:81 meta prj -F obs-project-config/MeeGo:1.1:Core MeeGo:1.1:Core
And now your release is ready to go as a build target!
You can now using 'ifconfig eth0 ' at the root prompt of your OBS figure out what IP your OBS appliance has.
Then, you can log into, where IP is the IP in question:
http://IP/ - the web interface for your own OBS :)
http://IP:81/ - API interface, used in 'osc' commands - and also to make new users and change your administrator password
http://IP:82/ - repository, used for downloading final packages
The default user name is 'Admin' and password is 'opensuse', - please log in on http://IP/ - remember to change your administrator password eventually!
At the right hand side top there's a "Admin" link. Click this. This will get you to your 'home project'.
What we will do is to add a 'build target' which is basically the MeeGo release we just imported :)
Click "Repositories" and "Add repositories". "pick one via advanced interface".
In Project, start writing MeeGo: and select the MeeGo:RELEASE:Core that you have just imported.
Enable architectures i586 and armv7el, and no other. The build target should now show up.
In the home project, click 'Packages', Add a new package, set up the package name (this occasionally matters so be sure to get it right).
Then, in 'Source files' you can upload the .spec, tarball, patches, etc.
In 'Overview' you can now follow the build progress.