Commit graph

5984 commits

Author SHA1 Message Date
Sanne Raymaekers
bf3ff40a65 dashboards: drop interval from composer dashboard and fix slo
The latency budget remaining used $__range instead of the 28d constant.
2023-10-03 11:48:37 +02:00
Sanne Raymaekers
f05a5b59f3 dashboards: drop API section from worker job stats dashboard
Renames the worker dashboard to worker job stats dashboard.

Drops the interval variable and relies solely on $__range and
$__rate_interval.
2023-10-03 11:48:37 +02:00
Sanne Raymaekers
1475e216d2 dashboards: add worker api dashboard
Also this one is made without a separate interval variable, instead
relying on $__rate_interval and $__interval.
2023-10-03 11:48:37 +02:00
Sanne Raymaekers
64e9f1a2c7 worker: don't log job not pending dequeue errors
This happens a lot when requesting a job by ID, which happens for the
manifest jobs.
2023-10-02 23:37:26 +01:00
Sanne Raymaekers
6e4cade608 cloudapi/v2: log manifest generation errors as a warning
Sometimes invalid customisations slip through, and this will make it
easier to read the logs looking for them.
2023-10-02 23:37:26 +01:00
Brian C. Lane
8ec783a4dd tests: Update to use golangci-lint v1.54.2 2023-10-02 23:59:12 +02:00
Brian C. Lane
b1f021c35e lint: Fix implicit memory aliasing in for loops in osbuild-worker 2023-10-02 23:59:12 +02:00
Sanne Raymaekers
33f9a6726e dashboards: fix composer dash request rate errors 2023-10-02 18:50:37 +02:00
Alexander Todorov
164df6ffcb Revert "Add softlockup_all_cpu_backtrace=1 boot argument"
This reverts commit 8aca402dff.
2023-10-02 16:50:32 +02:00
Tomáš Hozza
f6e0e99391 Worker/koji-finalize: include osbuild version in image metadata
Include the osbuild version used to build the image, in the image extra
metadata attached to the Koji build and image output.

Extend `koji.sh` to verify that the version is set and of the expected
value.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
Tomáš Hozza
dcb66db5e7 Worker/koji-finalize: set the actual osbuild version in buildroot info
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
Tomáš Hozza
cca362678b Worker/osbuild: include osbuild version in OSBuildJobResult
This will make it easier to reproduce image builds using the same
tooling which was used by the worker.

This change will enable to include the osbuild version in Koji build
metadata.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
Tomáš Hozza
2b6570c36c test/koji.sh: test manifest extra metadata in outputs and build
Test the content of manifest outputs extra metadata and that they are
the same as the metadata attached to the build extra metadata.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
Tomáš Hozza
191406d35b SPEC: enable default Go modules behavior on Fedora
It turns out, that Fedora Go RPM macros are disabling the Go modules
support by default for all builds. The reason seems to be the worry that
some Go macros may not support it. However, it is not disabled by
default on CentOS Stream or RHEL and the package builds just fine.

On Fedora, undefine the macro which explicitly passes `GO111MODULE=off`
to each build, to use the default compiler behavior instead.

Additional relevant info:
https://pagure.io/go-rpm-macros/c/35bd72648fe6cfa372f886b5692936ffb5b4389a
https://pagure.io/go-rpm-macros/c/df8452a5df762d8df1e871a103bc05a58c24cb8d

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
Tomáš Hozza
95169111de Worker/koji-finalize: include manifest metadata in the build metadata
Expose the extra metadata attached to each manifest output, also to the
build extra metadata under `osbuild_manifest` property. The value is a
map of all manifest metadata with keys being the filename of each
manifest.

This will expose the information about osbuild-composer and
osbuild/images versions used to produce the manifest in the Koji
buildinfo, including the Web UI.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
Tomáš Hozza
c27cf0253d Worker/koji-finalize: include composer and deps version in manifest MD
Include the osbuild-composer and its dependencies versions in the extra
metadata associated with the Manifest output when importing it to Koji.

