Meego Wiki
Views

User:Stskeeps/10 easy steps to a local OBS

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
Line 166: Line 166:
And now your release is ready to go as a build target!
And now your release is ready to go as a build target!
 +
 +
== Step 4: 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 5: 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'.

Revision as of 19:29, 8 October 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 70 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.

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.

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

Step 3: 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 4: Importing a MeeGo release

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 1.0.99.0.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/1.0.99.0.20101005.1/

You'd then need to (please note the http to rsync change):

/usr/sbin/import-meego-release.sh 1.0.99.0.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!

Step 4: 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 5: 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'.

Personal tools