Meego Wiki
Views

User:Stskeeps/10 easy steps to a local OBS

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
(Step 3: If you had errors during bootup talking about network not set up)
Line 12: Line 12:
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.
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.
== 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 ==

Revision as of 09:23, 10 November 2010

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.

You'll need a Virtual Machine like this:

  • At least 1 GB of ram
  • Host must support SSSE3 instructions
  • As IDE primary master ('sda' in machine), latest obs-server.i686-XXXXXX-vmx.tar.bz2 from http://download.opensuse.org/repositories/openSUSE:/Tools:/Unstable/images/ . Unpacking it will give you a vmdk to use or convert with qemu-img to fit with your virtualization software.
  • 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.

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.

Contents

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'

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

Step 2: Set up MeeGo supported architectures

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

Step 3: If you had errors during bootup talking about network not set up

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 replace 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.

Step 4: Reboot the machine

Run from the root prompt:

# This will reboot the virtual machine to pick up the LVM partitions from before
shutdown -r now

Step 5: Preparing for importing releases

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

Step 6: Importing a MeeGo release

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!

Step 7: Logging in on the web interface for the first time

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!

Step 8: Adding a build target to your home project

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.

Step 9: Building your first package

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.

Step 10: Watching it build

In 'Overview' you can now follow the build progress.

Personal tools