Commit graph

45 commits

Author SHA1 Message Date
Tom Gundersen
6bab73f378 kojiapi: move from chi to echo
Follow the worker API so we standardise on one library. This simplifies
the code quite a bit.

No functional change.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-09-21 11:18:45 +01:00
Tom Gundersen
06c582a206 tests: drop osbulid-composer-koji-test
This was not hooked up in CI, and was instead replaced by
`tests/image-tests/koji.sh`.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-09-17 17:34:57 +02:00
Tom Gundersen
9666be2891 schutzbot: add koji integration tests
This sets up containers running koji and supporting infrastructure, and
calls the osbuild-composer-koji API to build and image and push it into
our testing instance.

koji-compose.py and various fixes by Christian Kellner.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-09-16 00:15:02 +01:00
Ondřej Budai
e7fbf4b660 upload/koji: add support for uploading to Koji
Introduce a target for Koji and hooked it up in the worker, so if koji
target is specified, the image is uploaded to koji.

[teg: use system kerberos config rather than reading from env]
2020-09-16 00:15:02 +01:00
Ondřej Budai
91b86a1369 osbuild-composer: add a socket for Koji API
Add a systemd socket for Koji API. If enabled when osbuild-composer.service
is started, the service will also listen on the socket and serve Koji API
there.

Note that Koji API doesn't upload to Koji yet, this still needs to be hooked
up.

Based on a patch from Tom Gundersen, thanks!
2020-09-16 00:15:02 +01:00
Tom Gundersen
67e4182ba4 kojiapi: add a server/client implementation of the OpenAPI spec
This just translates between the OpenAPI spec and our internal
API.

This still lacks tests, but a follow-up commit adds integration tests.

`internal/kojiapi/openapi.gen.go` was automatically generated from
`internal/kojiapi/openapi.yml`. To regenerate use `go generate ./...`.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-09-16 00:15:02 +01:00
Lars Karlitski
ad11ceecf4 worker: use openapi spec and generated code
Write an openapi spec for the worker API and use `deepmap/oapi-codegen`
to generate scaffolding for the server-side using the `labstack/echo`
server.

Incidentally, echo by default returns the errors in the same format that
worker API always has:

    { "message": "..." }

The API itself is unchanged to make this change easier to understand. It
will be changed to better suit our needs in future commits.
2020-09-06 18:42:23 +01:00
Tom Gundersen
b7fb52dc7d 20
Release osbuild-composer version 20.
2020-08-23 16:44:07 +02:00
Tom Gundersen
b0cd29f78b worker: support returning returning images as StreamOptimized
vCenter requires images to be uploaded as vmdk StreamOptimized. Lorax
always produced images on this format, so we should make sure to do the
same for our VMWare images.

Allow LocalTarget to request the images produced by osbuild be converted
to be streamOptimized before saving in composer, and hook the weldr API
up to enable this option for vmdk images.

Ideally this should simply be an option in osbuild, but that would
require some more work, which we will not manage in time for RHEL8.3.
Therefore do this minimal fix.

Note that that means the images produced by our manifests (including in
our image-test test cases) are not on the format that the weldr API
returns, so the tests we run on them would also, for now, need to
convert before uploading to vCenter.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-08-23 14:45:27 +02:00
Tom Gundersen
f3cba8ecfc vmwaretest: avoid using the cli
This is not shipped in RHEL, so use the library directly to query the IP
address. This is a massive hack, but let us revisit this after the next
release.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-08-20 21:59:54 +02:00
Alexander Todorov
9cce43d384 tests: upload & test in vCenter. Closes #338 2020-08-20 21:59:54 +02:00
Tom Gundersen
06c8461684 19
Release osbuild-composer 19.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-08-10 21:46:25 +02:00
Ondřej Budai
5ab8b59803 18
Release osbuild-composer version 18.
2020-07-22 17:04:23 +02:00
Martin Sehnoutka
09208c9237 spec: bump osbuild requirement to v18
SELinux labels are only supported since this version.
2020-07-22 10:47:46 +01:00
Tom Gundersen
fbfa191c81 rcm: drop sub-package
The osbuild-composer-rcm package was never finished, not in use and will be replaced by osbulid-composer-koji.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-07-17 19:13:15 +01:00
David Rheinsberg
cdcf212a52 spec: pull in systemd-nspawn
The composer-tests use systemd-nspawn, so make sure the `*-tests` RPM
depends on `systemd-container`.

Right now this dependency is recursively fulfilled by the `osbuild`
RPM. However, this might change if we switch to `bubblewrap` as a
sandbox. Furthermore, we should not fulfill our dependencies
recursively, but list them directly.
2020-07-17 07:42:27 -05:00
Ondřej Budai
add2ad98e0 17
Release osbuild-composer version 17
2020-07-08 17:35:27 +02:00
Tom Gundersen
5ff7fcfc3a spec: bump obsoletes version
Currently, RHEL 8.3 ships lorax-composer 28.14.49, which we want to
replace. 28 <= 28.14.49, so this did not work, bump it to 29, so we do
not get tripped up by bugfix releases of lorax-composer.

