Let's move all SQL queries together. In the following commit, we will actually
put all of them into a transaction in order to ensure atomicity.
This isn't a functional change, just code shuffling.
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
If inserting a heartbeat or querying dependencies fail, we don't want to
actually dequeue the job from the database.
The failures may be:
- context timeout/cancellation
- network issues
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
when it discovers "missing distros" b/c this check isn't suitable for
downstream RHEL anyway. See comment in script for more details!
Related: COMPOSER-1943
Update the version of the worker in the old worker/new composer
regression test. The test, up until now, was using a pinned version
of osbuild-worker (v51) which made use of dnf-json as a socket.
Testing a new composer version with such an outdated worker instance
is very unrealistic since the workers and composer are normally
updated in lock step, or in some cases the worker may be a version
behind.
This commit takes the current worker version and then downgrades it
to two versions ago (out of caution) to perform the tests. This
provides a more realistic scenario.
The size of the page blob is defined on creation and the blob is
zero-initialized. Therefore, we can just skip all the pages that contain
only zeros. This should save a lot of bandwidth if used on sparse files as
e.g. operating system images. (:
https://github.com/Azure/azure-storage-blob-go/ is deprecated, the main SDK
should be now used instead. Let's migrate the code. There should be no
functional changes.
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This adds a new field `Warnings` to the `ComposeReply`
struct, allowing to send back any warnings (e.g. deprecation
notices) generated during the `checkOptions` step of the
manifest initialization.
See also https://github.com/osbuild/weldr-client/pull/99 which
handles the weldr-client side of things.
Signed-off-by: Irene Diez <idiez@redhat.com>
This changes the `Manifest` function of the `ImageType`
interface so that any warnings detected during the
`checkOptions` step of the manifest initialization can
be propagated back to the Weldr-API (see next commit).
Signed-off-by: Irene Diez <idiez@redhat.com>
We sometimes skip testing customizations for image types that don't
support them, other times, we check for a specific error. If we don't
care about the specific error message that's received, running the test
and checking for error is better than skipping, because it ensures that
we're skipping the test for the right reasons and not accidentally
skipping a test for an image type that should support the
customizations.
Skip customizations tests for the EAP image.
Create a map of unsupported image types for each test to make adding new
ones easier.
Use a `nil` struct pointer for the pipeline names test instead of an
empty struct. Non-nil customizations can't be compared.
New types for the internal representation of the shell init configs,
which currently consists of files and key-value pairs for environment
global variables.
Initialise the image type as an Azure RHUI type with the name
"azure-eap7-rhui" and a workload attached that provides the extra
packages required by the EAP workload.
Add a local, private implementation of the Workload interface for RHEL
8. The type should be used for concrete workloads that provide package
package lists for specific image types.
The eapWorkload() function creates a workload that provides the packages
required for EAP image type variants.
Support specifying workload on an image type.
This isn't used yet, but when set, the workload will define packages and
services and not allow any blueprint customizations.
In the future, there will be multiple workloads with each image type
specifying one (but multiple image types can have the same default
workload). The custom workload will allow all customizations that are
currently supported.