(replaced vmdk recommendation with raw as vmdk was giving several people headaches. Also added link to qemu-img docs.) |
(→Step 1: Boot the VM and set up the virtual harddisk with LVM: added password which is required for new server image versions.) |
||
| (3 intermediate revisions not shown) | |||
| Line 2: | Line 2: | ||
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. | 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. | ||
| + | A more complete document to setup a private OBS in a production environment can be found [http://en.opensuse.org/openSUSE:Build_Service_private_instance here]. | ||
You'll need a Virtual Machine like this: | You'll need a Virtual Machine like this: | ||
| Line 7: | Line 8: | ||
* At least 1 GB of ram | * At least 1 GB of ram | ||
* Host must support SSSE3 instructions | * Host must support SSSE3 instructions | ||
| - | * As IDE primary master ('sda' in machine), latest obs-server.i686-XXXXXX.raw.bz2 from http://download.opensuse.org/repositories/openSUSE:/Tools:/Unstable/images/ . Unpacking it will give you a raw file to use or convert with [http://wiki.qemu.org/download/qemu-doc.html#qemu_005fimg_005finvocation qemu-img] to fit with your virtualization software. | + | * As IDE primary master ('sda' in machine), latest obs-server.i686-XXXXXX.raw.bz2 from http://download.opensuse.org/repositories/openSUSE:/Tools:/Unstable/images/ . Unpacking it will give you a raw file to use, or convert with [http://wiki.qemu.org/download/qemu-doc.html#qemu_005fimg_005finvocation qemu-img] to fit with your virtualization software. |
* At least 90 gb virtual harddisk, mounted as IDE secondary master (appearing as 'sdb' in machine') | * At least 90 gb virtual harddisk, mounted as IDE secondary master (appearing as 'sdb' in machine') | ||
* And it must be linked to an actual local network with proper DNS and gateway (no VM NAT) - don't have it on a public network as it opens ports to everyone. Also, ideally your DHCP should give you a proper FQDN. | * And it must be linked to an actual local network with proper DNS and gateway (no VM NAT) - don't have it on a public network as it opens ports to everyone. Also, ideally your DHCP should give you a proper FQDN. | ||
| Line 17: | Line 18: | ||
== Step 1: Boot the VM and set up the virtual harddisk with LVM == | == Step 1: Boot the VM and set up the virtual harddisk with LVM == | ||
| - | 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' | + | 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' and the password is 'opensuse'. |
We need to set up LVM on the virtual disk, sdb. Log in as root and run: ('''WARNING:''' this will erase your 'sdb' disk) | We need to set up LVM on the virtual disk, sdb. Log in as root and run: ('''WARNING:''' this will erase your 'sdb' disk) | ||
| Line 67: | Line 68: | ||
</pre> | </pre> | ||
| - | You should now assign some DNS record to this IP. Note down the FQDN you create (fully qualified domain name), in the following 'fqdn' should be | + | You should now assign some DNS record to this IP. Note down the FQDN you create (fully qualified domain name), in the following 'fqdn' should be replaced with the DNS record you've made |
Then, do this on the OBS appliance: | Then, do this on the OBS appliance: | ||
| Line 79: | Line 80: | ||
<pre> | <pre> | ||
echo '127.0.0.1 fqdn' >> /etc/hosts | echo '127.0.0.1 fqdn' >> /etc/hosts | ||
| + | </pre> | ||
| + | |||
| + | and reboot. | ||
| + | |||
| + | If you get error messages on the WebUi (error 400) and a backtrace in '/srv/www/obs/api/lib/custom_logger.rb' on the console then you need to go further and fix the hostname in one more place: /usr/lib/obs/server/BSConfig.pm | ||
| + | replace: | ||
| + | <pre> | ||
| + | my $hostname = Net::Domain::hostfqdn() || 'localhost'; | ||
| + | </pre> | ||
| + | by | ||
| + | <pre> | ||
| + | my $hostname = 'fqdn'; | ||
</pre> | </pre> | ||
DRAFT
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. A more complete document to setup a private OBS in a production environment can be found here.
You'll need a Virtual Machine like this:
This can also be a physical machine with a physical disk where obs-server.i686-XXXXXX-raw.bz2 (bunzipped and dd'ed to a USB stick) can be used as boot device.
Another option is to run OBS in a Xen virtual machine. There are -xen images at the above link (such as obs-server.i686-XXXXX-xen.tar.bz2), but they appear outdated and some people have reportedly had problems with them. Success has been reported, using the obs-server.i686-XXXXXX-raw.bz2 image with Xen. If you intend to take advantage of paravirtualization, you will need to use the kernel image from OpenSuse 11.3, or compile your own.
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' and the password is 'opensuse'.
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 -i "s/OBS_SCHEDULER_ARCHITECTURES=\"i586 x86_64\"/OBS_SCHEDULER_ARCHITECTURES=\"i586 armv7el\"/g" /etc/sysconfig/obs-server
If you have a DHCP server on your network, get the IP address of the OBS appliance using the following:
ifconfig eth0
You should now assign some DNS record to this IP. Note down the FQDN you create (fully qualified domain name), in the following 'fqdn' should be replaced with the DNS record you've made
Then, do this on the OBS appliance:
echo 'FQHOSTNAME="fqdn"' >> /etc/sysconfig/obs-server
If you have DNS record problems or getting weird errors when accessing http://IP/ (Message: undefined method `closed?' for nil:NilClass), do the following:
echo '127.0.0.1 fqdn' >> /etc/hosts
and reboot.
If you get error messages on the WebUi (error 400) and a backtrace in '/srv/www/obs/api/lib/custom_logger.rb' on the console then you need to go further and fix the hostname in one more place: /usr/lib/obs/server/BSConfig.pm replace:
my $hostname = Net::Domain::hostfqdn() || 'localhost';
by
my $hostname = 'fqdn';
and reboot.
Run from the root prompt:
# This will reboot the virtual machine to pick up the LVM partitions from before shutdown -r 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. I have prepared a handy script for you to use to easily import MeeGo releases.
wget http://stskeeps.subnetmask.net/meego/import-meego-release.sh mv import-meego-release.sh /usr/sbin/ 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/1.0.99.0.20101005.1/
Together with all the RPMs of a MeeGo release, you will also need a OBS prjconf. 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 Trunk would qualify for 1.0 and 1.1 (NOTE: this might change as Trunk becomes 1.2 and then MeeGo:1.1:Core will show up).
You'd then need to actually import the release (please note the http to rsync change and Trunk reference):
/usr/sbin/import-meego-release.sh 1.0.99.0.20101005.1 rsync://mirrors.kernel.org/meego/builds/1.0.99/ obs-project-config/Trunk
And it'll import the release.
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.