OBS Worker Docker image

From Tizen Wiki
Revision as of 04:42, 7 August 2015 by Onstudy (talk | contribs) (Created page with "= Tizen Infra : OBS-Worker with Docker = == Introduction == The obs-workers actually do all the compiling work. (https://en.opensuse.org) == Version == ver ( OBS :...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Tizen Infra : OBS-Worker with Docker


The obs-workers actually do all the compiling work. (https://en.opensuse.org)


ver ( OBS : 2.4 Docker Image : 0.3)

Tested on Host OS.

==== Host OS : ubuntu 14.04 ====
docker version : 1.4.1
docker version : 1.6.2     
docker version : 1.7.0

Host OS : opensuse 13.1

docker version : 1.3.2
docker version : 1.6.2 

OBS Worker Information

==== In my configuration, I use two (2) obs-workers ====
=== Server Info ===
CPU clock : 2.70GHz   
CPU core : 24
Disk Cache : 2GB

=== Desktop Info ===
CPU clock : 3.40GHz
CPU core : 4
SSD  : 512 MB

Pre-installed Packages

==== Image OS : flavio/opensuse-12-3 ====
vim tar wget telnet supervisor sudo
kvm libvirt libvirt-python qemu virt-manager qemu-linux-user
build-initvm-x86_64 build-initvm-i586


===== URL =====


==== Download an images and execute. ====

$ wget < url >

$ ls


$ tar -xvf obsworker-

$ cd clientobsworker

$ ls

 config.conf  dobsworker.sh  env  obsworker-  root

 #### Description ####
 * config.conf : Metaconfig file of container
 * env : Environment variables of container
 * -docker-image.tar.gz : Docker image 
    (“$ ./dobsworker.sh load” will load docker image from *-docker-image.tar.gz )
 * root : Specific configuration files to be applied on container

loading a image in your host OS.

$ sudo ./dobsworker.sh load

How to check a image.

$ sudo docker images

$ docker images 

Configure OBS worker Container

$ vi config.conf

Configuration a config.conf of the dobsworker.sh

### In the value of the OBS_WORKER_PORTBASE of the obs-server file must be increased by the number of OBS_WORKER_INSTANCES.
export PORTS="60000-60003" ## ex) "hostport1 hostport2" or "hostport1:containerport1" or "exposeport1-    exposeport2"

### Assign a name to the container
export CONTAINER="obsworker"

### Container host name
export HOSTNAME="OBSWorker"

### Add a custom host-to-IP mapping (host:ip)
export ADD_HOSTS="<obsserver hostname>:<ip>" ## ex)<obsserver hostname1>:<ip1>                            

Configure OBS worker

$ vi $(pwd)/root/etc/sysconfig/obs-server

# Default setting : 4 instances are created, and 1 job (cpu) is assinged to each instance.
# You can change OBS worker setting (optimization based on your server environment)
# (refer to https://wiki.tizen.org/wiki/OBS_2.4_All-in-One_Server)
###Set Number of all instances which is used by worker
# OBS_WORKER_INSTANCES=(Max Port No. - Min Port No.+1)
# ex) if you use "export PORTS="60000-60007, then OBS_WORKER_INSTANCES=(60007-60000 +1) = 8

# OBS_WORKER_JOBS : number of cpus which is used by each instance
# Note : (OBS_WORKER_INSTANCES * OBS_WORKER_JOBS ) must not exceed total number of host cpus.
# ex) total number of host cpus = 32 core, and OBS_WORKER_INSTANCES=12
# if OBS_WORKER_JOBS=2, it's ok (OBS_WORKER_INSTANCES * OBS_WORKER_JOBS =24, which is lower than 32)
# if OBS_WORKER_JOBS=3, woker will not work. (OBS_WORKER_INSTANCES * OBS_WORKER_JOBS =36, which is higher than 32)

# important ( worker1,worker2 must be different port value.)
# ex) worker1 server = "60000" then worker2 server = "60020"

# The hostname or the IP address of the OBS server
OBS_SRC_SERVER="<OBSServer ip>:5352"

# The hostname or the IP address of the OBS server
OBS_REPO_SERVERS="<OBSServer ip>:5252"
#The product of OBS_WORKER_INSTANCES and OBS_WORKER_JOBS should be smaller than the number of CPU cores in each OBS worker node.

If you use a firewall on host OS, you have to allow a obsworker port number.

$sudo ufw allow proto tcp to any port 60000:60004

Start OBS worker service

$ sudo ./dobsworker.sh start

Debugging OBS worker

If you want to see the build log.

$ sudo ./dobsworker.sh attach

$> # screen -r -d

starting worker d41d8cd98f00b204e9800998ecf8427e build d41d8cd98f00b204e9800998ecf8427e

# how to exit screen => ctrl+A and D
# how to move 0 screen => ctrl+A and 0


### remove all data

$ sudo ./dobsworker.sh stop

$ sudo rm -rf /home/obsworker_ 2.5

$ sudo ./dobsworker.sh rm

$ sudo ./dobsworker.sh start


USAGE: ./dobsworker.sh COMMAND
    install   Install lxc-docker-1.4.1
    start     Start a stopped container
    attach    Attach to a running container
    stop      Stop a running container
    status    Status a running container
    rm        Remove this containers
    restart   stop, start a container
    kill      Kill a running container
    logs      Fetch the logs of a container
    cp        Copy files/folders from a container's filesystem to the host path
    pull      Pull an image or a repository from a Docker registry server
    inspect   Return low-level information on a containe
    top       Lookup the running processes of a container
    save      Save an image to a tar archive
    load      Load an image from a tar archive
    help      help




If you want to build an image from a Dockerfile, you can find a Dockerfile from review.tizen.org.


 GNU Licenses (http://openbuildservice.org/help/manuals/obs-reference-guide/apb.html)
 B.1. GNU General Public License
 B.2. GNU Free Documentation License



Back to Setup of Tizen Infrastructure with Docker