In the event that this obsoletes should one day be reverted, we do not
bump it to "infinity", so a sufficiently new version of lorax, would still
be able to obolte osbuild-composer again.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-07-08 14:23:19 +02:00
Ondřej Budai
534c508c41 16
Release osbuild-composer version 16
2020-06-29 19:48:46 +02:00
Tom Gundersen
f87154af75 spec: obsolete lorax-composer
osbuild-composer is a drop-in replacement of lorax-composer, and
side-by-side installation is not supported. It is still possible to
explicitly install lorax-composer and exclude osbuild-composer, but the
default is to replace lorax with osbuild on upgrades.

This change is for now only for RHEL8.3, but we should consider doing
the same for F33.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1836844

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-06-29 16:04:38 +02:00
Alexander Todorov
6d7181e832 osbuild-composer-tests now Requires osbuild-composer-rcm 2020-06-24 15:14:47 +02:00
Alexander Todorov
f7c4dca5d5 tests: upload & boot image in OpenStack. Closes #339 2020-06-23 16:17:30 +02:00
Ondřej Budai
5991666b8a spec: make the subpackages require a matching version of composer
The subpackages are not really meant to be used with a different version of
the osbuild-composer package. This commit enforces.the usage of a matching
version in the spec file.
2020-06-15 07:18:31 -05:00
Ondřej Budai
6bc200df14 15
Release osbuild-composer version 15
2020-06-12 14:15:49 +02:00
Tom Gundersen
cffb527a39 spec: bump osbuild deps
Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-06-11 19:17:03 +02:00
Ondřej Budai
a8f6281da2 14
Release osbuild-composer version 14
2020-06-03 23:35:09 +02:00
Stef Walter
20c40b59ac osbuild-composer.spec: Add a dependency on osbuild-ostree
The new functionality that landed in b0cfec767a
needs this dependency in order to function.

Fixes #689
2020-05-29 22:22:04 +02:00
Ondřej Budai
76c18566fc spec: exclude i686 architecture
RHEL 8 doesn't have golang in the i686 buildroot anymore. Fedora doesn't have
i686 images and kernel anymore. Also, osbuild-composer doesn't have support
for building i686.

Let's exclude i686 for these reasons, it's dead.
2020-05-28 19:44:13 +02:00
Ondřej Budai
5f0dffefe4 13
Release osbuild-composer version 13
2020-05-28 09:44:36 +02:00
Ondřej Budai
fcd3394a82 spec: bump the osbuild dependency to version 15
The new Fedora IoT image type uses org.osbuild.ostree.commit assembler with
tar option that was introduced in osbuild 15, therefore the dependency version
must be bumped.

This also bumps the submodule to 9cbedc04. That's basically version 15 of
osbuild with one fix related to secrets.
2020-05-28 00:31:30 +02:00
Alexander Todorov
ef392a5b93 Build -tests RPM on RHEL unconditionally 2020-05-15 09:35:24 +02:00
Ondřej Budai
e2c9b9d881 12
Release osbuild-composer version 12
2020-05-14 07:30:56 +02:00
Ondřej Budai
169f54ed34 11
Release osbuild-composer version 11
2020-04-29 20:42:37 +02:00
Ondřej Budai
c6b9bf4545 spec: fix warnings during the package removal
Currently, removing osbuild-composer produces these warnings:

Failed to stop osbuild-worker@.service: Unit name
osbuild-worker@.service is missing the instance name.
See system logs and 'systemctl status osbuild-worker@.service' for details.
Failed to stop osbuild-remote-worker@.service: Unit name
osbuild-remote-worker@.service is missing the instance name.
See system logs and 'systemctl status osbuild-remote-worker@.service' for
details.

%systemd_preun calls on a package upgrade this:
systemctl --no-reload disable --now [ARGS...]

I tried using a wildcard:

systemctl --no-reload disable --now "osbuild-worker@*.service"

But this gives:

Invalid unit name "osbuild-worker@*.service" was escaped as
"osbuild-worker@\x2a.service" (maybe you should use systemd-escape?)
Failed to disable unit: Unit file osbuild-worker@\x2a.service does not exist.

In the end I decided to use two commands - disable and stop. Disable works
without a wildcard, stop requires one. This solution should mimic systemctl
disable --now pretty well.
2020-04-29 10:50:58 +02:00
Ondřej Budai
e3acf45588 spec: fix warnings during the package upgrade
Currently, upgrading osbuild-composer produces these warnings:

