Commit graph

6932 commits

Author SHA1 Message Date
Lukas Zapletal
3a6bea380e build(deps): bump to Go 1.22 2025-01-31 16:57:31 +01:00
Lukas Zapletal
8554d6202d build: use go toolbox instead installing binary 2025-01-31 16:57:31 +01:00
Achilleas Koutsou
083d84f70c test: update all calls to image-info
Call the script without a path since it's now in the PATH.

Drop the SELinux labelling workaround (chcon) from filesystem.sh and
image_tests.sh.  The packaged tool is already labelled correctly.

Install osbuild-tools instead of osbuild-composer-tests in
regression-old-worker-new-composer.sh to get osbuild-image-info.
2025-01-31 08:22:29 +01:00
Achilleas Koutsou
58d16f662f deploy: install osbuild-tools for osbuild-image-info 2025-01-31 08:22:29 +01:00
Achilleas Koutsou
5ba4d3cf9e tools: remove image-info
The image-info tool now lives in osbuild/osbuild.
2025-01-31 08:22:29 +01:00
Achilleas Koutsou
0219b12801 spec: drop image-info from test subpackage 2025-01-31 08:22:29 +01:00
Achilleas Koutsou
e9ddb9f738 Schutzfile: update osbuild commit
Update osbuild commit ID to include image info, which now installs as
/usr/bin/osbuild-image-info.
2025-01-31 08:22:29 +01:00
Brian C. Lane
a613e8cb37 DepsolveJobResult: Remove unused Error and ErrorType
These fields are not set by the depsolve job, they are only set and used
in tests so remove them. Errors are reported in the result.JobError

Related: Related: RHEL-60125
2025-01-30 08:00:12 +01:00
Brian C. Lane
3c2b415e53 jobimpl-depsolve: Always return result
Previously it would not return a result if there was an error. This adds
a deferred function that always returns the current contents of result,
and if there is an error it logs it.

Related: RHEL-60125
2025-01-30 08:00:12 +01:00
Brian C. Lane
29f81a029a v2_test: Add a test for /search/packages
Add a new mockSearch job handler to return static results, add tests for
searching, for distro error, and for arch error.

Related: RHEL-60136
2025-01-30 08:00:12 +01:00
Brian C. Lane
17bebb547c v2 tests: Make it easier to add mock handlers to newV2Server
This refactors the server setup, splitting the depsolve and ostree
resolve goroutine creation into helper functions. It also removes the
use of channels, which was always set to "" (and in the case of the
multi-tenancy test an empty list, which acts the same).

Related: RHEL-60136
2025-01-30 08:00:12 +01:00
Brian C. Lane
532f1b0396 cloudapi: Hook up the /search/packages handler
This connects all the pieces needed to implement the search.

If you POST a request to /search/packages like this:

    {
      "packages": [
        "tmux"
      ],
      "distribution": "fedora-41",
      "architecture": "x86_64"
    }

It will return details about the tmux packages that looks like this:

{
  "packages": [
    {
      "arch": "x86_64",
      "buildtime": "2024-10-10T00:19:06Z",
      "description": "tmux is ...",
      "license": "ISC AND BSD-2-Clause AND BSD-3-Clause AND SSH-short AND LicenseRef-Fedora-Public-Domain",
      "name": "tmux",
      "release": "2.fc41",
      "summary": "A terminal multiplexer",
      "url": "https://tmux.github.io/",
      "version": "3.5a"
    }
  ]
}

Resolves: RHEL-60136
2025-01-30 08:00:12 +01:00
Brian C. Lane
234e8a09eb openapi: Add /search/packages route to the openapi schema
The request is similar to a depsolve request, it must include the
distribution and architecture. It can optionally include a list of
repositories to search, but if they are not included it searches the
default repos for the distro:arch

Related: RHEL-60136
2025-01-30 08:00:12 +01:00
Brian C. Lane
bd55670dd9 worker: Add worker server support for Search job
This adds support for sending a search job to the worker client,
gathering results, and handling errors.

The errors returned are the same as for the Depsolve job, since they
both use the osbuild-depsolve-dnf script via images/pkg/dnfjson.

