Commit graph

227 commits

Author SHA1 Message Date
Christian Kellner
bb992ab688 test/builder: fix image status route response
The correct response is one status object for each image request.
2020-11-13 11:06:10 +01:00
Christian Kellner
3f51470d9c test/builder: use multiple arches in build check
In the builder unit test that checks a successful compose, use
more than one architecture, and check that an image request was
created for all of those. This should expose bugs multi-arch
specific bugs.
2020-11-13 11:06:10 +01:00
Christian Kellner
630d09f6c4 ci: generate koji certs with SAN in make-certs.sh
Generate the certificate to be used for koji in make-certs.sh by
the same CA that also generates the composer and client certs.
Create a single certificate that uses the SubjectAltName (SAN)
extension to cover two domains: localhost, org.osbuild.koji.koji,
which previously was done via two separate certificates; this is
the legacy usage which stopped working with go 1.15 (see previous
commit). As a consequence the apache config is modified to use
only one virtual host with a ServerAlias directive.
2020-11-12 13:13:55 +01:00
Christian Kellner
6f439dc34f ci: rework ssl cert generation (SAN usage)
Rework the generation of certificates, in order to make use of
the SubjectAltName (SAN) extension, that is required for modern
usage of TLS (see RFC 2818, or [1]) and now enforced by default
for go version 1.15[2] (Fedora 33). For this a different config
file is used, originally written by Lars, and assign SANs to
the server and client certificates. Additionally, the correct
extensions are used for each of those, so that their usage is
limited to the server or client use case. The client certificate
is renamed from "worker" to "client".
The lifetime of the certificates is increased, as a side effect of
the new config file.

[1] https://github.com/urllib3/urllib3/issues/497
[2] https://golang.org/doc/go1.15#commonname

Co-authored-by: Lars Karlitski <lars@karlitski.net>
2020-11-12 13:13:55 +01:00
Christian Kellner
f529ffe394 test: use quay mirror for the postgres container
The official postgres container image is fetched from docker.io,
which recently introduced rate limiting, which makes introduces
possible CI error if we run into this limit.
Instead use a custom mirror[1] of the official image, hosted on
quay.io[2]. As a side effect this updates the posgres version
from 12 to 13.

[1] osbuild/containers@7db3c68
[2] quay.io/osbuild/postgres:v1
2020-11-10 13:26:06 +01:00
Christian Kellner
2c37256f65 ci: use api socket, not koji socket
Instead of installing and enabling the koji socket, use the new
api socket. The koji socket is not properly wired up anymore
and any attempt to actually use it with hang.
2020-11-10 12:31:08 +01:00
Christian Kellner
f6b493f60c ci: update composer to release 23 for Fedora 32
Also update the Fedora CI to osbuild 23, so that it is in sync
with the RHEL ci. This is important since the koji socket has
been deprecated by the api socket and the koji socket actually
does not work anymore.
2020-11-10 12:31:08 +01:00
Ondřej Budai
90945ee509 composer: update to osbuild-composer 23 2020-11-10 12:31:08 +01:00
Ondřej Budai
67ee36d24d schutzbot: update the repository directory to RHEL 8.3
Schuztbot now uses RHEL 8.3 image. It's needed to change the repository
directory from 8.2 to 8.3 to accommodate the switch.
2020-11-10 12:31:08 +01:00
Christian Kellner
180cdefbad test/cli: check for release command line arg
Check that specifying `--release` results in the corresponding
entry (`release`) in the options dictionary (`opts`).
2020-11-03 20:40:36 +01:00
Christian Kellner
58f6a60e15 test/cli: check for repo command line argument
Check that specifying `--repo` multiple times results in the
corresponding options dictionary (`opts`) entry, called `repo`.
2020-11-03 20:40:36 +01:00
Christian Kellner
f69ce030db test/cli: specify expected argument values
In the basic invocation test, specify the expected argument values
not only their type. With the exception of the default image type
they correspond to the various command line arguments given.
2020-11-03 20:40:36 +01:00
Christian Kellner
51bda2671d HACKING.md: fix client plugin install instructions
Make the destination of the link be an absolute path, but more
importantly fix the actual path the plugin gets installed in.
2020-11-03 19:40:54 +01:00
Christian Kellner
1078ec427e 2
This completes the development of koji-osbuild version 2
2020-11-03 12:15:47 +01:00
Christian Kellner
969b74bf4c NEWS.md: prepare for release version 2
This is a bug fix release.
2020-11-03 12:15:47 +01:00
Christian Kellner
d38ea07ab5 NEWS.md: delete some extra whitespaces
No need for the extra spacing. This format is now consistent with
the one in osbuild.
2020-11-03 12:15:47 +01:00
Christian Kellner
c2107b4798 ci: spell check source via codespell
Integrate the codespell github action to spell check the source
code in CI.
2020-11-03 11:31:29 +01:00
Christian Kellner
a37fe00b05 container: fix spelling in hub/kojiweb.conf
Found by codespell.
2020-11-03 11:31:29 +01:00
Christian Kellner
50a0b09b5d README.md: fix links to example configs
Remove extra "`" chars that broke the link.
2020-11-03 11:31:29 +01:00
Christian Kellner
0b4a13e8c7 test/builder: more architectures in build tag
Add more supported build architectures to the standard build tag.
This will check the logic for (un-)supported build architectures
in the builder plugin. If we only have one arch, which is the
requested arch, it will not catch logic errors, that invert the
supported vs requested architectures.
2020-11-03 10:54:04 +01:00
Tomas Kopecek
9d6d278ffb builder: invert missing arch support logic
The builder plugin checks that all of the requested architectures
are indeed supported, which is determined via the build tag. It
does that by constructing two sets, the requested architectures
and the supported architectures, and then constructing the set
of (asymmetric) differences between the one and the other. This
difference was meant to be "requested" - "supported", which then
will contain architectures that have been requested but are not
supported, or be empty in case all requested architectures are
indeed supported (the good case). However, previously the diff
was done the other way around ("supported" - "requested"), which
will then return a set of architectures that are supported but
were not requested, which is not what we want to check for.

