Commit graph

24 commits

Author SHA1 Message Date
Sanne Raymaekers
067366ed6a internal/target: add OCI object storage target
Uploads an OCI image to OCI object storage, and generates a
pre-authenticated request for the object, which can be used to import it
into custom images.
2023-09-19 22:57:06 +02:00
Ondřej Budai
d6eacad494 jobimpl-osbuild: report a failed job on panic
Previously, the worker would happily report success if osbuild succeeded,
there was no JobError, but the job actually panicked in the meantime.
Let's fix this by adding a recovery mechanism.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-09-01 13:23:25 +02:00
Gianluca Zuccarelli
b493da1878 internal/clienterrors: add file resolution error
Add a client error type for an error in the remote
file resolution job.
2023-03-16 09:55:39 +00:00
Sanne Raymaekers
96b42b5791 internal/worker: add String to clienterrors.Error struct
This should make the logging better when errors have another error
struct.

Fixes #3272
2023-02-16 00:55:34 +01:00
Sanne Raymaekers
ebeb339f96 osbuild-worker: add ostree resolve job
This job resolves an ostree ref. Similar to the depsolve and container
resolve jobs, this should be a dependency of a manifest job.
2022-10-19 18:14:10 +02:00
Christian Kellner
388154d7f6 cloudapi: support container embedding
Add support for embedding container images via the cloud API. For
this the container resolve job was plumbed into the cloud api's
handler and the API specification updated with a new `containers`
section that mimics the blueprint section with the same name.
2022-08-04 14:37:12 +02:00
Sanne Raymaekers
111feda1f5 worker: Remove ellipsis operator from clienterrors.Error
The ellipsis operator was used as a hack to not need to pass any details
as an argument, but it makes what the end object will actually look like
less obvious. It also makes it impossible to pass an array to details
without getting a nested array.

Fixes #2874
2022-08-03 13:51:52 +02:00
Christian Kellner
50e630a76f worker: add new container resolve job type
This is a new job that can be used to resolve containers. It uses
the existing `container.Resolver` class to do the actual work.
2022-07-25 21:21:44 +02:00
Tomas Hozza
58696e849f worker/koji-finalize: always report status back to composer and Koji
Enhance the `koji-finalize` job implementation to use deferred function
to ensure that the job status is always reported back to the composer.
In addition, if the `JobError` is set, also fail the Koji job.

Previously, composer and Koji were not updated in some corner cases when
the job would fail.
2022-07-22 11:39:49 +01:00
Tomas Hozza
6dcadc9d20 worker/osbuild: move target errors to detail of job error
Add a new worker client error type `ErrorTargetError` representing that
at least one of job targets failed. The actual target errors are added
to the job detail.

Add a new `OSBuildJobResult.TargetErrors()` method for gathering a slice
of target errors contained within an `OSBuildJobResult` instance. Cover
the method with unit test.
2022-07-01 18:55:01 +01:00
Ondřej Budai
0693274ffe worker/server: set a job error when heartbeat gets missing
Previously, we just used an empty struct when heartbeat failed. This is fine
for the osbuild job because it's treated as a failed one when
result.OSBuildResult == false which is the default value.

koji-finalize works differently though: It's in a failed state if there's
an job error of kojiError != "". So when failed heartbeat set the struct to
be empty, this was treated as success because there's no error.

Let's fix this by introducing a new error for the situation where we don't get
a heartbeat in time for a specific job.
2022-06-29 16:44:10 +02:00
Tomas Hozza
5bd02f2f27 worker: treat ErrorKojiFailedDependency as a dependency error
The `ErrorKojiFailedDependency` was previously not treated as a
dependency error. Fix it.
2022-06-10 14:48:18 +01:00
Tomas Hozza
d9e4889866 worker: rename HasDependencyError() -> IsDependencyError()
Rename the `HasDependencyError()` method to `IsDependencyError()` to
better express what it does.
2022-06-10 14:48:18 +01:00
Tomas Hozza
66f7eaf440 worker/osbuild: check errors of all job dependencies
Ensure that none of the job dependencies failed. This covers the case
when there are more than one job dependencies, which will be the case
for Koji composes.
2022-06-10 14:48:18 +01:00
Achilleas Koutsou
8a23a77c5b worker: add new error type for RepoError
dnf-json now returns a new error kind: RepoError
Add it to the list of known error types and handle it in the worker.
2022-06-01 11:36:52 +01:00
Gianluca Zuccarelli
30d75d0e74 worker/clienterrors: depenency error check
Add a helper function to check for dependency
errors for job errors. This simply returns true
if a job error has a dependency error code and
false otherwise.
2022-04-13 10:31:53 +02:00
Gianluca Zuccarelli
b1969ba6a6 worker/clienterrors: omit details if empty
Omit the details field if it is null/empty.
2022-04-13 10:31:53 +02:00
Gianluca Zuccarelli
14b006d480 worker/clienterrors: add empty packagespec error
Add an error case for an empty package spec returned
by a depsolve job and mark this with a `4xx` status.
2022-04-06 21:34:02 +01:00
Gianluca Zuccarelli
cc7d555fb2 worker/errors: consider dep errors as 4xx status
All dependency errors, whether they are 4xx or 5xx,
are currently being considered as a 5xx error in parent
jobs. This is causing some of the build alerts to fire
off when a depsolve job has failed, for example, when
in reality, this is an expected result. This commit
ensures that dependency errors are being reported as
4xx status in monitoring.
2022-04-06 10:57:37 +02:00
Gianluca Zuccarelli
8241e1f948 worker/clienterrors: add empty manifest error
If a manifest is empty we should have a specific error
code for that case and treat it as a 4xx error since
this would be bad input for a build job
2022-04-06 10:57:37 +02:00
Sanne Raymaekers
318a4525c6 cmd/osbuild-worker: dnf-json returns MarkingErrors (plural) 2022-03-11 10:13:27 +01:00
Gianluca Zuccarelli
1e443cf0fa worker: fix error status codes
The DNFDepsolveError and DNFMarking error should have
a `4xx` code instead of a `5xx` error code.
2022-02-04 19:30:25 +01:00
Gianluca Zuccarelli
290472dfdf metrics: add worker error metrics
This commit introduces the collection of error
metrics since it is now possible to differentiate
between internal errors and user input errors.
Additionally, the error status is reported for
job duration metrics.
2022-02-03 23:40:42 +00:00
Gianluca Zuccarelli
daf24f8db3 worker: define worker errors
Define worker errors to give more structured
error messages. The error api is:
id: VALIDATION_ERROR_NUMBER, reason: STRING, details: { issues: [{...}, {...}] }

The api was agreed upon with osbuild so that,
in future, osbuild errors will share the same
structure
2022-01-27 16:45:14 +01:00