Editing OpenSuse Build Service/Installation
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 8: | Line 8: | ||
This Installation Notes covers OBS installation and setup for '''version 1.7'''. You can always refer to latest documentation also available on-line: http://gitorious.org/opensuse/build-service/blobs/raw/master/dist/README.SETUP | This Installation Notes covers OBS installation and setup for '''version 1.7'''. You can always refer to latest documentation also available on-line: http://gitorious.org/opensuse/build-service/blobs/raw/master/dist/README.SETUP | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
== Creating Xen VMs == | == Creating Xen VMs == | ||
Line 47: | Line 18: | ||
</source> | </source> | ||
- | Create some | + | Create some xen volumes |
<source lang='bash'> | <source lang='bash'> | ||
lvcreate -L 10G VG_data -n fe_root | lvcreate -L 10G VG_data -n fe_root | ||
Line 62: | Line 33: | ||
</source> | </source> | ||
- | + | Prpeare an opensuse minimal image: | |
<source lang='bash'> | <source lang='bash'> | ||
- | |||
mkdir /data/11.2min | mkdir /data/11.2min | ||
- | kiwi --prepare suse-11.2-JeOS --root | + | kiwi --prepare suse-11.2-JeOS --root /data/11.2min/image-root --add-profile xenFlavour --add-package less --add-package iputils |
</source> | </source> | ||
Update the config & modules: | Update the config & modules: | ||
<source lang='bash'> | <source lang='bash'> | ||
- | + | cp -a /lib/modules/2.6.31.12-0.2-xen /data/11.2min/image-root/lib/modules/ | |
- | cp -a /lib/modules/2.6.31.12-0.2-xen | + | |
- | echo default 10.1.1.1 > | + | echo default 10.1.1.1 > /data/11.2min/image-root/etc/sysconfig/network/routes |
- | echo NETCONFIG_DNS_POLICY=\"\" >> | + | echo NETCONFIG_DNS_POLICY=\"\" >> /data/11.2min/image-root/etc/sysconfig/network/config |
- | echo nameserver 8.8.8.8 > | + | echo nameserver 8.8.8.8 > /data/11.2min/image-root/etc/resolv.conf |
- | echo default 10.1.1.1 > | + | echo default 10.1.1.1 > /data/11.2min/image-root/etc/sysconfig/network/routes |
- | cat << EOF > | + | cat << EOF >/data/11.2min/image-root/etc/sysconfig/network/ifcfg-eth0 |
BOOTPROTO='static' | BOOTPROTO='static' | ||
BROADCAST='' | BROADCAST='' | ||
STARTMODE='onboot' | STARTMODE='onboot' | ||
EOF | EOF | ||
- | |||
</source> | </source> | ||
Line 135: | Line 103: | ||
</source> | </source> | ||
- | == | + | == Networking Overview == |
- | + | ||
- | + | ||
- | + | ||
- | + | <source lang="bash"> | |
- | + | cat <<XX >> /etc/hosts | |
- | + | 10.1.1.1 host.obs.maemo.org | |
- | <source lang= | + | 10.1.1.10 fe.obs.maemo.org build.obs.maemo.org api.obs.maemo.org |
- | + | 10.1.1.11 be.obs.maemo.org src.obs.maemo.org repo.obs.maemo.org | |
- | + | 10.1.1.51 w1.obs.maemo.org | |
- | + | XX | |
- | + | ||
</source> | </source> | ||
- | + | <hr> | |
- | < | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | == Interim config == | |
<source lang='bash'> | <source lang='bash'> | ||
- | + | zypper in wget less iputils | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
</source> | </source> | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | == Installing the | + | == Installing the Frontend (WebUI and API) == |
- | Start with a minimal | + | Start with a minimal Suse install and then add Tools repository where OBS 1.7 is available. |
<source lang='bash'> | <source lang='bash'> | ||
cd /etc/zypp/repos.d/; | cd /etc/zypp/repos.d/; | ||
Line 252: | Line 134: | ||
Install obs-api (It's going to install lighttpd webserver by dependency for you). | Install obs-api (It's going to install lighttpd webserver by dependency for you). | ||
<source lang='bash'> | <source lang='bash'> | ||
- | zypper in obs-api | + | zypper in obs-api |
</source> | </source> | ||
- | '''Setup | + | '''Setup Mysql''' |
- | + | Mysql server needs to be installed and configured to start as deamon | |
<source lang='bash'> | <source lang='bash'> | ||
chkconfig --add mysql | chkconfig --add mysql | ||
rcmysql start | rcmysql start | ||
</source> | </source> | ||
- | Setup a secure installation, if it's the first time starting | + | Setup a secure installation, if it's the first time starting mysql |
<source lang='bash'> | <source lang='bash'> | ||
/usr/bin/mysql_secure_installation | /usr/bin/mysql_secure_installation | ||
</source> | </source> | ||
- | The frontend instance holds 2 applications, the | + | The frontend instance holds 2 applications, the api and the webui. Each one need a database created |
<source lang='bash'> | <source lang='bash'> | ||
mysql -u root -p | mysql -u root -p | ||
Line 282: | Line 164: | ||
FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
</source> | </source> | ||
- | Configure your MySQL user and password in the "production:" section of the | + | Configure your MySQL user and password in the "production:" section of the api config: |
<source lang='bash'> | <source lang='bash'> | ||
vi /srv/www/obs/api/config/database.yml | vi /srv/www/obs/api/config/database.yml | ||
Line 292: | Line 174: | ||
password: ************ | password: ************ | ||
</source> | </source> | ||
- | Do the same for the webui. It's configured, by default to use | + | Do the same for the webui. It's configured, by default to use sqlite, but since we're configuring the cluster for production environment, let's bind it to mysql: |
<source lang='bash'> | <source lang='bash'> | ||
Line 313: | Line 195: | ||
You can check the migration was successful verifying the “migrated” message at the end of each statement. | You can check the migration was successful verifying the “migrated” message at the end of each statement. | ||
- | '''Setup and configure lighttpd for the | + | '''Setup and configure lighttpd for the api and webui''' |
- | You need to setup the correct hostnames to where webui, | + | You need to setup the correct hostnames to where webui, api and repo server are going to point to |
<source lang='bash'> | <source lang='bash'> | ||
vi /etc/lighttpd/vhosts.d/obs.conf | vi /etc/lighttpd/vhosts.d/obs.conf | ||
- | $HTTP["host"] =~ "build" { | + | #webui (first section) |
- | + | $HTTP["host"] =~ "build.maemo.org" { | |
- | + | ... | |
- | + | ||
- | + | ||
- | + | ||
- | + | #api (second section) | |
+ | $HTTP["host"] =~ "api.maemo.org" { | ||
+ | … | ||
- | + | #comment out whole the last section (3rd) | |
- | + | #It's going to be configured no Backend enabling the repository listing there | |
- | + | </source> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | # | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | /source> | + | |
To enable these vhosts, make sure to '''uncomment''' the following in the 'custom includes' section at the bottom of /etc/lighttpd/lighttpd.conf: | To enable these vhosts, make sure to '''uncomment''' the following in the 'custom includes' section at the bottom of /etc/lighttpd/lighttpd.conf: | ||
Line 364: | Line 223: | ||
include_shell "cat vhosts.d/*.conf" | include_shell "cat vhosts.d/*.conf" | ||
</source> | </source> | ||
- | Also, the modules "mod_magnet", "mod_rewrite" and | + | Also, the modules "mod_magnet", "mod_rewrite" and fastcgi need to be enabled by uncommenting the corresponding lines in /etc/lighttpd/modules.conf: |
<source lang='bash'> | <source lang='bash'> | ||
vi /etc/lighttpd/modules.conf | vi /etc/lighttpd/modules.conf | ||
Line 404: | Line 263: | ||
</source> | </source> | ||
Make sure TCP port 5352 is open on the firewall. | Make sure TCP port 5352 is open on the firewall. | ||
- | + | Restart lighttpd | |
<source lang='bash'> | <source lang='bash'> | ||
- | + | #first add it as deamon | |
chkconfig --add lighttpd | chkconfig --add lighttpd | ||
- | |||
- | |||
- | |||
- | |||
rclighttpd start | rclighttpd start | ||
- | |||
- | |||
</source> | </source> | ||
- | ligthttpd user and group need to be the | + | ligthttpd user and group need to be the onwer of api and webui dirs (as well as log and tmp): |
<source lang='bash'> | <source lang='bash'> | ||
chown -R lighttpd.lighttpd /srv/www/obs/{api,webui} | chown -R lighttpd.lighttpd /srv/www/obs/{api,webui} | ||
</source> | </source> | ||
- | == Installing the | + | == Installing the Backend == |
- | + | ||
- | + | ||
- | + | On this host we need also to setup openSuse Tools repository: | |
<source lang='bash'> | <source lang='bash'> | ||
cd /etc/zypp/repos.d/; | cd /etc/zypp/repos.d/; | ||
Line 434: | Line 285: | ||
</source> | </source> | ||
- | Install | + | Install: |
<source lang='bash'> | <source lang='bash'> | ||
- | zypper in obs- | + | zypper in obs-server obs-signer obs-utils |
+ | # obs-server brings these other packages as dependency. This is just for you to notice which packages are needed for Backend installation | ||
</source> | </source> | ||
- | + | Configure Scheduler architectures | |
- | + | ||
- | + | ||
<source lang='bash'> | <source lang='bash'> | ||
- | vi /etc/sysconfig/obs- | + | vi /etc/sysconfig/obs-server |
- | + | OBS_SCHEDULER_ARCHITECTURES="i586 armv5el armv7el“ | |
- | + | ||
- | + | ||
</source> | </source> | ||
- | + | /usr/lib/obs/server/BSConfig.pm needs to point to correct server names corresponding to source server, where workers are going to download the source, and the repository server, where RPM repos are going to be shered to users. | |
- | + | ||
- | + | ||
<source lang='bash'> | <source lang='bash'> | ||
- | + | vi /usr/lib/obs/server/BSConfig.pm | |
+ | #add | ||
+ | $hostname="be.obs.maemo.org" | ||
- | + | our $srcserver = "http://src.obs.maemo.org:5352"; | |
+ | our $reposerver = "http:/repo.obs.maemo.org:5252"; | ||
</source> | </source> | ||
- | = | + | Configure services as deamons |
- | + | <source lang='bash'> | |
+ | chkconfig --add obsrepserver obssrcserver obsscheduler obsdispatcher obspublisher obswarden obssigner | ||
- | = | + | #Check them |
+ | chkconfig -l obsrepserver obssrcserver obsscheduler obsdispatcher obspublisher | ||
+ | </source> | ||
+ | Start Services | ||
+ | <source lang='bash'> | ||
+ | rcobsrepserver start | ||
+ | rcobssrcserver start | ||
+ | rcobsscheduler start | ||
+ | rcobsdispatcher start | ||
+ | rcobspublisher start | ||
+ | </source> | ||
+ | For version 1.7 there are a new services. You can start them as well: | ||
+ | * '''obswarden''' | ||
+ | It checks if build hosts are dieing and cleans up hanging builds | ||
+ | * '''obssigner''' | ||
+ | It is used to sign packages via the obs-sign daemon. You need to configure | ||
+ | it in BSConfig.pm before you can use it. | ||
+ | * '''obsservice''' | ||
+ | The is the source service daemon. OBS 1.7 just comes with a download | ||
+ | service so far. This feature is considered to be experimental so far, | ||
+ | but can be already extended with own services. | ||
- | + | '''Install Lighttpd''' | |
- | + | ||
- | + | ||
- | + | ||
- | + | lighttpd also needs to be available on backend server. This is required to provide directory listing on the repositories available on this server when an http/s request to maemo-repo is made through web ui. | |
- | + | ||
- | + | ||
+ | <source lang='bash'> | ||
+ | zypper in lighttpd | ||
+ | </source> | ||
- | + | Create a new file under /etc/lighttpd/vhosts.d/. It can be obs.conf as well, and add: | |
- | + | <source lang='bash'> | |
+ | vi /etc/lighttpd/vhosts.d/obs.conf | ||
- | + | $HTTP["host"] =~ "repo.obs.maemo.org" { | |
- | + | server.name = "repo.obs.maemo.org" | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | server.document-root = "/srv/obs/repos/" | |
+ | dir-listing.activate = "enable" | ||
+ | } | ||
+ | </source> | ||
+ | To enable vhosts, remember to '''uncomment''' the following in the 'custom includes': | ||
- | + | <source lang='bash'> | |
- | + | vi /etc/lighttpd/lighttpd.conf | |
- | + | ## | |
+ | ## custom includes like vhosts. | ||
+ | ## | ||
+ | #include "conf.d/config.conf" | ||
+ | # following line uncommented as per | ||
+ | # /usr/share/doc/packages/obs-api/README.SETUP | ||
+ | include_shell "cat vhosts.d/*.conf" | ||
+ | </source> | ||
- | + | Start lighttpd | |
- | + | <source lang='bash'> | |
- | + | #first add it as deamon | |
- | + | chkconfig --add lighttpd | |
- | + | rclighttpd start | |
+ | </source> | ||
- | + | == Installing the Workers == | |
- | + | The other 14 hosts on the cluster are reserved to be used as workers, where package builds are going to place. | |
- | + | The same openSuse Tools repository addition must be done for each worker. | |
+ | <source lang='bash'> | ||
+ | cd /etc/zypp/repos.d/; | ||
+ | wget http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_11.2/openSUSE:Tools.repo | ||
+ | zypper ref | ||
+ | # Accept the trust key | ||
+ | </source> | ||
- | + | Install worker: | |
+ | <source lang='bash'> | ||
+ | zypper in obs-worker | ||
+ | </source> | ||
- | + | Edit the file /etc/sysconfig/obs-worker in order to point to correct repository server. | |
+ | <source lang='bash'> | ||
+ | vi /etc/sysconfig/obs-worker | ||
+ | OBS_SRC_SERVER="srcsrv.maemo.org:5352" | ||
+ | OBS_REPO_SERVERS="obs-repo.maemo.org:5252" | ||
+ | </source> | ||
- | + | Each worker has 16 CPUs, so 16 workers need to be started. | |
- | + | <source lang='bash'>rcobsworker</source> uses curl to download the worker source code from backend server, therefore, for curl to work properly with the proxy setup on worker you must edit .curlrc (under users home dir) and set --noproxy "europe.nokia.com" in order to bypass proxy settings. | |
- | + | Start the worker service: | |
+ | <source lang='bash'> | ||
+ | chkconfig --add obsworker | ||
- | + | rcobsworker start | |
- | + | </source> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | </ | + | |
- | + |
Learn more about Contributing to the wiki.