[[Category:Fedora ARM Secondary Architecture]][[Category:Winter 2010 SBR600]]= Goal = To configure a Koji Daemon - Builder =builder system (either VM or physical hardware).
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:'''= Steps to Perform = == Storage Space == Ensure that there is a good amount of space on the ARM system for mock (<code>/var/lib/mock</code> and <precode>root@localhost$ yum install koji-builder/var/cache/mock</precode>) before proceeding. You will want a minimum of about 8GB.
== Required Configuration ==On the ARM VMs, you may need to increase the VM size. Stop the VM, add additional storage, and then restart the VM:
/etc/kojid/kojid'''On the VM:''' poweroff Allow 30 seconds for system shutdown.conf '''On HongKong:''' virsh destroy ''This needs to point at your koji-hub.domain''<pre dd if=/dev/zero bs=1M count=8192 >>/var/lib/libvirt/images/arm/''domain''.img; The URL for the xmlrpc server fsck -f /var/lib/libvirt/images/arm/''domain''.imgserver=http: resize2fs /var/lib/libvirt/images/arm/hongkong''domain''.proximity.on.ca/kojihubimg virsh start ''domain''
; Where ''domain'' is the username has to be the same VM name, such as what you used with add-host; in this example follow as belowuser = <code>arm-001-001 ;Matches your VM name999</precode>''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 storageworkdir=/tmp/koji</pre>
== SSL certificates For Authentication ==If using a physical ARM system, ensure that <code>/var/lib/mock</code> and <code>/var/cache/mock</code> have sufficient space, perhaps by symlinking them to subdirectories of the mountpoint of an external disk, NFS share, or iSCSI block device.
/etc/== Install kojid/kojid.conf:==''If using SSL, these settings need to be valid.''<pre>;client certificate; This should reference the yum install koji-builder certificate we created above, for; kojibuilder1.example.comcert = /etc/kojid/arm-001-008.pem
;certificate of the CA that issued the client certificateca = /etc/kojid/koji_ca_cert.crt= NFS Configuration ==
;certificate of Perform the CA that issued steps outlined on the [[Fedora_Arm_Secondary_Architecture/NFS_Configuration|NFS Configuration]] page, including adding entries to the HTTP server certificateserverca = /etc/kojid/koji_ca_certhosts file.crt
</pre>== Koji Configuration ==
==== Add the host entry for the koji builder to the database ====Make sure you do this before you start /etc/kojid/kojid for the first time,.conf:or you'll need 'This needs to manually remove entries from the sessions and userstable before it can be run successfully.<pre>kojiadmin@localhost$ point at your koji add-host kojibuilder1hub.example.com i386 x86_64</pre>''
; The URL for the xmlrpc server server==== Add http://hongkong/kojihub ; the host username has to be the createrepo channel ==same as what you used with add-host ; in this example follow as below user =arm-001-001 ;Matches your VM name ; The URL for the packages tree pkgurl=http://hongkong/yum/arm_built/base/12/arm/Channels are a way to control which builders process which tasks. By defaulthosts are added to the ; ''default'' channelThis item may be changed, but may not be the same as KojiDir on the kojihub. At least some build hosts also needs to conf file (although it can be addedto something under KojiDir, just not the same as KojiDir)''createrepo'' channel so there will be someone to process repo creation tasks initiated by kojira. ; The directory root for temporary storage workdir=/tmp/koji
<pre>kojiadmin@localhost$ koji add-host-to-channel kojibuilder1.example.com createrepo</pre>==== SSL Certificates For Authentication ====
==== A note on capacity ====The default capacity of a host added to Copy 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 appropriate certificate(s) 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.<code>HongKong:/etc/pki/koji/certs/</code>
<pre>koji@localhost$ psql kojikoji=# select (id, name, capacity) from host; row -------------------------------- (1,kojibuilder1/etc/kojid/kojid.example.com,2) (2,kojibuilder2.example.com,2)(2 rows)conf:
koji ;client certificate ; This should reference the builder certificate we created above, for ; kojibuilder1.example.com cert =# update host set capacity /etc/kojid/arm-001-008.pem ;certificate of the CA that issued the client certificate ca = 16 where id = 1/etc/kojid/koji_ca_cert.crt ;certificate of the CA that issued the HTTP server certificateUPDATE 1koji serverca =#</pre>etc/kojid/koji_ca_cert.crt
==== Start Kojid ====
{{Admon/important|Koji Host Entry|Before starting Kojid, make sure that the entry for your builder is in the database. The command to do this (as ''kojiadmin'' on HongKong) is <code>koji add-host ''hostname'' armv5tel<pre/code>}}root@localhost$ /sbin/After, start Kojid and configure it to start at each boot: service kojid start chkconfig kojid on == Testing ==Check </precode>Check /var/log/kojid.log </code> on the builder to verify that kojid has started successfully. Finally, check the [http://hongkong.proximity.on.ca/koji/hosts Koji hosts web display] on HongKong to see that the host is working properly -- it should be enabled, ready, and checking it.