koji-tool: Koji CLI tool for querying tasks and installing builds

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

koji-tool is a CLI interface to Koji with commands to query tasks, install rpms, and track buildlog sizes.

Koji is the RPM-based buildsystem of Fedora Linux and CentOS.


[Skip to Readme]

Properties

Versions 0.6, 0.6.1, 0.6.2, 0.7, 0.8, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.8.6, 0.8.7, 0.9, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.9.5, 1.0, 1.0.1, 1.1, 1.1.1, 1.2
Change log ChangeLog.md
Dependencies base (<5), directory, extra, filepath, format-numbers, Glob, http-common (<0.8.3.4), http-directory (>=0.1.9), koji (>=0.0.2), pretty-simple, rpm-nvr (>=0.1.1), simple-cmd, simple-cmd-args, text, time, xdg-userdirs [details]
License BSD-3-Clause
Copyright 2021 Jens Petersen <juhpetersen@gmail.com>
Author Jens Petersen <juhpetersen@gmail.com>
Maintainer Jens Petersen <juhpetersen@gmail.com>
Category Utility
Home page https://github.com/juhp/koji-tool
Bug tracker https://github.com/juhp/koji-tool/issues
Source repo head: git clone https://github.com/juhp/koji-tool.git
Uploaded by JensPetersen at 2022-01-25T05:15:06Z

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for koji-tool-0.6.2

[back to package description]

koji-tool

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.

koji-tool query

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 results by package.

Usage

By default it lists your recent Fedora Koji 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)

koji-tool install

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

koji-tool progress

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.