From FedoraProject
(Bootstrapping a new Koji build environment)
 
Line 1: Line 1:
 
{{autolang|base=yes}}
 
{{autolang|base=yes}}
 
= Bootstrapping a new Koji build environment =
 
= Bootstrapping a new Koji build environment =
These are the steps involved in populating a new Koji server with packages so that it can be used for building.  This assumes that the Koji hub is up, appropriate authentication methods have been configured, the Koji repo administration daemon (<code>kojira</code>) is properly configured and running, and at least one Koji builder (<code>kojid</code>) is properly configured and running.  All koji cli commands assume that the user is a Koji ''admin''.  If you need help with these tasks, see the [[Koji/ServerHowTo| ServerHowTo]] .
 
  
* Download all source rpms and binary rpms for the arches you're interested in
+
This document has moved to the [https://docs.pagure.org/koji/ Koji Documentation]. The new location is:
  
* Import all source rpms
+
    https://docs.pagure.org/koji/server_bootstrap/
<pre>
 
$ koji import /path/to/package1.src.rpm /path/to/package2.src.rpm ...
 
</pre>
 
If the files are on the same volume as /mnt/koji, you can use <code>koji import --link</code>, which
 
hardlinks the files into place, avoiding the need to upload them to the hub and '''very significantly'''
 
increasing import speed.  When using <code>--link</code>, you must run as root.  It is '''highly''' recommended that
 
you use <code>--link</code>.
 
  
* Import all binary rpms using the same method as above
+
You can submit changes to Koji's docs in [https://pagure.io/koji Pagure]
 
 
* Create a new tag
 
<pre>
 
$ koji add-tag dist-foo
 
</pre>
 
 
 
* Tag all of the packages you just imported into the tag you just created
 
You can use <code>koji list-untagged</code> to get a list of all of the packages you just imported.
 
<pre>
 
$ koji list-pkgs --quiet | xargs koji add-pkg --owner <kojiuser> dist-foo
 
$ koji list-untagged | xargs -n 1 koji call tagBuildBypass dist-foo
 
</pre>
 
We call the ''tagBuildBypass'' method instead of using <code>koji tag-pkg</code> because it doesn't require
 
the builders to process ''tagBuild'' tasks one at a time, but does the tagging directly.  This will save a significant amount of time, especially when tagging a large number of packages.
 
 
 
* Create a build tag with the desired arches, and the previously created tag as a parent
 
<pre>
 
$ koji add-tag --parent dist-foo --arches "i386 x86_64 ppc ppc64" dist-foo-build
 
</pre>
 
 
 
* Create a build target that includes the tags you've already created
 
<pre>
 
$ koji add-target dist-foo dist-foo-build
 
</pre>
 
 
 
* Create a ''build'' group associated with your build tag
 
<pre>
 
$ koji add-group dist-foo-build build
 
</pre>
 
 
 
* Populate the ''build'' group with packages that will be installed into the minimal buildroot
 
You can find out what the current build group for Fedora is by running <code>koji -s <nowiki>http://$ARCH.koji.fedoraproject.org/kojihub</nowiki> list-groups f17-build</code>
 
against the Fedora Koji instance for your $ARCH.  This is probably a good starting point for your minimal buildroot.
 
<pre>
 
$ koji add-group-pkg dist-foo-build build pkg1
 
$ koji add-group-pkg dist-foo-build build pkg2
 
</pre>
 
 
 
* regenerate the repo
 
<pre>
 
$ koji regen-repo dist-foo-build
 
</pre>
 
* Wait for the repo to regenerate, and you should now be able to run a build successfully.
 

Latest revision as of 21:00, 23 August 2016

Bootstrapping a new Koji build environment

This document has moved to the Koji Documentation. The new location is:

   https://docs.pagure.org/koji/server_bootstrap/

You can submit changes to Koji's docs in Pagure