4 Setting Up a Local OBS Instance

This chapter explains how you could setup/Install/test OBS in your system. This chapter is written for those who are not so familiar with Linux and OBS. So in case you are confident to set up OBS, skip this chapter. Following would be explained in this chapter.

  • OBS 1 click install, then manual setup in openSUSE 13.1;

  • OBS 1 click install, then manual setup in SLES11;

  • OBS test run on Microsoft Windows using VMware player;

  • OBS appliance installed manually in a VirtualBox.

Unfortunately, didn't have a chance to install OBS in other Linux distribution yet. The last section will explain your first steps with the new OBS server.

How you could install and purchase openSUSE 13.1 and SLES12 will not be explained in this chapter. VMware player install and purchase also will not be explained. For these topics, you could visit for help:

4.1 Testing OBS on Microsoft Windows Using VMware Player

Those who are not familiar with Linux can run and test OBS. To run and test OBS in Windows, you could use a virtual machine program such as VMware or VirtualBox, etc. This chapter explains, how you can run OBS using VMware player. To check and test with VirtualBox or another virtual machine, check in below.

After you are done installing VMware player on Windows, you need to download the OBS appliance program. You could get OBS appliance file by visiting http://openbuildservice.org/download/other/ and clicking on VirtualBox/VMware Image. After downloading, uncompress with some Windows archiving program that understands the .tar.bz2 file format.

Now, open VMware Player application and select File › Open a Virtual Machine, or you could press CtrlO directly. Open the decompressed virtual machine in Open Virtual Machine dialog box. Click on Play virtual machine icon or hyper link in VMware player.

At the Linux prompt, you can login using "root" as a login name and "opensuse" as a password. Now, OBS local instance should be already loaded and running in your system. To make sure that the OBS Web UI is successfully up and running, open the OBS Web UI.

To access OBS Web user interface, open your web browser and try the address http://vm.ip.address. You can check the virtual machine's IP address by using ifconfig Linux command. Now, you probably could see a screen like the one below in your window:

To login your local OBS instance, you could use default login name as "Admin" and password as "opensuse". Check if you could login properly by clicking Login on your local OBS instance Web UI.

4.2 OBS 1-Click Install on openSUSE 13.1

This section explains, how you can install OBS on top of openSUSE 13.1. Open your web browser and go to that URL http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_13.1/OBS_Server.ymp (http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_13.1/OBS_Server.ymp)

This YaST Meta Package file lets you install OBS by 1 click. In case you are using openSUSE 11.2 or below version, check if you could find 1 click install file in this URL http://en.opensuse.org/openSUSE:Build_Service_Installation_SUSE (http://en.opensuse.org/openSUSE:Build_Service_Installation_SUSE)

After you click on the above URL, you would see Opening OBS_Server.ymp window, Select default selection which is Open with YaST Meta Package Handler and press OK button. Then OBS_Server Installation - YaST window will appear. Select Next button after that till you get successful OBS setup message.

TIPS : In case you didn't install libMagickCore.so.2 in openSUSE, you might face dependency warning. In that case, stop the OBS install by pressing Abort button in OBS_Server Installation - YaST window. Then search and install libMagickCore using a search engine like Google or others and repeat above processes. Then you will get an OBS setup message.