This will make it possible to pin-point the exact version combination
which was used to generate the osbuild manifest used to built the image
imported to Koji.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
Tomáš Hozza
285cd30af2 Worker/osbuild: include Manifest info in Koji target result
Copy the Manifest info data from the Manifest job result to the Koji
target result, so that this information can be then imported to Koji
build metadata by the koji-finalize job.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
Tomáš Hozza
3c95ba8476 Include osbuild/images version in Manifest job result
Include the osbuild/images module version in the Manifest job result.
The module has direct impact on image definitions and the content of
produced manifest, therefore including this information in the Manifest
job result is very helpful for various purposes (debugging,
traceability).

This will enable to embed this information in the Koji build metadata.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
Tomáš Hozza
8866391d88 Include osbuild-composer version in Manifest job result
Extend the Manifest job result structure to hold information about
osbuild-composer version, which produced the manifest. This will be
useful for other job types which depend on it and can then push this
information further as needed.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
Tomáš Hozza
e63472ef44 Koji: expose osbuild artifact information in image metadata
Expose the osbuild information used to produce the image, in the image
extra metadata under the `osbuild_artifact` property.

This information will get included in the image / build extra metadata
and make it explicit how to reproduce the image build using osbuild and
the attached manifest.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
Tomáš Hozza
5b414a4516 Target: expose osbuild artifact information in target result
Add the information about osbuid artifact to the target result.
Specifically the name of the osbuild pipeline which was exported for the
specific target, and the filename of the exported file.

This will later enable embedding this information in Koji build metadata
to make it easy to reproduce the image build using the attached
manifest.
2023-09-27 12:39:28 +02:00
Tomáš Hozza
4f51d44762 Worker/koji-finalize: add cloud target results to image/build metadata
Add any non-Koji upload target results attached to an OSBuild result, to
the image extra metadata. This will make it easy to locate any image
from Koji uploaded to cloud, in the target cloud environment.

The rationale behind including only non-Koji target results is that one
can find it only in Koji, so there is no added value in including the
Koji target results at all.

Extend the `koji.sh` to check the target results in image metadata when
testing Koji scenario with cloud upload.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
Tomáš Hozza
e0ec3a2a1c Worker/koji-finalize: import osbuild manifest and log to Koji build
Import osbuild manifest and build log to the Koji build as outputs. Also
note the respective filenames in the image output extra metadata.

Note that the osbuild manifest is imported as a log file for now. Koji
has very limited set of output types defined and I still need to
determine the best way to use a custom output type in Koji instances (as
other content generators do).

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
Tomáš Hozza
70e125bd5e Worker/koji-finalize: rename buildArgs -> buildResult
Rename the variable to make it easily tell what it does at the first
glance. Previous name made it look as if it held build (job?) arguments,
which was not the case.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
Tomáš Hozza
68e78b80a5 Worker/OSBuild/Koji: upload manifest and osbuild output
Extend the Koji target handling in the OSBuild job implementation and
upload also the osbuild manifest and osbuild output log to Koji. Add all
the necessary metadata to the Koji target result options, so that
KojiFinalize job can then import them to the build.

Note that none of these files is yet imported by the KojiFinalize job.

Also note that the osbuild output log is still a JSON, which is not
great to read by humans. Adjustments to make it nice will be done in
following commits.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
Tomáš Hozza
efbaa93eef Target/Koji: rework result options to contain more than just image info
The `KojiTargetResultOptions` previously contained information only
about the uploaded image file. And even then, some information, such as
the filename, were scattered in other structures such as
`KojiFinalizeJob` struct.

Since the plan is to start uploading also osbuild manifest and osbuild
build log to Koji, we need to extend the result options structure to
hold more information and also make it specific to which file is the
information related.

Rework the `KojiTargetResultOptions` to contain information about:
 - the built image
 - build log
 - osbuild manifest

Information about each file contains:
 - filename
 - checksum type
 - file checksum
 - file size

