Commit graph

3145 commits

Author SHA1 Message Date
Michael Vogt
573b349f16 clienterrors: rename WorkerClientError to clienterrors.New
The usual convention to create new object is to prefix `New*` so
this commit renames the `WorkerClientError`. Initially I thought
it would be `NewWorkerClientError()` but looking at the package
prefix it seems unneeded, i.e. `clienterrors.New()` already
provides enough context it seems and it's the only error we
construct.

We could consider renaming it to `clienterror` (singular) too
but that could be a followup.

I would also like to make `clienterror.Error` implement the
`error` interface but that should be a followup to make this
(mechanical) rename trivial to review.
2024-07-31 17:04:58 +02:00
Andrea Waltlova
7c830e90b0 Add password to User schema
Make sure password is encrypted
Update tests

Signed-off-by: Andrea Waltlova <awaltlov@redhat.com>
2024-07-22 09:11:36 +02:00
Achilleas Koutsou
dab896dd64 weldr: update expected error messages
Some depsolve-related error messages in osbuild/images changed.  Update
the expected error messages in our tests.
2024-07-04 19:01:07 +02:00
Sanne Raymaekers
3b3ffe0d08 internal/prometheus: more human-readable time buckets
Let's make them slightly easier to query and reason about. From 100 ms
to 24 hours.
2024-07-04 11:19:25 +02:00
Sanne Raymaekers
547f74e7db awscloud: try to terminate previous secure instance
In case the previous executor SI belonging to the worker did not get
shut down properly, attempt to do it again when starting a new one,
otherwise replacing the SG or LT will not work.
2024-06-28 15:33:08 +02:00
Sanne Raymaekers
791ec07bc2 internal/awscloud: fix cloud-init userdata for secure instance
The conditional only checked if the cloudwatch group was set, and if it
wasn't, the hostname variable wouldn't be set either. So the executor
would try to look for a hostname but not find any.
2024-06-26 10:56:57 +02:00
Sanne Raymaekers
ca19a5b5ed cloudapi/v2: add test for errors 2024-06-25 17:27:28 +02:00
Sanne Raymaekers
86fd957c9d cloudapi/v2: add details for non-service errors
In case Echo throws an error, or in case even echo doesn't manage to
catch an underlying error and wrap it, return as many details as
possible.
2024-06-25 17:27:28 +02:00
Sanne Raymaekers
39d2068d31 cloudapi/v2: detach HTTPErrorHandler from Server struct 2024-06-25 17:27:28 +02:00
Sanne Raymaekers
135dd94de5 cloudapi/v2: include details in case internal error is set
In case details aren't explicitly given, and the internal error is set,
include the internal error message in the details.
2024-06-25 17:27:28 +02:00
Lukas Zapletal
5ce8f65a58 cloudapi: propagate operation/external id
Signed-off-by: Lukas Zapletal <lzap+git@redhat.com>
2024-06-25 13:58:53 +02:00
Lukas Zapletal
f3c0daebbf cmd/osbuild-composer: journald support 2024-06-25 13:58:53 +02:00
Sanne Raymaekers
2a621521a8 osbuildexecutor/aws.ec2: set hostname of executor via cloud-init
This way much more of the journal will be captured under the new
hostname.
2024-06-25 10:58:10 +02:00
Sanne Raymaekers
14052e25db Revert "osbuildexecutor: write the job-id intro control.json"
This reverts commit c13d37c3c0.
2024-06-25 10:58:10 +02:00
Sanne Raymaekers
ae4467ab0d internal/awscloud: retry CreateFleet
When receiving the "UnfillableCapacity" error from CreateFleet, retry
the request with an OnDemand instance.
2024-06-24 12:50:37 +02:00
Michael Vogt
c13d37c3c0 osbuildexecutor: write the job-id intro control.json
Set the jobID into control.json so that the osbuild-worker-executor
can set the hostname based on the jobID.
2024-06-14 15:02:08 +02:00
Michael Vogt
aa3d70a429 osbuildexecutor: tweak RunOSBuild() signature and use opts
Introduce a new OsbuildOpts struct to make the API a bit easier
to extend and use in the packages.

Also add a new `JobID` field in the `OsbuildOpts`.
2024-06-14 15:02:08 +02:00
Sanne Raymaekers
2e31ea50aa cloud/awscloud: use instance requirements when creating secure instance 2024-06-14 10:59:58 +02:00
Sanne Raymaekers
4bb61da37e Revert "prometheus: active worker gauge"
This reverts commit 68bc8e0c88.
2024-06-12 17:20:01 +02:00
Michael Vogt
fedbd72d57 osbuildexecutor: allow file type tar.TypeGNUSparse too
We need to allow files of type `tar.TypeGNUSparse` in the result
that we get from the osbuild-worker-executor too.
2024-06-12 16:31:44 +02:00
Sanne Raymaekers
971e1df148 internal/osbuildexecutor: verify expected input from handleBuild 2024-06-12 13:10:52 +02:00
Sanne Raymaekers
8a5f486715 osbuildexecutor: wait until worker-executor closes the connection
Otherwise the client will try to fetch the output archive before the
build output is archived on the worker-executor side.
2024-06-12 11:36:30 +02:00
Sanne Raymaekers
db43ec8e60 osbuildexecutor: move tests to separate _test package 2024-06-12 11:36:30 +02:00
Michael Vogt
984f51feb8 osbuildexecutor: add validateOutputArchive() and run before extract
The tar file from the `osbuild-worker-executor` is potentially
tainted. Ensure we validate and only extract if it harmless.
2024-06-12 11:36:30 +02:00
Sanne Raymaekers
1f52150ff1 internal/osbulid-executor/aws-ec2: return more verbose errors
In RunOsbuild return more verbose errors where the error doesn't
originate from one of the local helper functions.
2024-06-12 11:36:30 +02:00
Sanne Raymaekers
4df04643ab internal/osbuildexecutor/aws-ec2: use osbuild-worker-executor
Adds some unit tests as well.
2024-06-12 11:36:30 +02:00
Tomáš Hozza
6e3a41ae07 Don't run TestMultilibBlueprintDepsolveV0 on el10 / c10s
TestMultilibBlueprintDepsolveV0 unit test relies on 'gsl' package and
the availability of its 32 bit and 64 bit versions in the distribution
repositories. However, the package is no longer available in c10s /
el10. Moreover, there are no 32 bit RPMs in the repositories.
Conditionally compile the test only if 'rhel10' build tag is not
specified. Modify the SPEC file to define 'rhelX' build tag when
compiling tests on RHEL, where X is the major version.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-06-04 13:03:37 +02:00
Achilleas Koutsou
f5c6cdd9cf blueprint: add new kickstart.contents option 2024-05-29 00:27:31 +02:00
Achilleas Koutsou
a3a539abd1 Update osbuild/images v0.63.0
Pulling in (among others):
- https://github.com/osbuild/images/pull/700
    - Blueprint User customization change required.