Related: RHEL-60136
2025-01-30 08:00:12 +01:00
Brian C. Lane
d8df7e7cd4 worker: Add search job implementation to worker client
This is similar to the depsolve job, and it shares the solver (which
supports locking, as does DNF itself). This will allow searching for
specific package names, names with globs, or names as substrings of
other names using * as the wildcard.

Related: RHEL-60136
2025-01-30 08:00:12 +01:00
Brian C. Lane
84c0f79286 osbuild-worker: Add helper to setup Repo SSL
This same operation will be done in a few places, turn it into a
function.

Related: RHEL-60136
2025-01-30 08:00:12 +01:00
Tomáš Hozza
cc79ad15e5 Test/worker-executor: make sure that the port is opened in firewall
It turned out that our new F41 CI images have firewalld installed. Make
sure that the worker-executor port is opened in firewall, otherwise the
worker can't connect to the executor.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-01-30 07:48:44 +01:00
Tomáš Hozza
4e317f1814 Update all rpmrepo snapshots to 20250115
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-01-30 07:48:44 +01:00
Tomáš Hozza
2bc27d2d85 Many: replace 'which' with 'type -p' in test cases
Unfortunately, `which` does not seem to be installed by default on our
F41 CI images. Instead of doing the dance with rebuilds, which has been
problematic recently, let's not rely on `which` in scripts any more,
since we can replace it with the Bash built-in `type` command.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-01-30 07:48:44 +01:00
Tomáš Hozza
55c22bf4df Schutzbot: update terraform ref
The original ref pointed to a commit, which used the plain Fedora 41
Cloud Base images, which don't have any test dependencies installed. Use
the latest commit from `main`.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-01-30 07:48:44 +01:00
Tomáš Hozza
5e9ef9e5d1 Add test/data/repositories/fedora-41.json
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-01-30 07:48:44 +01:00
Tomáš Hozza
262d94f14f test/data/repositories: rm fedora-39.json
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-01-30 07:48:44 +01:00
Tomáš Hozza
7af1b57701 GitLab CI: don't test on EOL F39
Replace F39 with F41

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-01-30 07:48:44 +01:00
Michael Vogt
e8a0e8ff49 weldr: update depsolve calls in weldr API
Update the weldr API to work with the new depsolve API.
Update tests to match (adding repo_id).

