Engineering Log 2020-07-22

Koji Policy

I spent a day and a half to come up with this:

[policy]
channel =
        target local8 && method build :: use nextgen
        method buildSRPMFromSCM && is_child_task :: parent
        method buildArch && is_child_task :: parent

This policy example does the following:

  1. matches any submitted build that has target of local8 and method of build Sends the task to nextgen channel
  2. matches any task with method of buildSRPMFromSCM and is_child_task Sends the task to the parent’s channel
  3. matches any task with method of buildArch and is_child_task Sends the task to the parent’s channel

This policy only affects rpm builds. A more comprehensive policy needs to be written for image builds.

During the discovery phase of this, I consulted the #koji irc channel on freenode.net.

I had to update koji-hub from 1.18 to 1.21.1 and run the appropriate postgres update scripts located in /usr/share/doc/koji-<version>.

Comprehensive Koji Policy

[policy]
channel =
        target local8 && method build :: use nextgen
        method buildSRPMFromSCM && is_child_task :: parent
        method buildArch && is_child_task :: parent

        target image-centos-8 && method image :: use nextgen
        method createImage && is_child_task :: parent

        target local32 && method build :: use nextgen

The above policy forces rpm builds with a target of local8 and build method to use the nextgen channel. The subsequent method calls force the task to use the parent channel. This ensures that builds are handled by the correct build- host. local32 was added for fun. It is a Fedora 32 buildroot.