For now, only the built image information is set and consumed by the
worker.

Add custom JSON (un)marshaler for `KojiTargetResultOptions` to handle
backward compatibility when old version of worker or composer server
interact with each other. Cover them with unit tests.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
Tomáš Hozza
27f98ec313 Target/koji: mark optional fields in BuildOutput as omitempty
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
Tomáš Hozza
a610bc3843 test/koji.sh: refactor and extend testing of build metadata
Refactor koji.sh:
- Store Koji hub URL in a variable and use it instead of a literal.
- Do not inspect builinfo output and don't parse it using grep and sed,
  but instead directly call Koji XMLRPC functions (using `koji call`)
  with JSON output.

In addition, test that the image archive extra metadata are the same as
those stored in the build extra metadata, stored under the image
filename.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-27 12:39:28 +02:00
dependabot[bot]
347239838c build(deps): bump the go-deps group with 1 update
Bumps the go-deps group with 1 update: [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go).

- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.45.16...v1.45.17)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-27 10:13:26 +02:00
Tomáš Hozza
5903aad07b tools/provision.sh: fix unbound variable bug if no OCI secrets are set
This was hit in c9s CI:
https://gitlab.com/redhat/centos-stream/rpms/osbuild-composer/-/merge_requests/88
https://artifacts.dev.testing-farm.io/658332f8-8705-4727-84d3-f27b57775037/

