Commit graph

20 commits

Author SHA1 Message Date
Michael Vogt
86b1143923 osbuildexecutor: show full osbuild exector on json decode errors
This is a short term workaround to get better visibility why
the osbuild executor sometimes sends non-json data. When reading
the result from the executor the entire output is now read and
if the json parsing goes wrong it will use the entire body
in the error message for better debug visibility.
2024-08-05 14:51:40 +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
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
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
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
56bdcf1cdc aws.ec2: prep sources before starting build 2024-03-19 17:07:30 +01:00
Tomáš Hozza
e7743f17ec Worker: allow configuring executor CloudWatch group
We need the ability to use different CloudWatch group for the
osbuild-executor on Fedora workers in staging and production
environment.

Extend the worker confguration to allow configuring the CloudWatch group
name used by the osbuild-executor. Extend the secure instance code to
instruct cloud-init via user data to create /tmp/cloud_init_vars file
with the CloudWatch group name in the osbuild-executor instance, to make
it possible for the executor to configure its logging differently based
on the value.

Cover new changes by unit tests.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-03-08 13:13:44 +01:00
Sanne Raymaekers
040eec4089 osbuild-worker: allow adding key to aws.ec2 executor
This is useful during testing to set up the executor machine.
2024-03-01 19:20:51 +01:00
Sanne Raymaekers
bfd1978ad8 osbuildexecutor/aws.ec2: pass the manifest to the job manager 2024-02-14 20:28:22 +01:00
Sanne Raymaekers
e7cadb16af osbuildexecutor: add aws.ec2 executor
This executor spins up an instance which can only contact the host, and
uses the osbuild-jobsite manager & builder to invoke osbuild.
2024-02-14 09:54:11 +01:00
Sanne Raymaekers
3db88960c2 cloud/awscloud: add ability to run a secure instance to awscloud
This instance can only contact the host, and requires this host to be
running on AWS itself with the appropriate IAM role.
2024-02-14 09:54:11 +01:00
Sanne Raymaekers
e10424de2f osbuildexecutor: introduce osbuildexecutor.Executor interface
Wrap the current osbuildexecutor.Executor in an interface so it's easier
to add different executors, which for instance can run osbuild in a VM.
2024-02-14 09:54:11 +01:00