OBS 2.5 Distributed Servers

From Tizen Wiki
Jump to: navigation, search


Add zypper repositories

Refer to the "OBS 2.5 Zypper Repositories" page.



Install BACKEND Server

BACKEND server = REPO server + SCHEDULER + DISPATCHER + PUBLISHER + WARDEN

Make HOME directory for OBS (if necessary)

Refer to the "Make a HOME directory for OBS" section in the "Install All-in-One Server" chapter in the "OBS 2.4 All-in-One Server" page.


Make repository directory

Refer to the "Make repository directory" section in the "Install All-in-One Server" chapter in the "OBS 2.4 All-in-One Server" page.


Install BUILD packages

Refer to the "Install BUILD packages" section in the "Install All-in-One Server" chapter in the "OBS 2.5 All-in-One Server" page.


Fix build script bugs

Refer to the "Fix build script bugs" section in the "Install All-in-One Server" chapter in the "OBS 2.5 All-in-One Server" page.


Install BACKEND packages

Refer to the "Install BACKEND packages" section in the "Install BACKEND Server" chapter in the "OBS 2.4 Distributed Servers" page.


Install additional packages for dependencies

Refer to the "Install additional packages for dependencies" section in the "Install All-in-One Server" chapter in the "OBS 2.5 All-in-One Server" page.


Generate configuration.xml file

Refer to the "Generate configuration.xml file" section in the "Install All-in-One Server" chapter in the "OBS 2.5 All-in-One Server" page.


Modify OBS account

Refer to the "Modify OBS account" section in the "Install All-in-One Server" chapter in the "OBS 2.5 All-in-One Server" page.


Set owner of OBS HOME directory (if necessary)

Refer to the "Set owner of OBS HOME directory" section in the "Install All-in-One Server" chapter in the "OBS 2.4 All-in-One Server" page.


Modify BSConfig.pm file

# vi /usr/lib/obs/server/BSConfig.pm

my $frontend = undef; # FQDN of the WebUI/API server if it's not $hostname
my $api_host = "xxx.xxx.xxx.xxx";    ## FQDN, IP address, or short hostname of the API (FRONTEND) server
my $rep_host = "yyy.yyy.yyy.yyy";    ## FQDN, IP address, or short hostname of the REPO (BACKEND) server
my $src_host = "zzz.zzz.zzz.zzz";    ## FQDN, IP address, or short hostname of the SRC (STORAGE) server
my $api_ip = quotemeta inet_ntoa(inet_aton($api_host));
my $rep_ip = quotemeta inet_ntoa(inet_aton($rep_host));
my $src_ip = quotemeta inet_ntoa(inet_aton($src_host));

······

our $ipaccess = {
   '127\..*' => 'rw', # only the localhost can write to the backend
   "^$ip" => 'rw', # Permit IP of FQDN
   "^$api_ip" => 'rw', # Permit IP of API server
   "^$rep_ip" => 'rw', # Permit IP of REPO server
   "^$src_ip" => 'rw', # Permit IP of SRC server
   '.*' => 'worker', # build results can be delivered from any client in the network
};

······

our $obsname = $rep_host;
#our $srcserver = "http://$hostname:5352";
our $srcserver = "http://$src_host:5352";
#our $reposerver = "http://$hostname:5252";
our $reposerver = "http://$rep_host:5252";
#our $serviceserver = "http://$hostname:5152";
our $serviceserver = "http://$src_host:5152";

······

#our $repodownload = "http://$hostname/repositories";
our $repodownload = "http://$rep_host:82";

······

#our @reposervers = ("http://$hostname:5252");
our @reposervers = ("http://$rep_host:5252");

······

#our $noproxy = "localhost, 127.0.0.1";
## Domains, FQDNs, IP addresses, short hostnames
our $noproxy = "localhost, 127.0.0.1, pilot.tizen.org, build, frontend, front, fe, api, webui, backend, be, rep, storage, src, db";

······


Install Apache2 for REPO download

Refer to the "Install Apache2 for REPO download" section in the "Install BACKEND Server" chapter in the "OBS 2.4 Distributed Servers" page.


Configure Apache2 for REPO download

Refer to the "Configure Apache2 for REPO download" section in the "Install BACKEND Server" chapter in the "OBS 2.4 Distributed Servers" page.


Set up firewall for BACKEND server

Refer to the "Set up firewall for BACKEND server" section in the "Install BACKEND Server" chapter in the "OBS 2.4 Distributed Servers" page.


Register BACKEND services

# chkconfig --add obsrepserver obsscheduler obsdispatcher obspublisher obswarden
# systemctl enable apache2



Install STORAGE Server

STORAGE server = SOURCE server + SERVICE server + MySQL server

Make HOME directory for OBS (if necessary)

Refer to the "Make a HOME directory for OBS" section in the "Install All-in-One Server" chapter in the "OBS 2.4 All-in-One Server" page.


Make OBS events directory

# mkdir -p /srv/obs/events


Install MySQL (MariaDB)

Refer to the "Install MySQL (MariaDB)" section in the "Install All-in-One Server" chapter in the "OBS 2.4 All-in-One Server" page.


Install SOURCE/SERVICE packages

Refer to the "Install SOURCE/SERVICE packages" section in the "Install STORAGE Server" chapter in the "OBS 2.4 Distributed Servers" page.


Install additional packages for dependencies

