This project provides image-builder
integration with Koji. image-builder
is a tool that builds images (as the name says).
To use koji-image-builder
you'll need to install the relevant plugin package for each corresponding service.
Install koji-image-builder-builder
on your builders (the machines that run kojid
). After installation enable the service by adding to, or updating its configuration file at /etc/kojid/kojid.conf
.
plugins = image_builder
Install koji-image-builder-hub
on your hub. After installation enable the service by adding to, or updating its configuration file at /etc/koji-hub/hub.conf
.
Plugins = image_builder
Once you have installed the plugins you can proceed to configuring your instance. The below should be adapted to your own tag and target setup. This example is based on Fedora's setup.
- Create an
image-builder-build
group which containsimage-builder
anddistribution-gpg-keys
. - Create
fXX-image-builder-build
tags, which contain theimage-builder-build
group and havemock.new_chroot
set to0
. - Create
fXX-image-builder
targets, which use thefXX-image-builder-build
tags as their build tag and thefXX
tag as their target. - Add the
image-builder-build
group to your build tag. - Create packages for the things you want to build in the target tag, for example
Fedora-Minimal
On a machine that has access to your koji instance in the image
channel (or is an admin
) install koji-image-builder-cli
which will provide the command line plugin. You can then perform a build with the following command, provided you adjust the values to how you configured your tags, targets, and package names.
$ koji image-builder-build --repo "https://some/compose/repo" fedora-42 Fedora-Minimal 42 minimal-raw
# ... output ...
The values mean the following:
$ koji image-builder-build --repo "Repository used to source packages from for the build" $distribution $package-to-store-build $package-version $imagetype
# ... output ...
More options are listed under the --help
argument:
$ koji image-builder-build --help
# ... output ...
The unittests mock out the majority of koji
-provied classes and run quickly, you can run them with:
$ pytest test/unit
# ...
These tests set up a full containerized koji
environment and does image builds in it. sudo
is required for this. The tests take long, especially if the containers need to be built. The following does a quick smoke test by setting up the entire environment and doing a build from the command line.
$ sudo python3 run.py test
# ...
Leaving out the test
argument lets you run a local koji environment to interact with.