Commit graph

3375 commits

Author SHA1 Message Date
Tomáš Hozza
3db1f88f84 internal/awscloud: use AWS.DeleteEC2Image() from osbuild/images
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-13 09:36:58 +02:00
Tomáš Hozza
e7d8431489 internal/awscloud: use AWS.TerminateInstancesEC2() from osbuild/images
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-13 09:36:58 +02:00
Tomáš Hozza
3d0110f14e internal/upload: delete pulp upload code
It turned out that the Pulp upload target was never adopted by the
service, thus it is being removed as part of upload code consolidation.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-12 19:42:51 +02:00
Tomáš Hozza
3b8779d469 internal/target: delete support for PulpOSTree target
It turned out that the target was never adopted by the service, thus it
is being removed as part of the upload code consolidation.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-12 19:42:51 +02:00
Tomáš Hozza
dd99c0cb78 internal/weldr: 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
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
Tomáš Hozza
fe840e1ddf Use VMWare upload implementation from osbuild/images (HMS-9026)
Delete the VMWare upload implementation from osbuild-composer and use
the one from osbuild/images.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-12 16:22:36 +02:00
Tomáš Hozza
a75f2b95fd pkg/awscloud/test: delete unused code
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-12 13:15:43 +02:00
Tomáš Hozza
caa7816121 internal/awscloud: remove S3 client from AWS struct
This functionality is not needed any more, since it is provided by the
osbuild/images version of AWS.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-12 13:15:43 +02:00
Tomáš Hozza
4f0ae84add internal/awscloud: remove S3 manager from AWS struct
This functionality is not needed any more, since it is provided by the
osbuild/images version of AWS.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-12 13:15:43 +02:00
Tomáš Hozza
0b5bfa044f internal/awscloud: remove S3 presign client from AWS struct
This functionality is not needed any more, since it is provided by the
osbuild/images version of AWS.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-12 13:15:43 +02:00
Tomáš Hozza
7645f60f27 internal/awscloud: use AWS.Regions() from osbuild/images
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-12 13:15:43 +02:00
Tomáš Hozza
5d73c22bb5 internal/awscloud: use AWS.ShareImage() from osbuild/images
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-12 13:15:43 +02:00
Tomáš Hozza
a3937e99ce internal/awscloud: use AWS.Register() from osbuild/images
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-12 13:15:43 +02:00
Tomáš Hozza
27bae770e9 internal/awscloud: use AWS.S3ObjectPresignedURL() from osbuild/images
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-12 13:15:43 +02:00
Tomáš Hozza
a73820b4a8 internal/awscloud: use AWS.MarkS3ObjectAsPublic() from osbuild/images
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-12 13:15:43 +02:00
Tomáš Hozza
13ba870fc6 internal/awscloud: use AWS.Upload() from osbuild/images
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-12 13:15:43 +02:00
Tomáš Hozza
4595339774 internal/awscloud: delete unused method
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-12 13:15:43 +02:00
Tomáš Hozza
d594005f25 internal/awscloud: start embedding awscloud.AWS from osbuild/images
Start embedding the awscloud.AWS from osbuild/images in
osbuild-composer's version of awscloud.AWS. The idea is to remove all
methods from osbuild-composer implementation, which are used for
uploading and registering images in AWS. The rest that it related to
service maintenance or to running secure instances, will be kept in
osbuild-composer, since these are specific to the project.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-12 13:15:43 +02:00
Tomáš Hozza
e3d7a3c8a3 internal/client: add backward compatibility with images < v0.172.0
The changes to the TestComposeUnsupportedMountPointV0() test case when
the osbuild/images has been updated to v0.172.0 broke the RHEL nightly
and GA CI pipelines.

