Open main menu

CDOT Wiki β

Changes

Fedora Arm Secondary Architecture/Koji Builders

3,632 bytes added, 15:54, 15 April 2010
Created page with '= Koji Daemon - Builder = Kojid is the build daemon that runs on each of the build machines. Its primary responsibility is polling for incoming build requests and handling them ...'
= Koji Daemon - Builder =

Kojid is the build daemon that runs on each of the build machines. Its primary responsibility is polling for incoming build requests and handling them accordingly. Koji also has support for tasks other than building. Creating install images is one example. kojid is responsible for handling these tasks as well. kojid uses mock for building. It also creates a fresh buildroot for every build. kojid is written in Python and communicates with koji-hub via XML-RPC.

'''Configuration Files:'''

* /etc/kojid/kojid.conf - Koji Daemon Configuration
* /etc/sysconfig/kojid - Koji Daemon Switches

'''Install kojid:'''
<pre>
root@localhost$ yum install koji-builder
</pre>

== Required Configuration ==

/etc/kojid/kojid.conf:
''This needs to point at your koji-hub.''
<pre>
; The URL for the xmlrpc server
server=http://hub.example.com/kojihub

; the username has to be the same as what you used with add-host
; in this example follow as below
user = kojibuilder1.example.com
</pre>
''This item may be changed, but may not be the same as KojiDir on the kojihub.conf file (although it can be something under KojiDir, just not the same as KojiDir)''
<pre>
; The directory root for temporary storage
workdir=/tmp/koji
</pre>

== SSL certificates For Authentication ==

/etc/kojid/kojid.conf:
''If using SSL, these settings need to be valid.''
<pre>
;client certificate
; This should reference the builder certificate we created above, for
; kojibuilder1.example.com
cert = /etc/kojid/arm-001-008.pem

;certificate of the CA that issued the client certificate
ca = /etc/kojid/koji_ca_cert.crt

;certificate of the CA that issued the HTTP server certificate
serverca = /etc/kojid/koji_ca_cert.crt

</pre>

==== Add the host entry for the koji builder to the database ====
Make sure you do this before you start kojid for the first time,
or you'll need to manually remove entries from the sessions and users
table before it can be run successfully.
<pre>
kojiadmin@localhost$ koji add-host kojibuilder1.example.com i386 x86_64
</pre>

==== Add the host to the createrepo channel ====
Channels are a way to control which builders process which tasks. By default
hosts are added to the ''default'' channel. At least some build hosts also needs to be added
to the ''createrepo'' channel so there will be someone to process repo creation tasks initiated by kojira.

<pre>
kojiadmin@localhost$ koji add-host-to-channel kojibuilder1.example.com createrepo
</pre>

==== A note on capacity ====
The default capacity of a host added to the host database is 2. This means that once the load average on that machine exceeds 2, kojid will not accept any additional tasks. This is separate from the maxjobs item in the configuration file. Before kojid will accept a job, it must pass both the test to ensure the load average is below capacity and that the current number of jobs it is already processing is less than maxjobs. However, in today's modern age of quad core and higher CPUs, a load average of 2 is generally insufficient to fully utilize hardware. As there is not an option to set the capacity of the host via the command line tools, it must be done manually in psql.

<pre>
koji@localhost$ psql koji
koji=# select (id, name, capacity) from host;
row
--------------------------------
(1,kojibuilder1.example.com,2)
(2,kojibuilder2.example.com,2)
(2 rows)

koji=# update host set capacity = 16 where id = 1;
UPDATE 1
koji=#
</pre>

==== Start Kojid ====
<pre>
root@localhost$ /sbin/service kojid start
</pre>
Check /var/log/kojid.log to verify that kojid has started successfully.
1
edit