Co-authored-by: Achilleas Koutsou <achilleas@koutsou.net>
2025-01-29 18:03:11 +01:00
Achilleas Koutsou
dab836de19 weldr/test: fix test run name 2025-01-29 18:03:11 +01:00
Michael Vogt
a6ba0785b0 cloudapi: fix manifestSource.Serialize() 2025-01-29 18:03:11 +01:00
Michael Vogt
145f8e9f8a osbuild-store-dump: port to new images API 2025-01-29 18:03:11 +01:00
Michael Vogt
e91f4ba961 gen-manifests: port to new images API 2025-01-29 18:03:11 +01:00
Michael Vogt
0d669dddbf go.mod: update to latest images@v0.111.0 2025-01-29 18:03:11 +01:00
Michael Vogt
40011e35a2 composer: use reporegistry.New() again (see PR#4378)
This commit changes cmd/composer to use the `reporegistry.New`
call again. This is a preparation for
https://github.com/osbuild/images/pull/1179

And undoes parts of https://github.com/osbuild/osbuild-composer/pull/4378
but that is no longer necessary because in
https://github.com/osbuild/images/pull/946 the error is now passed
on from `reporegistry.New()` in the same way as from `LoadRepositories()`.
2025-01-29 13:27:32 +01:00
Florian Schüller
85ce08cad9 go.mod: upgrade glog
github.com/golang/glog 1.2.2 is reported to be vulnerable,
so we'll upgrade to 1.2.4.
2025-01-29 13:02:28 +01:00
Tomáš Hozza
4bffb70afe Fix c10s repo GPG keys shipped in the RPM
Update the RPM GPG keys in the c10s repos that are shipped in the RPM,
to the one that is used in our testing c10s repos. This will fix image
builds on c10s.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-01-27 15:34:48 +01:00
Sanne Raymaekers
a44a499553 worker: support worker server target results 2025-01-24 15:26:15 +01:00
Sanne Raymaekers
4e803af8cd cloudapi: get rid of localSave check in local target
The local target shouldn't require any specific configuration and should
just be available always.
2025-01-24 15:26:15 +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
Brian C. Lane
df16f7fc63 v2_test: Add testing for cloudapi /depsolve/blueprint
Test the depsolve using a mocked response, test for mismatched
distributions, and for unsupported architectures.
2025-01-23 11:39:53 -08:00
Brian C. Lane
f377c5e3eb v2_test: Add a test-distro-1 repository
This also adds an actual repository json file for the test-disro.
Without this the repo.ListDistros() function doesn't return any actual
distros.

Related: RHEL-60125
2025-01-23 11:39:53 -08:00
Brian C. Lane
02d0b8ec01 cloudapi: Request depsolve from osbuild-worker
and return the response to the client. This uses the worker to depsolve
the requested packages. The result is returned to the client as a list
of packages using the same PackageMetadata schema as the ComposeStatus
response.  It will also time out after 5 minutes and return an error,
using the same timeout constant as depsolving during manifest
generation.

Related: RHEL-60125
2025-01-23 11:39:53 -08:00
Brian C. Lane
e06e62ca03 cloudapi: Add /depsolve/blueprint route
This will allow depsolving blueprints and returning package metadata for
the dependencies.

Related: RHEL-60125
2025-01-23 11:39:53 -08:00
Brian C. Lane
4f3c93ef1e cloudapi: Make sigmd5 in PackageMetadata optional
In order to reuse PackageMetadata with DepsolveResponse and not include
unused fields this changes the sigmd5 entry to an optional field. This
doesn't effect the use of PackageMetadata in the Compose response since
it is always set, and it allows it to be omitted in the response for
depsolving.

Also adds a basic test for stagesToPackageMetadata

Related: RHEL-60125
2025-01-23 11:39:53 -08:00
Brian C. Lane
08dc5f3041 cloudapi: Move GetCustomizationsFromBlueprintRequest
This function only depends on the Blueprint (cloudapi request type, not
the internal/blueprint) so move it to a function on that so that it can
be reused by other users of the cloudapi Blueprint.

Related: RHEL-60125
2025-01-23 11:39:53 -08:00
Tom Koscielniak
5a9bb8e10a test/cases: Adjust upgrade test to rhel 9.6
Adjust upgrade test to rhel 9.6 in order to meet the rhel CTC2 9.6 to 10.0 upgrade requirements
2025-01-23 16:27:10 +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
schutzbot
7c101fdef7 Post release version bump
[skip ci]
2025-01-22 08:13:06 +00:00
Brian C. Lane
73101d2ff2 Fix non-constant log strings
Newer versions of the go compiler (1.24 in this case) fail when running
go test during a mock rebuild of the srpm created by 'make srpm' on
Fedora 42.

Even though we currently don't support go1.24, fix these so they don't
become an issue when we do.
2025-01-21 16:51:20 -08:00
Michael Vogt
af0543d27c many: update images Manifest() API for PR#1107
This updates composer to use the updated API in images around the
seed handling for manifests, see images PR#1107 for details.

Note that this has no semantic changes yet. We could now simplfy
some things because images will auto-seed but that is for a followup.
2025-01-20 09:50:49 +01:00
Michael Vogt
9dd8b2c50f go.mod,vendor: run go get -u github.com/osbuild/images
This commit updates the "images" dependency.
2025-01-20 09:50:49 +01:00
Florian Schüller
a18ec71dc8 README: remove mailing list
The mailing list was sunset by the IT department and
was rarely used, so we'll replace it with matrix & discussions.
2025-01-17 13:53:53 +01:00
Lukas Zapletal
d531f62488 blueprint: add cacert customization 2025-01-10 10:26:54 +01:00
Lukas Zapletal
f41c764ca7 build(deps): bump deps specifically CVE-2024-45338 2025-01-09 16:30:20 +01:00