```
/usr/libexec/osbuild-composer-test/provision.sh: line 141: OCI_SECRETS: unbound variable
```

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-26 14:12:42 +02:00
dependabot[bot]
41aacd8817 build(deps): bump the go-deps group with 6 updates
Bumps the go-deps group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) | `1.45.10` | `1.45.16` |
| [github.com/gophercloud/gophercloud](https://github.com/gophercloud/gophercloud) | `1.6.0` | `1.7.0` |
| [github.com/openshift-online/ocm-sdk-go](https://github.com/openshift-online/ocm-sdk-go) | `0.1.364` | `0.1.371` |
| [github.com/osbuild/images](https://github.com/osbuild/images) | `0.5.1-0.20230915095808-dd48a38be218` | `0.7.0` |
| [github.com/vmware/govmomi](https://github.com/vmware/govmomi) | `0.30.7` | `0.31.0` |
| [google.golang.org/api](https://github.com/googleapis/google-api-go-client) | `0.142.0` | `0.143.0` |


Updates `github.com/aws/aws-sdk-go` from 1.45.10 to 1.45.16
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.45.10...v1.45.16)

Updates `github.com/gophercloud/gophercloud` from 1.6.0 to 1.7.0
- [Release notes](https://github.com/gophercloud/gophercloud/releases)
- [Changelog](https://github.com/gophercloud/gophercloud/blob/v1.7.0/CHANGELOG.md)
- [Commits](https://github.com/gophercloud/gophercloud/compare/v1.6.0...v1.7.0)

Updates `github.com/openshift-online/ocm-sdk-go` from 0.1.364 to 0.1.371
- [Release notes](https://github.com/openshift-online/ocm-sdk-go/releases)
- [Changelog](https://github.com/openshift-online/ocm-sdk-go/blob/main/CHANGES.md)
- [Commits](https://github.com/openshift-online/ocm-sdk-go/compare/v0.1.364...v0.1.371)

Updates `github.com/osbuild/images` from 0.5.1-0.20230915095808-dd48a38be218 to 0.7.0
- [Release notes](https://github.com/osbuild/images/releases)
- [Commits](https://github.com/osbuild/images/commits/v0.7.0)

Updates `github.com/vmware/govmomi` from 0.30.7 to 0.31.0
- [Release notes](https://github.com/vmware/govmomi/releases)
- [Changelog](https://github.com/vmware/govmomi/blob/main/CHANGELOG.md)
- [Commits](https://github.com/vmware/govmomi/compare/v0.30.7...v0.31.0)

Updates `google.golang.org/api` from 0.142.0 to 0.143.0
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.142.0...v0.143.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-deps
- dependency-name: github.com/gophercloud/gophercloud
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: github.com/openshift-online/ocm-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-deps
- dependency-name: github.com/osbuild/images
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: github.com/vmware/govmomi
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: google.golang.org/api
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-26 13:05:54 +02:00
Sanne Raymaekers
9d7159dab3 templates/packer: retry subscribtion 2023-09-25 11:56:42 +02:00
Sanne Raymaekers
e81183daa8 tools/appsre-ansible/rpmbuild: retry all tasks 2023-09-25 11:56:42 +02:00
dependabot[bot]
9e3602c088 build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-22 10:19:39 +02:00
Sanne Raymaekers
0dc1a01077 templates/packer: configure oracle cloud credentials on startup 2023-09-22 09:55:48 +02:00
Brian C. Lane
9e39080d00 lint: Fix implicit memory aliasing in for loops
Fix all instances of gosec G601: Implicit memory aliasing in for loop.
2023-09-21 16:56:54 +02:00
Brian C. Lane
1b65f15449 vendor: Update osbuild/images to commit dd48a38be218
This is needed for the test_distro.NewTestDistro change.
2023-09-21 16:56:54 +02:00
Brian C. Lane
eab16830aa test: Add checksum to cloudapi tests
These use 'pkg1' when depsolving, so they need an entry in the manifest
with the mocked checksum:

sha256:e50ddb78a37f5851d1a5c37a4c77d59123153c156e628e064b9daa378f45a2fe
2023-09-21 16:56:54 +02:00
Brian C. Lane
428e2c0ff2 cloudapi: Catch and log Serialize errors 2023-09-21 16:56:54 +02:00
Brian C. Lane
61c9a66b7e test: Use test_distro.NewTestDistro from images
and move the ResolveContent function from the images test_distro
package. api_test is the only place using it, so it belongs there, not
in images.
2023-09-21 16:56:54 +02:00
Brian C. Lane
0db61e0c21 dnfjson: Add mock checksums to the packages used in testing
Commit 312d87c6d5fab7ffd085a303e27b8db41111c86e adds validation of the
checksums to the ImageType.Manifest call, so it requires a valid looking
checksum, otherwise it will fail with a 'ManifestCreationFailed' error
when running the unit tests.
2023-09-21 16:56:54 +02:00
Brian C. Lane
c675e919fd api_test: Log the path being tested in TestModulesInfo 2023-09-21 16:56:54 +02:00
Sanne Raymaekers
3a9bcded32 templates/composer: fix cpu request/limits
The fluentd sidecar had the same request/limit as the service container,
and the migrate init-container had the fluentd request/limit. It should
be the other way round.
2023-09-21 12:41:06 +02:00
Sanne Raymaekers
5bb9d414a2 templates/compose: add startingDeadlineSeconds to maintenance job
The job won't run if it doesn't get scheduled within 30 minutes. This
prevents the job running multiple times in a row if it didn't get
scheduled, for instance due to resource limits.
2023-09-21 12:41:06 +02:00
Sanne Raymaekers
e0b2455acf templates/composer: parameterise maintenance job cpu req/limit 2023-09-21 11:11:35 +02:00
schutzbot
3287290484 Post release version bump
[skip ci]
2023-09-20 08:22:18 +00:00
yih
2c65ee228b add test case for iot-qcow2-image 2023-09-20 13:43:24 +08:00
Sanne Raymaekers
1e7e1308ab test/cases/api: don't print command traces
Causes some secrets to be dumped into the logs.
2023-09-19 22:57:06 +02:00
Sanne Raymaekers
522a54188a test/api: add oci test 2023-09-19 22:57:06 +02:00
Sanne Raymaekers
a632848c59 cmd/osbuild-worker: add default OCI configuration
Useful for hosted deployments, where target options are often empty or
incomplete.
2023-09-19 22:57:06 +02:00