- https://github.com/osbuild/images/pull/705
2024-05-29 00:27:31 +02:00
Andre Marianiello
0ef11c1f07 internal/blueprint: Go fmt customizations test 2024-05-27 13:06:48 +02:00
Andre Marianiello
0ece609c8b Add ExpireDate to user customizations test 2024-05-27 13:06:48 +02:00
Brian C. Lane
66c5c5ecf9 cloudapi: Add UploadTypesLocal for local_save status reports
This allows the compose status to reflect that it was saved locally, not
uploaded to a remote service. Without this it returns an error of
'Compose has unknown upload target'
2024-05-13 13:27:12 -07:00
Sanne Raymaekers
68bc8e0c88 prometheus: active worker gauge 2024-04-19 14:32:07 +02:00
Sanne Raymaekers
1b4935c325 jobqueue: add channel to workers
Stores the channel alongside the worker.
2024-04-19 14:32:07 +02:00
Sanne Raymaekers
7d24ac5567 osbuildexecutor/ec2: pass extraEnv only to sources invocation
The extra env only contains paths to secrets which are needed to pull
sources. Since the sources don't get pulled on the executor, don't pass
the env along to the executor.
2024-04-17 23:01:57 +02:00
Sanne Raymaekers
d0a6828bd7 osbuild/images update: ignore repoconfigs where appropriate 2024-04-17 10:27:08 +02:00
Sanne Raymaekers
ebea7ce2df mocks/dnfjson: support new depsolve result
The new depsolve result includes repo configurations.
2024-04-17 10:27:08 +02:00
Sanne Raymaekers
173f37feb8 weldr: pass repoconfigs when serializing manifests 2024-04-17 10:27:08 +02:00
Sanne Raymaekers
dc7bc4763c cloudapi/v2: pass repoconfigs when serializing manifests 2024-04-17 10:27:08 +02:00
Sanne Raymaekers
e0759e01af worker: save repoconfigs in depsolve result 2024-04-17 10:27:08 +02:00
Achilleas Koutsou
809f2544ad deps: update images to v0.54.0
Update images dependency and adjust import paths for distro package
changes.

Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
2024-04-11 16:43:40 +02:00
Achilleas Koutsou
356a222b83 weldr: replace use of deprecated rand.Seed with New(NewSource(seed))
"rand.Seed has been deprecated since Go 1.20 and an alternative has been
available since Go 1.0: As of Go 1.20 there is no reason to call Seed
with a random value. Programs that call Seed with a known value to get a
specific sequence of results should use New(NewSource(seed)) to obtain a
local random generator."
2024-04-11 16:39:21 +02:00
Sanne Raymaekers
53f77368fd osbuild-worker: add support for mtls dnf repo secrets 2024-03-29 14:46:54 +01:00
Sanne Raymaekers
3be2c92a1b internal/blueprint: add ExpireDate to UserCustomization
Just to make osbuild-composer compile, this field is not functional yet.
2024-03-28 11:11:13 +01:00
Brian C. Lane
d3fc53bdec cloudapi: Override the request distro with the blueprint distro
When the blueprint sets a specific distribution it should be used
instead of the distribution from the compose request.

Includes a test to make sure it uses repositories from the blueprint,
not the request.
2024-03-22 19:12:24 +01:00
Sanne Raymaekers
314ed4b527 cloud/awscloud: allow internet access on secure instance again
The executor is timing out and there are no logs. This will require some
further work. Remove the restriction for now.
2024-03-20 14:58:25 +01:00
Achilleas Koutsou
3633528613 worker: drop compatibility test for DepsolveJob serialisation
This reverts commit c8ce3e4428
2024-03-20 12:12:12 +01:00
Achilleas Koutsou
80f8fa051c worker: drop backwards compatibility for DepsolveJob serialisation
We've kept this around a lot longer than we should have.

This reverts commit 94c7fda779.
2024-03-20 12:12:12 +01:00
Achilleas Koutsou
8f78171f83 cloudapi: add installer customizations to the API
Adding both as a traditional compose request customization and in the
new blueprint customizations.
2024-03-20 11:45:08 +01:00
Achilleas Koutsou
bd57d95e49 blueprint: add installer customizations 2024-03-20 11:45:08 +01:00