Change the test to be backward compatible with osbuild/images <
v0.172.0.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-08 14:50:18 +02:00
Achilleas Koutsou
8d9f52cf1f go.mod: update osbuild/images (v0.172.0) and osbuild/blueprint (v1.12.0)
The internal blueprint implementation has been removed from
osbuild/images.  Conversion from osbuild/blueprint blueprints to
osbuild/images blueprints is no longer necessary.
2025-08-07 20:15:33 +02:00
Tomáš Hozza
19dd832876 go.mod: update osbuild/images to v0.171.0
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-07 16:33:15 +02:00
Tomáš Hozza
9042ee7806 Many: delete osbuild-image-tests command and related code
Delete the no longer used osbuild-images-tests command. Subsequently,
delete the /internal/boot packages, which were used only by the command
and also depended on its data structures.

Technically, no boot test were done using the code in this repository
for quite some time. And the long term plan is to boot test all images
in the osbuild/images repository.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-07 10:22:55 +02:00
Brian C. Lane
78e983b69a cloudapi: Add support for depsolving a blueprint + image type
This uses the blueprint and the image type's manifest with a minimal
imageRequest to get the package sets to use for depsolving, instead of
just using the packages in the blueprint.

This does not work with iot image types that require an ostree url.
Depsolving iot commits doesn't make sense anyway, since the blueprint
packages have no effect on it.

Includes simple tests for depsolving with image type, and returning an
error if the image type isn't recognized.

Related: RHEL-60125
2025-08-06 15:35:38 -07:00
Brian C. Lane
c2f982e6cc cloudapi: Add optional image_type to depsolve yaml
This will be used to select the image type to combine the blueprint with
when depsolving the packages that will be on the final image.
2025-08-06 15:35:38 -07:00
Lukas Zapletal
a58a399008 v2: update errors test for new error type
The oapi-codegen update to v2.5.0 changed the Details field of the main
Error type to be an empty interface. This requires updates to the error
handling tests to accommodate the new structure.
2025-08-05 18:55:32 +02:00
lzap
e118df5dfd chore: bump Go dependencies 2025-08-05 18:55:32 +02:00
Achilleas Koutsou
b3d1e4cf13 Makefile: bump GOLANGCI_LINT_VERSION to v1.61
v1.60 seems to have some issues [1] with something in our dependency
chain.  Update to v1.61 and fix all new issues.

New issues are all instances of potential integer overflow from int ->
uint conversions.  Added guards where appropriate and disabled the check
when when it's not needed.

[1] https://github.com/osbuild/osbuild-composer/actions/runs/16624417387/job/47037518471
2025-07-31 12:34:24 +02:00
Sanne Raymaekers
0e2daa201f many: switch to osbuild/images/pkg/upload for azure
This is part of consolidating all the upload code in images.
2025-07-29 13:10:22 +02:00
Lukas Zapletal
26ab15b1c9 worker: silence linter 2025-07-28 20:39:32 +02:00
Lukas Zapletal
b932daaa76 weldr: remove double import 2025-07-28 20:39:32 +02:00
Lukas Zapletal
39a65e3f34 client: improve test temporary dirs 2025-07-28 20:39:32 +02:00
Lukas Zapletal
9db1f304fa auth: refactor errors to have prefix 2025-07-28 20:39:32 +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
Sanne Raymaekers
d7686244cd cmd/osbuild-composer-dbjobqueue-tests: add migration test
Migration 9 alters the result column in the jobs table is relied on for
compose statuses. Because it has to be kept consistent across
migrations, add a test to verify this.

As a side effect, the test itself handles the migration now, so remove
that part from the tests GHA.
2025-07-25 13:10:10 +02:00
Sanne Raymaekers
c4360a67f5 jobqueue: handle escaped null bytes in postgres
Postgres doesn't accept `\u0000` in the jsonb datatype. Switch to the
json datatype which is larger and slower, but accepts escaped null
bytes.

As we don't actually query or index the result jsonb directly, the
impact of this should be minimal.

See: https://www.postgresql.org/docs/current/datatype-json.html
2025-07-25 13:10:10 +02:00
Achilleas Koutsou
ccb8e9ae33 cloudapi: use distrofactory to get rhel-9.3
Same as in 57813199cf.

