Build Service/Build Service Installation Tutorial/openSUSE 10.2
From openSUSE
Installing the Build Service is fairly painless on openSUSE 10.2, if you have internet access:
Contents |
YaST Setup
Installation Source Setup
The first thing you want to do is tell YaST where to look for the packages.
- Open YaST
- Go to the Installation Source module.
- Add an http source:
- http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_10.2/
- Server Name: download.opensuse.org
- Directory on Server: /repositories/openSUSE:/Tools/openSUSE_10.2/
- http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_10.2/
- You have to add an additional Installation Source with recent ruby packages in order to get obs working:
- http://download.opensuse.org/repositories/ruby/openSUSE_10.2/
- Server Name: download.opensuse.org
- Directory on Server: /repositories/ruby/openSUSE_10.2/
- http://download.opensuse.org/repositories/ruby/openSUSE_10.2/
- It may also be necessary to enable (or, alternatively, add) the oss catalog from opensuse.org
- http://download.opensuse.org/distribution/10.2/repo/oss
- Server Name: download.opensuse.org
- Directory on Server: /distribution/10.2/repo/oss
- http://download.opensuse.org/distribution/10.2/repo/oss
Installation of Open Build Service
Next, you want to install the build service packages:
- Go to the Software Management YaST module
- Search for obs
- Install obs-api, obs-server, and obs-worker (and their dependencies).
Configuration
(The following contents are copied shamelessly from /usr/share/doc/packages/obs-api/README.SETUP in the obs-api package).
By default all service run on the same system, but they can get distributed to increase reliability and do load balancing.
Run the backend
The backend hosts all sources, build packages and calculates the jobs. You need to install the "obs-server" package for this.
Start the Services
Start the following services in this order. WARNING: The following starts services which are accessable from the outside.
Do not do this on a system connected to an untrusted network or be
sure to block the ports via a firewall.
# rcobsrepserver start # rcobssrcserver start # rcobsscheduler start # rcobsdispatcher start # rcobspublisher start
The data get hosted inside of /srv/obs directory by default.
Start the Workers
The workers ask the backend for open build jobs and do the build. You need to install the "obs-worker" package for this.
Local Worker
A worker can be started on the localhost by calling
# rcobsworker start
Multiple Workers on Remote Systems
/etc/sysconfig/obs-worker has to be edited
# OBS_STORAGE_SERVER="[IP of "SOURCE_HOST" Server]:6262"
Run the Frontend
You need to install the "obs-api" package for this and a mysql server on this or a remote host.
MySQL Setup & Configuration
rcmysql start # use "insserv mysql" for permanent start /usr/bin/mysqladmin -u root password 'your-password'
- Configure your used mysql user in
- /srv/www/obs/frontend/config/database.yml
- /srv/www/obs/webclient/config/database.yml
- under the "development:" section:
- Run the following commands
mysql -u root -p mysql> create database frontend_development; mysql> quit cd /srv/www/obs/frontend/ rake migrate
If you get an error like "Cannot find gem for Rails ~>1.2.3.0" install it with "gem install rails" and change the version in the "config/environment.rb" to the current version of rails (for me it was 1.2.5 instead of 1.2.3).
Configure the Frontend and Web Client
After the configuration of the frontend (and webclient) rails interface is needed. A configuration for accessing via http://127.0.42.1 and http://127.0.42.2 gets automatically installed into /etc/lighttpd/vhosts.d/obs.conf
You need to add the following to /etc/lighttpd/lighttpd.conf, if there are these settings missing:
var.conf_dir = "/etc/lighttpd/" include "vhosts.d/obs.conf"
The modules "mod_magnet" and "mod_rewrite" needs to be enabled in /etc/lighttpd/modules.conf. Additionally you need to enable FastCGI via removing the comment before
include "conf.d/fastcgi.conf"
inside of this file.
Now edit /srv/www/obs/webclient/config/environments/development_base.rb and set the following variables:
FRONTEND_HOST = "127.0.42.2" FRONTEND_PORT = 80 FRONTEND_PROTOCOL = 'http'
and /srv/www/obs/frontend/config/environments/development_base.rb
SOURCE_HOST = "127.0.42.1" RPM_HOST = "127.0.42.1"
Next you can start the OBS via:
rclighttpd start # use "insserv lighttpd" for permanent start
If lighttpd does not start you need to enable IPv6
Setup Initial Distributions
The OBS does need some base projects and packages to start the building. You can setup it for example in this way to build for openSUSE 10.2:
- visit http://127.0.42.1 The default user is "Admin" with the password "opensuse".
- Create an "openSUSE:10.2" project by starting the browser with the following URL: http://127.0.42.1. Click on "Projects", then (near the bottom of the page) "All projects (including home projects)", and finally "Add a new project"
- in this project, click on '[Add Repository]' and on the next page on '[Advanced]' (underneath a bunch of distro buttons) in the name field, enter 'standard'
- A resulting project xml file should have been created at /srv/obs/projects/openSUSE:10.2.xml and looks like this:
<project name="openSUSE:10.2">
<repository status='disabled' name='standard'>
<arch>i586</arch>
</repository>
<title>the openSUSE 10.2 distribution</title>
<description></description>
</project>
The status='disabled' will stop any builds inside of this project, but it can be used anyway as a base in other projects.
Afterwards you need to copy the rpms from the base distribution to /srv/obs/build/openSUSE:10.2/standard/i586/:full/ Simply create the directory, if it does not exist. In order to be sure that the directory structure has the proper rights set, execute:
chown -R obsrun.obsrun /srv/obs
Once you copied all rpms from the base distribution's i586 and noarch directory inside /srv/obs/build/openSUSE:10.2/standard/i586/:full/ you need to trigger the reading of the directory of the scheduler. The easiest way to achieve this is to restart it.
Last but not least you need to copy the distribution configuration to define how a base distribution needs to get setup. These configurations for SUSE are part of the build rpm.
# cp /usr/lib/obs/server/build/configs/sl10.2.conf /srv/obs/projects/openSUSE:10.2.conf
You may also want to read Build Service/Tips and Tricks#How is a buildenvironment defined? for a description of the configuration format.
The project is now ready to be used as a base for other projects.
Other distros can be added similarly, which makes the 'distro' buttons given when adding a repository work.
Names of projects to create for other distros:
| Linux Distribution | Name |
|---|---|
| SLED/SLES 10 | SUSE:SLE-10:SDK |
| SLES 9 | SUSE:SLES-9 |
| Fedora 6 (with Extras) | Fedora:Extras6 |
(I'm sure there's others...)
Access
By default you can access the api via using any browser with the URL:
http://127.0.42.2
The web interface is accessable via:
http://127.0.42.1
The default user is "Admin" with the password "opensuse".
Updating
When the obs-api package has been updated, it might be required to upgrade the database. Therefore, you should execute
cd /srv/www/obs/frontend/ rake migrate
after updating obs-api.
Command-Line Interface (osc)
In order to use the command line tool for the build service, change your ~/.oscrc to something like this:
[general] # Downloaded packages are cached here. Must be writable by you. #packagecachedir = /var/tmp/osbuild-packagecache # Wrapper to call build as root (sudo, su -, ...) #su-wrapper = su -c # rootdir to setup the chroot environment # can contain %(repo)s and/or %(arch)s for replacement #build-root = /var/tmp/build-root # use this API server # (it needs a section [api.opensuse.org] with the credentials) #apisrv = api.opensuse.org # our local build service api: apisrv = 127.0.42.2 # for local build service, use http (not https) scheme = http # local default admin account [127.0.42.2] user = Admin pass = opensuse # normal build service account [api.opensuse.org] user = foo pass = bar

