A CLI UI to the Koji buildsystem
with commands to query tasks, install rpms, and check buildlog sizes.
Koji is the RPM package buildsystem used by
Fedora, CentOS, and some other projects.
Query Koji for tasks.
Somewhat like koji list-tasks --mine --quiet --all ...
,
but it shows duration, kojiweb urls and build.log size,
and it uses date
to parse a specified date string
and can filter task results by package or nvr prefix.
Usage
By default it lists your 10 most recent Fedora Koji buildArch tasks.
$ koji-tool query --help
Usage: koji-tool query [-S|--server URL] [-u|--user USER]
[(-L|--latest) | (-l|--limit INT)]
[(-t|--task TASKID) | (-c|--children TASKID) |
(-b|--build BUILD) | (-p|--package PKG)]
[-s|--state STATE] [-a|--arch ARCH]
[(-B|--before TIMESTAMP) | (-F|--from TIMESTAMP)]
[-m|--method METHOD] [-D|--debug]
[(-P|--only-package PKG) | (-N|--only-nvr PREFIX)]
Query Koji tasks (by default lists your tasks today)
Available options:
-S,--server URL Koji Hub [default: Fedora]
-u,--user USER Koji user [default: fasid]
-L,--latest Latest build or task
-l,--limit INT Maximum number of tasks to show [default: 10]
-t,--task TASKID Show task
-c,--children TASKID List child tasks of parent
-b,--build BUILD List child tasks of build
-p,--package PKG Build tasks of package
-s,--state STATE Filter tasks by state (open, close(d), cancel(ed),
fail(ed), assigned, free)
-a,--arch ARCH Task arch
-B,--before TIMESTAMP Tasks completed before timedate [default: now]
-F,--from TIMESTAMP Tasks completed after timedate
-m,--method METHOD Select tasks by method: [build,buildarch,etc] or
'any' (default 'buildArch')
-D,--debug Pretty-print raw XML result
-P,--only-package PKG Filter task results to specified package
-N,--only-nvr PREFIX Filter task results by NVR prefix
-h,--help Show this help text
Examples:
$ koji-tool query -a aarch64 --from "last week" -s fail
lists your arm64 tasks that failed in the last week.
List kojira tasks from the last hour:
$ koji-tool query --from hour -u kojira
completed after 2022-01-13 09:14:41+0800
epel7-infra-mailman newRepo TaskFailed
https://koji.fedoraproject.org/koji/taskinfo?taskID=81172651
Start: Thu Jan 13 10:12:09 2022
End: Thu Jan 13 10:14:09 2022
duration: 0h 2m 0s
List builds:
$ koji-tool query --package redhat-rpm-config --limit 2
redhat-rpm-config-212-1.eln114 (2022-01-23 12:50:46)
redhat-rpm-config-212-1.fc36 (2022-01-23 11:49:42)
Download and install rpms from a Koji build or task.
By default it only downloads binaries of already-installed subpackages,
but there are options to list and select or exclude specific subpackages.
Note this command is intended for development and testing purposes
and should not be necessary/used normally on production systems,
but it can be very helpful for quickly testing an specific package build or
update.
Usage
By default it uses Fedora Koji.
$ koji-tool install podman
will download the latest build for your Fedora version,
and try to install it.
Use --disttag
suffix to select a different Fedora version.
$ koji-tool install TASKID --exclude "*-devel"
will install all the non-devel subpackages from the task.
One can use --hub
to specify a different Koji hub build service.
Selecting subpackages
By default only installed subpackages are downloaded and updated,
but the following options change the behavior:
--package
: select subpackages by name or glob pattern (this doesn't work currently on multiple builds/tasks)
--exclude
: exclude subpackages by name or glob pattern
--all
: install all subpackages
--ask
: ask about each subpackage
Help
$ koji-tool install --help
Usage: koji-tool install [-n|--dry-run] [-D|--debug] [-H|--hub HUB]
[-P|--packages-url URL] [-l|--list] [-L|--latest]
[(-a|--all) | (-A|--ask) | [-p|--package SUBPKG]
[-x|--exclude SUBPKG]] [-d|--disttag DISTTAG]
[(-R|--nvr) | (-V|--nv)] PKG|NVR|TASKID...
Install rpm packages directly from a Koji build task
Available options:
-n,--dry-run Don't actually download anything
-D,--debug More detailed output
-H,--hub HUB KojiHub shortname or url (HUB = fedora, stream,
rpmfusion, or URL) [default: fedora]
-P,--packages-url URL KojiFiles packages url [default: Fedora]
-l,--list List builds
-L,--latest Latest build
-a,--all all subpackages
-A,--ask ask for each subpackge [default if not installed]
-p,--package SUBPKG Subpackage (glob) to install
-x,--exclude SUBPKG Subpackage (glob) not to install
-d,--disttag DISTTAG Use a different disttag [default: .fc35]
-R,--nvr Give an N-V-R instead of package name
-V,--nv Give an N-V instead of package name
-h,--help Show this help text
Shows the progress of active koji builds tasks
by checking the size of their build.log files.
This is useful for monitoring the build progress of large packages that take
a long time to complete for which some arch's may take considerably longer.
Usage
$ koji-tool progress --mine
:
$ koji-tool progress 81148584 # ← Koji taskid
:
23:19:19 vim-8.2.4068-1.fc36 (81148584)
aarch64 351kB [109,133 B/min]
armhfp 133kB [ 65,244 B/min]
ppc64le 493kB [141,598 B/min] TaskClosed
s390x 558kB [100,481 B/min] TaskClosed
The buildlog-sizes
command is similar but runs once over nvr patterns.
Installation
Builds for fedora are available in copr.
Build
cabal-rpm builddep && cabal install
or stack install
.
History
The query, install, progress, buildlog-sizes were originally separate programs
and projects (koji-query, koji-install, koji-progress),
and merged together into koji-install (after 0.5) and renamed
to koji-tool. See the other original repos for their history.