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.
Install the software
Open a terminal and use yum to install the needed software of use with Koji:
yum install koji-builder koji openssh-server
- /etc/kojid/kojid.conf - Koji Daemon Configuration
- /etc/sysconfig/kojid - Koji Daemon Switches
[koji] ;url of XMLRPC server server = http://koji.fedoraproject.org/kojihub ;url of web interface weburl = http://koji.fedoraproject.org/koji ;url of package download site topurl = http://kojipkgs.fedoraproject.org/ ;configuration for SSL authentication ;client certificate cert = ~/.fedora.cert ;certificate of the CA that issued the client certificate ca = ~/.fedora-server-ca.cert ;certificate of the CA that issued the HTTP server certificate serverca = ~/.fedora-server-ca.cert
An example kojid.conf (/etc/kojid/kojid.conf) file:
[kojid] ; The minimum amount of free space (in MBs) required for each build root minspace=4096 ; The vendor to use in rpm headers vendor=Fedora Project ; The packager to use in rpm headers packager=Fedora Project ; the distribution to use in rpm headers distribution=Fedora Project ; The _host string to use in mock mockhost=redhat-linux-gnu ; The URL for the xmlrpc server server=http://arm.koji.fedoraproject.org/kojihub ; The URL for the packages tree pkgurl=http://armpkgs.fedoraproject.org/packages topurl=http://armpkgs.fedoraproject.org/ ; A space-separated list of hostname:repository pairs that kojid is authorized to checkout from (no quotes) allowed_scms=pkgs.fedoraproject.org:/*:false:fedpkg,sources git.fedorahosted.org:/git/spin-kickstarts.git:false ; The mail host to use for sending email notifications smtphost=arm.koji.fedoraproject.org ; The From address used when sending email notifications from_addr=Fedora ARM Koji Build System <firstname.lastname@example.org> ;configuration for SSL athentication ;client certificate - puppet generated cert = /etc/kojid/localhost.pem ;certificate of the CA that issued the client certificate ca = /etc/kojid/koji_ca_local+fedora.crt ;certificate of the CA that issued the HTTP server certificate serverca = /etc/kojid/koji_ca_local+fedora.crt user = <host-name>
Ensure that there is a reasonable amount of space on the ARM system for mock (
/var/cache/mock) before proceeding. You will want a minimum of about 8GB. Since ARM system's generally use smaller media, use of an NFS share for this workspace works well.
Start the kojid daemon and ensure the software is started on boot.
systemctl enable kojid.service systemctl enable sshd.service
ARM Specific Configuration
echo 0 >/proc/sys/vm/swappiness
echo 3 >/proc/cpu/alignment
Add the following line to /etc/security/limits.conf
* - nofile 8192
More recent Fedora releases require a change be made to the mock group id, to ensure it does not conflict with the mock group on the host system. Failure to make this change will result in mock failing to initiate the build root, exit code 4. Run the following command as root:
groupmod -g 250 mock
You will then need to change the ownership on the mock directories.
chgrp mock /var/lib/mock
Koji default rpmbuild_timeout
Change the default build time out on Koji. This is hard coded in '/usr/lib/python2.7/site-packages/koji/__init__.py'. You will need to search for 'rpmbuild_timeout' and change the value to the desired amount. For ARM builds can take several days, it is recommended this be changed to 72 hours, or '259200' seconds.