Refer to the "Install additional packages for dependencies" section in the "Install All-in-One Server" chapter in the "OBS 2.5 All-in-One Server" page.


Modify OBS account

Refer to the "Modify OBS account" section in the "Install All-in-One Server" chapter in the "OBS 2.5 All-in-One Server" page.


Set owner of OBS HOME directory (if necessary)

Refer to the "Set owner of OBS HOME directory" section in the "Install All-in-One Server" chapter in the "OBS 2.4 All-in-One Server" page.


Create OBS database

Refer to the "Create OBS database" section in the "Install All-in-One Server" chapter in the "OBS 2.5 All-in-One Server" page.


Configure OBS services

Refer to the "Configure OBS services" section in the "Install STORAGE Server" chapter in the "OBS 2.4 Distributed Servers" page.


Modify BSConfig.pm file

Refer to the "Modify BSConfig.pm file" section in the "Install BACKEND Server" chapter.


Set up firewall for STORAGE server

Refer to the "Set up firewall for STORAGE server" section in the "Install BACKEND Server" chapter in the "OBS 2.4 Distributed Servers" page.


Register STORAGE services

# chkconfig --add mysql obssrcserver obsservice



Install FRONTEND Server

FRONTEND server = WebUI server + API server

Install Apache2 for FE

Refer to the "Install Apache2 for FE" section in the "Install FRONTEND Server" chapter in the "OBS 2.4 Distributed Servers" page.


Install PHP5

Refer to the "Install PHP5" section in the "Install All-in-One Server" chapter in the "OBS 2.4 All-in-One Server" page.


Install FRONTEND packages

# zypper install obs-api
# zypper install obs-utils


Install additional packages for dependencies

Refer to the "Install additional packages for dependencies" section in the "Install All-in-One Server" chapter in the "OBS 2.5 All-in-One Server" page.


Configure API database.yml file

# vi /srv/www/obs/api/config/database.yml

······
production:
  adapter: mysql2
  database: api_production
  host: "zzz.zzz.zzz.zzz"    ## The hostname of the MySQL server for OBS
  port: '3306'    ## The port number of the MySQL service in the MySQL server
  username: rootobs    ## The user name in the step of "Create OBS database"
  password: opensuseobspassword    ## The password in the step of "Create OBS database"
  encoding: utf8
······


Populate API production database

Refer to the "Populate API production database" section in the "Install All-in-One Server" chapter in the "OBS 2.5 All-in-One Server" page.


Configure API options.yml file

# vi /srv/www/obs/api/config/options.yml

······
#use_xforward: true
use_xforward: true

······
#source_host: localhost
source_host: "zzz.zzz.zzz.zzz"    ## The hostname or the IP address of the SRC server
source_port: 5352
#source_protocol: https
source_protocol: http

······
#frontend_host: localhost
frontend_host: "xxx.xxx.xxx.xxx"    ## The hostname or the IP address of the API (FRONTEND) server
#frontend_port: 443
frontend_port: 80    ## If HTTP must be used for OBS API service instead of HTTPS, the port number for API must be 80.
#frontend_protocol: https
frontend_protocol: http
······


Configure Apache2 for FE

    Edit /etc/sysconfig/apache2 file

Refer to the "Edit /etc/sysconfig/apache2 file" subsection in the "Configure Apache2" section in the "Install All-in-One Server" chapter in the "OBS 2.5 All-in-One Server" page.


    Generate SSL certificate (only if HTTPS is used)

Refer to the "Generate SSL certificate ..." subsection in the "Configure Apache2" section in the "Install All-in-One Server" chapter in the "OBS 2.4 All-in-One Server" page.


    Edit httpd.conf file

Refer to the "Edit httpd.conf file" subsection in the "Configure Apache2" section in the "Install All-in-One Server" chapter in the "OBS 2.4 All-in-One Server" page.


Configure virtual hosts for FE

# vi /etc/apache2/vhosts.d/obs.conf

Listen 80
Listen 443
#Listen 82
······

······
## Comment out or remove this block.
#<VirtualHost *:80>
#    ······
#</VirtualHost>

······
## Comment out or remove this block.
#<VirtualHost *:82>
#    ······
#</VirtualHost>

······
## Comment out this block if HTTPS is NOT used.
#<VirtualHost *:443>
#    ······
#</VirtualHost>

# OBS WEBUI & API without SSL
<VirtualHost *:80>
    ServerName api

    DocumentRoot "/srv/www/obs/api/public"
    ErrorLog /srv/www/obs/api/log/apache_error_log
    TransferLog /srv/www/obs/api/log/apache_access_log

    PassengerMinInstances 2
    PassengerPreStart http://api

    <Directory /srv/www/obs/api/public>
        AllowOverride all
        Options -MultiViews
        XForward on
        Allow from all
    </Directory>
</VirtualHost>


Change owner/group of API directories

# chown -R wwwrun:www /srv/www/obs/api


Set up firewall

    Add TCP ports for FRONTEND server

YaST --> Security and Users --> Firewall --> Allowed Services --> Advanced... --> TCP Ports

80 443

"443" port should be enabled only if it is used.


Register FRONTEND services

# chkconfig --add memcached obsapidelayed
# systemctl enable apache2



Reboot OBS Servers

  1. Reboot BACKEND server
  2. Reboot STORAGE server
  3. Reboot FRONTEND server



Install Workers

Refer to the "Install Workers" chapter in the "OBS 2.4 All-in-One Server" page.