Setup Koji Builder SOP

Upgrading Builders

It is recommended to upgrade or reinstall all builders after each release. To do it, usually the builders are upgraded and virtual machines reinstalled. First they should be upgraded in staging environment to make sure everything is working properly before starting on production.

Before starting, confirm if there is a koji package update. If there is you may need to upgrade the hub/database first with the playbooks/manual/upgrade/koji.yml playbook.

Staging Environment

Follow the process to upgrade builders in staging environment:

  1. Chek with others that there’s not any ongoing testing in staging before starting.

  2. Update the virt-install path on the builders in ansible repository, like in this example

  3. Each builder virtual machine is removed, either via virt-inst-dest or manually

  4. Upgrade and reboot the bvmhost that contains those builders

  5. Then buildvm.yml playbook is run to reinstall them.

  6. The hub is re-installed or upgraded with dnf --refresh --releasever <release> distro-sync.(See note about koji / db upgrade above).

  7. Test builds are done to make sure everything is working.

Production Environment

For production a similar process is followed, but to avoid outages, builders are disabled, reinstalled and re-added small groups at a time. From buildvm-s390x-01 to buildvm-s390x-14 are zvm instances, they have to be updated with dnf --releasever NAME distro-sync. Likewise all the buildhw instances need to be upgraded as above or reinstalled with pxe (out of the scope of this document).

In production builders, are usually done per bvmhost at a time:

  1. To do this process the user should be koji admin

  2. Find all the builders on the host looking in /var/log/virthost-lists.out on batcave01 or look for vmhost variable in inventory/host_vars/ on ansible repository

  3. In a loop, disable all those builders using koji disable-host <vmname>. Like the example below:

    for i in seq -w 01 35
    do
      echo $i
      koji disable-host buildvm-s390x-$i.s390.fedoraproject.org
    done
  4. In a loop check for running builds on them with koji list-tasks --host <vmname>

  5. Either wait for all of them to finish or optionally run koji free-task NAME to free a task and another builder will pick it up, but this second option will restart the build and if it is a long running build it could disturb maintainers

  6. Once they are all empty, destroy them as above

  7. Upgrade and reboot the bvmhost they are on

  8. reinstall them with the buildvm playbook. Optionally, this is a good time to update the bvmhost and reboot it after destroying, but before installing builders

  9. After installed, check that each builder is checking in with koji list-hosts | grep <vmname>

  10. In a loop, reenable them

  11. move on to the next group.

For buildhw builders:

  1. disable builder with koji disable-host <buildhwname>

  2. In a loop check for running builds on them with koji list-tasks --host <vmname>

  3. Either wait for all of them to finish or optionally run koji free-task NAME to free a task and another builder will pick it up, but this second option will restart the build and if it is a long running build it could disturb maintainers

  4. update with dnf --releasever NAME distro-sync

  5. reboot

  6. confirm the buildhw is back up and checking into koji with koji list-hosts | grep buildhw