Commit graph

25 commits

Author SHA1 Message Date
Tomáš Hozza
742633662d internal/cloudapi: remove support for pulp.ostree upload target
It turned out that the target was never adopted by the service, thus it
is being deleted as part of upload code consolidation.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-12 19:42:51 +02:00
Achilleas Koutsou
6223c43cd7 cloudapi: new image type: azure-sapapps-rhui
osbuild/images v0.156.0, updated in
3fd7092db5, introduced a new Azure image
type: azure-sapapps-rhui.

Adding it to the cloud API.
2025-07-28 17:30:34 +02:00
Achilleas Koutsou
f6c1709d8d cloudapi: add azure-cvm image type
Introduce the azure-cvm (confidential VM) in the cloud API.
2025-06-24 15:38:32 +02:00
Achilleas Koutsou
e621386caf cloudapi: drop ImageRequest.GetImageOptions() method
This method is not particularly useful anymore.  Its purpose was to
initialise the ImageOptions from an ImageRequest with the appropriate
size and partitioning mode.  However, the partitioning mode was also
being set later using request.GetPartitioningMode().  More importantly,
setting the size on the ImageOptions caused issues with the interaction
between filesystem and partitioning customizations as well as the image
request size (see #4705).  The correct thing to do here is to map the
ImageRequest.Size directly onto ImageOptions.Size, without taking into
account ImageType or the Blueprint Customizations.  The rest are
considered when generating the manifest in images, either when preparing
the Manifest() call or when generating the partition table.  This makes
it easier to trace and reason about the effect of each option.  This
kind of decision making in the API layer makes it difficult to maintain
the logic, since it requires duplicating the decision making or, as we
had now, making certain specific combinations impossible.
2025-05-05 20:37:19 +02:00
Achilleas Koutsou
cf956ff5a6 Delete internal/blueprint/ and import from osbuild/blueprint
Import osbuild/blueprint v1.6.0
2025-04-17 11:17:58 +02:00
Sanne Raymaekers
7652af83d7 cloudapi/v2: adapt to new oapi-codegen
Fixed distribution list type, function signatures (later versions parse
uuids in the generated code), defaults actually being set and added
x-go-type where needed.
2025-03-26 11:13:14 +01:00
Sanne Raymaekers
7bfcac30dd cloudapi: support worker server target artifact retrieval
In order to get the artifact location from the cloudapi, add a helper
function in the worker server.
2025-01-24 15:26:15 +01:00
Sanne Raymaekers
425581fcc1 cloudapi/v2: support local upload target
The target validation rework broke the local upload target, which is
needed for cockpit-image-builder.
2025-01-22 13:54:40 +01:00
Sanne Raymaekers
8fd36225be cloudapi/v2: support HyperV generation in Azure upload options 2024-11-21 11:22:20 +01:00
Lukas Zapletal
64f479092d osbuild-worker: use the new ostree resolver API 2024-11-07 16:17:56 +01:00
Tomáš Hozza
d7e59e6eec Worker: move GCE image guest OS features to upload target options
Previously, the worker was determining the GCE image guest OS Features
on its own, based on the OS name. This caused problems, in case the
osbuild-composer was of a newer version than the worker.

Example:
osbuild-composer contained support for c10s GCE image type and its
implementation also contained the proper guest OS Features list for it.
However, when the worker got the osbuild job, it built it and tried to
fetch the guest OS Features for the distro. Since its implementation was
too old, it didn't contain the code that added the actual support for
c10s GCE images and got no guest OS features list (which is the default
for unsupported distros). The image was successfully uploaded and
shared, but it does not boot in GCP, because it does not know that it
should use UEFI to boot it.

This behavior could be considered a bug. The worker should be dumb. It
should not be making decisions about the image features, but instead it
should take them from the upload target options. And composer should be
the authoritative source of truth for this. Because otherwise, we
basically have two components that need to be updated in sync to add
support for GCE images on a new distro.

Move the GCE image guest OS features to the GCP upload target options.
The worker will just take what is specified there and use it when
importing the image to GCP. As a compatibility layer for the case when
the composer would be older than the worker (unlikely, but still),
worker will try to determine the image guest OS features in case the
list in the upload target options is empty.

Extend the GCP functional tests to check that the imported image has at
least some guest OS features set.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-08-29 17:37:48 +02:00
Sanne Raymaekers
b10bbc0fb0 cloudapi/v2: adapt to aws sdk v2 2024-08-20 15:32:40 +02:00
Ondřej Budai
9b965b0912 cloudapi: Add forgotten iot-simplified-installer to getDefaultTarget
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2024-02-21 12:09:01 +01:00
Ondřej Budai
08aabe1bef cloudapi: add minimal-raw 2024-02-21 12:09:01 +01:00
Ondřej Budai
eb3bd9dc43 cloudapi: sort image types in getDefaultTarget
Not a functional change.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2024-02-21 12:09:01 +01:00
Achilleas Koutsou
52d4b196a3 cloudapi: enable iot-bootable-container image type 2024-02-02 10:34:41 +01:00
Gianluca Zuccarelli
b711e302ba cloudapi: add pulp upload target
Add the pulp.ostree upload target to the cloud API and enable it for
edge/iot commits.

Co-Authored-By: Achilleas Koutsou <achilleas@koutsou.net>
2023-11-17 16:48:16 +01:00
Achilleas Koutsou
5c95eb565c cloudapi: support multiple upload targets
Read the upload target types and options in the UploadTargets array of
the ImageRequest and initialise the Target array.  If the top-level
(old) UploadOptions are also specified, prepend them to the array using
the image type's default target type.

Each upload target type is checked against a support map for
compatibility.
2023-11-17 16:48:16 +01:00
Achilleas Koutsou
d7ab1f2112 cloudapi: multiple upload targets in request
Add an array of targets in the imageRequest and return an array from
ImageRequest.GetTargets() (renamed from GetTarget()).  Currently, the
function still only returns one target, the default for the image type
with the top level upload options.
2023-11-17 16:48:16 +01:00
Achilleas Koutsou
9d990ea5da cloudapi: separate target selection from initialisation
Separate the target selection in GetTarget() into two steps.  First
determine the default target name for the image type and then use the
name to initialise the target object.  This is a bit more work (and
double switching) but will be needed to support selecting targets
externally.
2023-11-17 16:48:16 +01:00
Achilleas Koutsou
b011b9845a cloudapi: split GetTarget() into functions
Separate the handling of each individual target type into its own
function called by GetTarget()'s case switch.  This makes the function
more readable and the target object creation reusable.

Added an empty line after each creation of irTarget to make it easier to
visually distinguish the cases that fall through.
2023-11-17 16:48:16 +01:00
Brian C. Lane
d0877e68dc cloudapi: Add partitioning_mode support to the API
This adds a 'partitioning_mode' field that can be set to 'auto-lvm',
'lvm' or 'raw'. It defaults to 'auto-lvm'.
2023-10-23 14:52:30 +02:00
Sanne Raymaekers
a7794dc634 cloudapi/v2: add oci image type to cloudapi 2023-09-19 22:57:06 +02:00
Sanne Raymaekers
e5c4640923 cloudapi/v2: expose wsl image type 2023-08-28 14:51:01 +02:00
Brian C. Lane
c1e52aebc3 cloudapi: Refactor handler.go code to make testing easier
This moves some of the code from the PostCompose function in handler.go
into methods on the OpenAPI ComposeRequest and ImageRequest structs.

In compose.go I have added several methods.
GetBlueprintWithCustomizations takes the ComposeRequest customizations
and builds a Blueprint struct.

GetPayloadRepositories returns the custom payload repos.

GetSubscription returns the ImageOptions setup with optional
subscription information from the request.

In imagerequest.go I have added GetTarget which takes the upload
options and returns a Target. This moves the giant switch statement,
which may also benefit from further simplification at some point.

GetOSTreeOptions returns the OSTree ImageOptions if there are ostree
settings in the ImageRequest.

GetImageOptions returns the distro.ImageOptions with the size set.

This commit only moves the code, making PostCompose easier to read. All
tests still pass.

cloudapi: Move the size handling to a method on ImageRequest
2023-08-05 11:28:29 +02:00