Skip to main content

Installation

koji-image-builder is comprised of several (sub) packages that need to be deployed on the various parts that make up your Koji installation. Installing koji-image-builder provides the imageBuilderBuild and imageBuilderBuildArch task types.

koji-image-builder and its subpackages are available in Fedora, EPEL 8, EPEL 9, and EPEL 10 and can be installed through dnf. image-builder itself needs to be available in the Koji tags (buildroots) you want to use to build images. image-builder is packaged for Fedora, CentOS, and RHEL starting with 9.7 and 10.1.

The installation section is comprised of two parts, one is to install the appropriate packages in the right places and to configure them to be enabled. The second part is the general Koji configuration regarding tags and groups and such.

Infrastructure

While every Koji deployment is slightly different it might be useful to take a look at the pull requests that enabled koji-image-builder on Fedora.

Hub

On the machines that act as the 'hub' in koji you want to install the koji-image-builder-hub package.

Configuration

In your hub.conf make sure that image_builder is included in the list of Plugins:

Plugins = ... image_builder

Builder

On all builders that you want to be able to serve tasks of the imageBuilderBuild, or imageBuilderBuildArch types you should install the koji-image-builder-builder package. If you're using specific Koji channels for image builds that means all machines in those channels.

Configuration

In your kojid.conf make sure that image_builder is included in the list of Plugins:

Plugins = ... image_builder

Restart kojid afterwards.

Web

On the machines that host your Koji's web interface you want to make sure the tasks are listed in the configuration. Make sure that the Tasks list contains imageBuilderBuild and imageBuilderBuildArch:

Tasks = ...,imageBuilderBuild,imageBuilderBuildArch

And make sure that the ParentTasks list contains imageBuilderBuild:

ParentTasks = ...,imageBuilderBuild

Koji Setup

After you've finished the infrastructure part of your deployment it's time to configure Koji so tasks can be submitted and processed. The commands here are to be executed as a user with administrative privileges on your relevant Koji instance. Take the examples and adjust them to what's appropriate for your setup.

To start with you need a tag you're going to use to build images in, this can be a pre-existing tag, or a new one. You might want to set up tag inheritance to appropriate other tags but this is setup dependent.

# Create a new tag
$ koji add-tag image-builder-build

# Set the tag to use 'old chroots', `image-builder` needs loopback devices and these do
# not work with 'new chroot'.
$ koji edit-tag -x mock.new_chroot=0 image-builder-build

You likely already have tags you want to build images for. You can add a target for those:

# Add the target `target-name` which takes the `image-builder-build` build tag
# and tags builds into `destination-tag`
$ koji add-target target-name image-builder-build destination-tag

Your build tag needs some packages in it, so let's configure a group for it:

# Add the `image-builder` group to the `image-builder-build` tag
$ koji add-group image-builder-build image-builder

# Add the `image-builder` package to the `image-builder` group in the `image-builder-build` tag
$ koji add-group-pkg image-builder-build image-builder image-builder

After this you should be able to build images with image-builder in the image-builder-build tag.