Failed to try-restart osbuild-worker@.service: Unit name
osbuild-worker@.service is missing the instance name.
See system logs and 'systemctl status osbuild-worker@.service' for details.
Failed to try-restart osbuild-remote-worker@.service: Unit name
osbuild-remote-worker@.service is missing the instance name.
See system logs and 'systemctl status osbuild-remote-worker@.service'
for details.

%systemd_postun_with_restart calls on a package upgrade this:
systemctl try-restart [ARGS...]

However, try-restart requires using a wildcard when restarting all
the services created from a template unit. This commit therefore adds the
wildcards.
2020-04-29 10:50:58 +02:00
Ondřej Budai
e235fdedb3 tests/image: boot the vhd images on Azure
Previously, vhd images were tested using QEMU. This commit changes that to
boot them in the actual Azure infrastructure.

Azure VMs have quite a lot of dependencies - a network interface, a virtual
network, a network security group, a public ip address and a disk. Azure CLI
and Azure Portal handle the creation of all these resources internally.
However, when using the API, the caller is responsible to create all these
resources before creating an actual VM.

To handle the creation of all the resources in the right order, a deployment
is used. A deployment is a set of resources defined in a JSON document.
It can optionally take parameters to customize each deployment. After the
deployment is finished, the VM is up and ready to be tested using SSH.

Sadly, the deployments are a bit hard to clean-up. One would expect that
deleting a deployment removes all the deployed resources. However, it doesn't
work this way and therefore it's needed to clean up all resources "manually".
For this reason, our deployment sets a unique tag on all the resources created
by the deployment. After this test is finished, the API is queried for all
the resources with the tag and then, they're deleted in the right order.
2020-04-27 20:34:20 +02:00
Ondřej Budai
5d77188de0 bump osbuild to version 12
We will soon need the support for vhdx format, which is supported since
osbuild 12.

This commit bumps the dependency in the spec file and also updates the
submodule.
2020-04-24 15:27:39 +02:00
Ondřej Budai
dbfc2a0929 10
Release osbuild-composer version 10
2020-04-15 16:59:42 +02:00
Martin Sehnoutka
e887518736 image-tests: Include qemu command specific for aarch64
The osbuild-image-tests don't currently support boot test for any
alternative architecture because the qemu-system-x86_64 command is
hardcoded. This patch introduces a branch specific to aarch64, but
without a KVM support as I was unable to make it run in Beaker, which is
currently the only offering we have with ARM machines. As a workaround
the boot tests will be skipped if kvm kernel module is not found and only
image-info tests will run.
2020-04-15 15:22:57 +02:00
Martin Sehnoutka
2b83a16c37 osbuild requirement: bump to version 11
The newest osbuild is needed for support for aarch64. The aarch64 images
are using GPT which requires stable partuuid which was included in the
latest osbuild release (11). This will be used to produce stable
image-info tests.
2020-04-07 21:14:05 +02:00
Ondřej Budai
09109b4f8e 9
Release osbuild-composer version 9
2020-04-01 15:56:57 +02:00
Lars Karlitski
c5823d92b4 spec: build test binaries against installed libraries
On Fedora, the `%gobuild` macro turns off go modules and sets gopath to
installed libraries (in `/usr/share/gocode`).

When building the test binaries, we used `go test -c` directly, which
downloaded the libraries into GOPATH. That's wasteful and doesn't work
in mock (without internet). Replicate what `%gobuild` does by setting
`GO111MODULE=off` and `GOPATH` to the correct value.

RHEL uses modules as intended. No change is necessary.
2020-03-31 09:48:23 +02:00
Brian C. Lane
856eb59edf client: Move the weldrcheck integration tests to client
With this change the integration tests can now also be run as unit tests
against the mocked server. The way it works is this:

internal/client/unit_test.go sets up the mock server and is built
when the `integration` build tag is *not* included.

internal/client/integration_test.go sets up the connection to an
existing server and is built when the `integration` build tag *is*
included.

The test code is built and run for both cases.

Currently they all pass for the integration test run. The unit test
cases need some work because the mocked server isn't a real server with
real depsolving and package lists. A future commit will fix this.
2020-03-27 19:07:33 +01:00
Ondřej Budai
0d5c2d141c spec: add notes to remove the lines related to renaming in F34
The packaging guidelines requires that these provides and obsoletes stays
in the spec file for 2 fedora versions. The name change was introduced in
Fedora 32, there the lines should be removed in F34.
2020-03-25 11:43:39 +01:00
Ondřej Budai
0b08eb1904 spec: add spec file for osbuild-composer package
We successfully renamed the package in Fedora to osbuild-composer
(RHBZ #1815577). This commit adds the new spec file.

Changes: the tests subpackage is not built by default, to build it
--with tests parameter must be passed to rpmbuild.

Let's hope both spec files stay in sync.
2020-03-25 11:43:39 +01:00