The test was importing `distro/rhel/rhel9`, which is going away, instead
of using the distrofactory.
2025-07-24 10:37:37 +02:00
Tomáš Hozza
93ffcb80cd Test/weldr: adjust expected responses newly omitempty BP properties
The latest version of osbuild/blueprint changed some BP properties
to be 'omitempty', thus the expected API responses need to be adjusted
to account for this change.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-07-14 17:20:02 +02:00
Tomáš Hozza
3e3f9a0789 Many: move to koji upload implementation from osbuild/images
Delete the `internal/upload/koji` package and replace it with
`pkg/upload/koji` package provided by `osbuild/images`.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-07-14 17:20:02 +02:00
Tomáš Hozza
7a580f79ae go.mod: bump osbuild/images to v0.158.0
Use the version that contains the updated Koji upload code.

Also bump the version of `osbuild/blueprint` due to the new `uri` field
in file customizations.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-07-14 17:20:02 +02:00
Brian C. Lane
60c5f10af8 cloudapi: Fix the href of the delete response
Originally it was going to include /delete/ in the path. It was removed
in the openapi yaml but not in the result from deleteComposeImpl.
2025-07-11 00:47:22 +02:00
Brian C. Lane
07d34f339c cloudapi: Use error 400 for cloudapi delete errors
The most common one is going to be trying to delete a compose before it
is finished, and that is certainly not worthy of a 500 server error
since it is a temporary state.
2025-07-11 00:47:22 +02:00
Tomáš Hozza
97c3460a94 cmd: delete osbuild-koji
Delete the osbuild-koji tools, which is not used by any code or test
case. This also allows to delete the koji.NewFromPlain() function. This
is to minimize the set of exported functions by the koji package, before
moving it to osbuild/images repository.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-07-09 22:51:53 +02:00
Tomáš Hozza
651946ae54 upload/koji: don't depend on upload target osbuild artifact structure
Modify the Koji image extra metadata to not depend on the upload target
data structure for the OSBuild Artifact. This is the last dependency on
the internal osbuild-composer package, allowing the move of the Koji
upload code to the osbuild/images repository.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-07-09 22:51:53 +02:00
Tomáš Hozza
2ceffb3796 upload/koji: don't depend on upload target results data structures
Modify the Koji image extra metadata to not depend on the upload target
data structures for upload results. The target results are supposed to
be specific to the uploader implementation, which will eventually
change. Moreover, the definition is internal to osbuild-composer, so
this would create a problem once the Koji upload implementation is moved
to osbuild/images.

The Koji upload implementation does not really care about the exact
structure of the upload results. It is just a list of JSON objects.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-07-09 22:51:53 +02:00
Tomáš Hozza
0bafc0915d upload/koji: don't depend on rpmmd.RPM for build metadata
The use of rpmmd.RPM is exclusive to the Koji upload implementation.
Consolidate the metadata structure for RPMs into the koji package
codebase, together with any required functions for converting osbuild
stage metadata. The respective code in osbuild/images will be eventually
removed.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-07-09 22:51:53 +02:00
Tomáš Hozza
0ca81d5af4 upload/koji: move metadata structures to a separate file
Increase readability by logically splitting the build metadata
structures from the actual upload API implementation.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-07-09 22:51:53 +02:00
Tomáš Hozza
dc8f8964a4 upload/koji: delete unused GSSAPICredentialsFromEnv()
The function is not being used anywhere, therefore delete it.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-07-09 22:51:53 +02:00
Tomáš Hozza
ca1e1dce36 Many: factor out logger implementation from upload/koji
The upload/koji package functions were creating a logger and then were
using it. This is not ideal for a library implementation.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-07-09 22:51:53 +02:00
Tomáš Hozza
60014b1218 upload/koji: use passed transport in NewFromPlain()
Don't create a new transport in NewFromPlain() using
CreateRetryableTransport(), because the only place
in which NewFromPlain() is called passes the return value of
CreateRetryableTransport() when calling it.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-07-09 22:51:53 +02:00