Now, OBS Server is installed in your openSUSE. To run OBS server, you need to work on several further steps. Open /usr/share/doc/packages/obs-api/README.SETUP file. To run OBS server, you need to follow each step of README.SETUP carefully based on your system situation. You can also find this README.SETUP file in our public git repository (https://github.com/openSUSE/open-build-service/blob/master/dist/README.SETUP.md). If you are using our stable release, you might want to switch to the corresponding branch, eg. 2.7 (https://github.com/openSUSE/open-build-service/blob/2.7/dist/README.SETUP).

If you follow instructions from README.SETUP file, you should be able to run OBS server in your system. There are several tips that I would like to comment regarding README.SETUP file.

TIP #1 : Check 3.1 Initialize fresh Database. It might be described as

# cd /srv/www/obs/api/
# sudo RAILS_ENV="production" rake db:setup
# sudo chown lighttpd.lighttpd log/*

# cd /srv/www/obs/webui/
# sudo RAILS_ENV="production" rake db:setup
# sudo chown lighttpd.lighttpd log/*

but it should be

# cd /srv/www/obs/api/
# sudo RAILS_ENV="production" rake db:migrate
# sudo chown lighttpd.lighttpd log/*

# cd /srv/www/obs/webui/
# sudo RAILS_ENV="production" rake db:migrate
# sudo chown lighttpd.lighttpd log/*

For more information, see https://en.opensuse.org/openSUSE:Build_Service_Installation_SUSE.

TIP #2 : If you get fail message because of "apisrv" in "6. Using osc with your local build service:", try apiurl instead.

You might face some issues during process to follow README.SETUP file. If you read and follow instructions carefully, you could run OBS local instance on your system successfully.

4.3 OBS 1-Click Install on SUSE Linux Enterprise Server 12

1 click install for OBS in SLES12. This section explains how you install OBS in SLES12. Installation of OBS in SLES12 is quite similar to OBS install method on openSUSE. I would skip same contents so you might need to have a look for prior section "OBS 1 click install on openSUSE 13.1".

Before you install OBS on SLES12, you need to download and install SLES12 SDK first. you could download SLES12 SDK in here http://download.novell.com (http://download.novell.com).

After you download and install SLES12 SDK, We could use YMP file for OBS 1 click install like openSUSE 13.1. Open your web browser and go to this URL http://download.opensuse.org/repositories/openSUSE:/Tools/SLE_11/OBS_Server.ymp (http://download.opensuse.org/repositories/openSUSE:/Tools/SLE_11/OBS_Server.ymp).

Like for openSUSE 11.3, I have referenced the previous from http://en.opensuse.org/openSUSE:Build_Service_Installation_SUSE (http://en.opensuse.org/openSUSE:Build_Service_Installation_SUSE).

After you clicked on that URL, you would see Opening OBS_Server.ymp window as described in the previous openSUSE 13.1 section. Press OK button and Next button after YaST2 window pops up. If YaST lets you know successful install of OBS server, then you are ready to activate and run OBS on SLES12.

To run OBS server on SLES12, you need to follow instructions based on /usr/share/doc/packages/obs-api/README.SETUP file as described in prior section. From here, you could refer to prior section for successful OBS run on your SLES12.

4.4 Installing a Readymade OBS Appliance in a VirtualBox

This method is slightly less easy than the method using the readymade vmdk VMware disk, but it enables you to determine the size of your virtual disks to your convenience. It could also work with a real computer with two disks. It requires some knowledge of command line and partitioning.

  1. Download the OBS appliance installer. Visit: http://www.openbuildservice.org/download (http://www.openbuildservice.org/download) and press the Download the OBS Appliance Installer button. It will start downloading an ISO image.

  2. In VirtualBox, create a virtual machine with:

    • 4 GB memory

    • 1 virtual hard disk of 20 G for / and /var/cache/obs

    • 1 virtual hard disk of 50 G for /srv/obs

    • a virtual CD-ROM driver pointing to the downloaded ISO image

    • network bridging with real Ethernet card

  3. Boot the virtual machine and choose to install the OBS server on the smaller virtual hard disk.

  4. Log into the virtual machine with Login: root and Password: opensuse. If needed, switch to German/French/whatever keyboard: # loadkeys de. Inspect partitioning: # df -h. It shows you that the root partition is small and already almost full (1.6 GB used out of 1.8). Let's prepare the other partitions to get a bit more working space. First, # fdisk /dev/sda and prepare /dev/sda2 to use the remaining space. Second, # fdisk /dev/sdb and prepare /dev/sdb1 to use all the space, with type 8e (Linux LVM):

     # pvcreate /dev/sdb1
     # vgcreate OBS /dev/sdb1
     # lvcreate -n server -L 48G OBS
     # mkfs.ext4 /dev/OBS/server
  5. Reboot, this time onto the hard disk. The CD-ROM might be disconnected, we will not need it anymore. Log in as root user, change keyboard if needed, and format /dev/sda2: # mkfs.ext4 /dev/sda2. Add following entry to /etc/fstab:

    /dev/sda2  /var/cache/obs  ext4  defaults  2 1

    Mount the new partition: # mount /dev/sda2. Get your IP address: # ifconfig.

4.5 First Steps with Your New OBS Server

At this point, one of the methods above should have provided you with a running OBS instance. Let us get our first package building.

  1. From a web browser, access the web interface: https://vm.ip.address/. Accept the self-signed certificate.

  2. In the top right corner of the web interface, there is a Log In option. Use it to log in as: Admin opensuse.

  3. Click on the Configuration button to give your server a name and a description. Click on the Interconnect option. Choose openSUSE as the remote repository where we will pick up the packages of the build environment. Log out of the web interface.

  4. Use Sign Up option to create a regular user account (for example: hmustermann).

  5. As this normal user, click on the Home Project option and create your home project (that would be: "home:hmustermann").

  6. Go to this home project, and click on Create package to create your first package (let's say: "mypackage").

  7. Go back to your home project, and click the Repositories button. Choose to add a new repository and pick openSUSE 13.1 (for example).

  8. Reboot the virtual machine to ensure all projects are rescanned.

  9. From outside the virtual machine and as a normal user, declare in ~/.oscrc your new OBS user:

    [https://vm.ip.address]
    user=hmustermann
    pass=bond007

    then checkout your new package: $ osc -A https://vm.ip.address co home:hmustermann. go to your first package: $ cd home:hmustermann/mypackage. and add some sources there (tarball, spec file, changelog, patches). Check them in, then trigger a remote build:

    $ osc add *
    $ osc commit
    $ osc rebuild
  10. The built packages can be seen at: http://vm.ip.address:82/

Print this page