Invert that the argument of the difference to indeed end up with
"requested" - "supported", which results in the correct check.
2020-11-03 10:54:04 +01:00
Christian Kellner
12a7793900 spec: require python3-jsonschema (hub plugin)
The hub plugin uses jsonschema, so it must explicitly depend on
it. The dependency is installed "by hand" in the container since
by default, the plugin is not installed via the RPM, but copied
from the source repository and thus all dependencies must be
present already.
2020-11-03 09:20:03 +01:00
Christian Kellner
8d40baedf8 test/builder: avoid using list in keyword argument
Although in that specific use case it was fine, since the list
was copied before usage, pylint in newer versions was unhappy.
2020-10-29 17:12:03 +01:00
Christian Kellner
f5564c5f1f ci: explicitly install the dnsname podman plugin
On RHEL a pre-compiled version is currently installed from the
vendor directory (see the README.md there). On Fedora it is
packaged in podman-plugins and that used to be installed
without explicitly asking for it, but that seems to have changed.
Explicitly install it on Fedora to ensure it is present.

Symptom of the dns plugin missing is that the koji hub container
will not start because it will block waiting for the postgres
container forever.
2020-10-28 21:48:44 +01:00
Christian Kellner
768c25744f NEWS.md: add news entries for release 1
More of a description of the project and existing functionality
than highlights.
2020-09-30 15:17:03 +02:00
Christian Kellner
58f23204fc README.md: Fix cli plugin sub-command in intro
It is `osbuild-image` not `osbuild-command`.
2020-09-30 15:17:03 +02:00
Christian Kellner
4a23652ed8 README.md: add installation instructions 2020-09-30 15:17:03 +02:00
Christian Kellner
8772ee5acf README.md: explain what this is about a bit more
Also some white-space changes to the source more readable.
2020-09-30 15:17:03 +02:00
Christian Kellner
8fccf0857f spec: change upstream URL to new location
The project now is located at https://github.com/gicmo/koji-osbuild
2020-09-30 15:17:03 +02:00
Christian Kellner
57347fbbb7 editorconfig: add markdown settings 2020-09-30 15:17:03 +02:00
Christian Kellner
e6f9721276 test/run-builder: use command -v instead of which
The latter is non-standard according to ShellCheck. Let's use the
standard one.
2020-09-29 21:40:25 +01:00
Christian Kellner
b1b7425ca6 test/make-tags.sh: KOJI_SERVER env variable
Introduce KOJI_SERVER that can be set outside, defaulting to
http://localhost:8080/kojihub for local testing.
2020-09-29 21:40:25 +01:00
Christian Kellner
30aa71563c test: DATA_DIR can be externally defined
Change the use of DATA_DIR across all scripts so that it will
only be set if it does not yet exist. This makes it possible
to change the location of it across all scripts at once.
2020-09-29 21:40:25 +01:00
Christian Kellner
4dd2e6d814 test: SHARE_DIR can be externally defined
Change the use of SHARE_DIR across all scripts so that it will
only be set if it does not yet exist. This makes it possible
to change the location of it across all scripts at once.
2020-09-29 21:40:25 +01:00
Christian Kellner
aa8513c20d test: move container/ into test/
Move the container directory, containing the container definitions
for all the test containers, to test/, where all the other test-
related files are located (with the exception of `Schutzbot`).
Use `test/build-container.sh` to build the container, instead of
replicating that in `test-integration.sh`.
2020-09-29 21:40:25 +01:00
Christian Kellner
b625f96c2b test: move run-builder into test/
Move the run-builder.sh helper into the `test/` sub-directory. It
is mainly needed for testing together with the other test scripts.
2020-09-29 21:40:25 +01:00
Christian Kellner
660f0f2700 test: move run-koji-container.sh to test/
Move the run-koji-container.sh helper into the `test/` sub-directory.
It is mainly needed for testing together with the other test scripts.
2020-09-29 21:40:25 +01:00
Christian Kellner
05f1ecac8e test: move make-tags.sh into test/
Move the make-tags.sh helper into the `test/` sub-directory. It is
mainly needed for testing together with the other test scripts.
2020-09-29 21:40:25 +01:00
Christian Kellner
00c2313226 test/builder: use handler factory everywhere
Convert all tests so they use the new handler factory method.
2020-09-29 21:40:25 +01:00
Christian Kellner
4325ad00b6 test/builder: use handler factory in config checks
Use the new generic handler factory method in the configuration
data checks, eliminating a lot of duplicated code. No semantic
change intended.
2020-09-29 21:40:25 +01:00
Christian Kellner
d9c0f9e316 test/builder: add handler factory helper
Add a new helper method that can be used to create an instance of
OSBuildImage. Optionally, the session and options can be passed
in as well as a custom config data, otherwise the default session
and object are used. If custom configuration data was specified,
a temporary configuration file with the config data is created
and set plugin-wide so it is picked up by the object constructor.
2020-09-29 21:40:25 +01:00
Christian Kellner
7ecf7447e4 builder: use 'server' instead of 'url' for config
Mostly to be more in line with how things are called in all other
koji configuration files.
2020-09-26 11:37:02 +01:00
Christian Kellner
1b8277c078 README.md: include sample builder configuration
To highlight how the builder plugin is configured and where to put
the configuration files.
2020-09-26 11:37:02 +01:00
Christian Kellner
3ee5966b79 HACKING.md: add Patches, Coding Style sections
Small hint where to file patches and what the coding style is.
2020-09-26 11:37:02 +01:00
Christian Kellner
01de94bc44 HACKING.md: small formatting adjustmensts
Declare code blocks to be shell, add a newline here and there.
2020-09-26 11:37:02 +01:00
Christian Kellner
b9c3a3d2f9 all: sync with composer changes
Upstream composer has introduce a few changes that we need to
adapt for:

 - the koji composer API is now exposed on the standard https
   port (443). Thus koji hub and web need to move to a different
   pair: 8080 (http) and 4343 (https). Change the scripts and
   tests for that

 - the koji API gained a prefix 'api/composer-koji/v1/'. Change
   client and unit tests to use that prefix. Use urljoin to
   create new APIs

 - composer configuration format (osbuild-composer.toml) has
   changed and now also includes configuration for the CA
   and allowed domains

 - update the composer RPM repositories to the commit for the
   21 upstream release.
2020-09-25 22:33:31 +01:00
Christian Kellner
3b9980df50 test/build-container: simple helper script
Simple helper to build the two container for the hub and the builder.
2020-09-25 22:33:31 +01:00
Christian Kellner
b2a62d4dcf HACKING.md: troubleshooting and cleanup sections
Some more help if stuff goes wrong and some cleanup instructions.
2020-09-25 22:33:31 +01:00
Christian Kellner
add4f77e68 container/hub: disable notification
We don't ever want to send out email notifications for anything
during testing.
2020-09-25 15:26:36 +01:00
Christian Kellner
ec16d4fb14 HACKING.md: move useful links from README.md
There are not of general interest, but are specific to plugin
development. Move it to HACKING.md.
2020-09-25 15:26:36 +01:00