Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add depsolve to cloudapi #4564

Merged
merged 6 commits into from
Jan 23, 2025
Merged

Add depsolve to cloudapi #4564

merged 6 commits into from
Jan 23, 2025

Conversation

bcl
Copy link
Contributor

@bcl bcl commented Jan 18, 2025

This pull request includes:

  • adequate testing for the new functionality or fixed issue
  • adequate documentation informing people about the change such as
    • submit a PR for the READMEs listed here
    • submit a PR for the osbuild.org website repository if this PR changed any behavior not covered by the automatically updated READMEs

This replaces #4390 and search will be added as a followup PR.

@bcl bcl requested review from thozza and mvo5 January 18, 2025 00:58
@thozza thozza requested a review from achilleas-k January 22, 2025 12:57
achilleas-k
achilleas-k previously approved these changes Jan 22, 2025
Copy link
Member

@achilleas-k achilleas-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. LGTM!

internal/cloudapi/v2/server.go Outdated Show resolved Hide resolved
@achilleas-k
Copy link
Member

Bigger topic:

Would it make the depsolve call more useful if we supported a full request as if generating a manifest? In other words, we can return the full list of packages for a supposed build by asking for the image type as well. We can keep the old functionality if needed by supporting imageType = nil.

I think both use cases are useful tbh. The existing one is useful for putting some packages in a blueprint and seeing what they'll pull in just by themselves. Being able to add an image type will tell you what to expect from a proper build using the blueprint.

@bcl
Copy link
Contributor Author

bcl commented Jan 22, 2025

Would it make the depsolve call more useful if we supported a full request as if generating a manifest?

Yes, I can see cases where you'd want to see the added packages (and repos) needed for the full image. I'd like to add that later though. Next step is to write a search request which will build on this.

@achilleas-k
Copy link
Member

I'd like to add that later though.

Yeah, of course. Topic for a different time. Figured it was relevant enough to bring up here and see what you think :)

@bcl bcl enabled auto-merge (rebase) January 23, 2025 16:30
@bcl bcl disabled auto-merge January 23, 2025 16:31
bcl added 6 commits January 23, 2025 08:32
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
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
This will allow depsolving blueprints and returning package metadata for
the dependencies.

Related: RHEL-60125
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
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
Test the depsolve using a mocked response, test for mismatched
distributions, and for unsupported architectures.
@bcl bcl force-pushed the main-cloudapi-depsolve-2 branch from 5b7981d to a71a8f6 Compare January 23, 2025 16:33
@bcl bcl enabled auto-merge (rebase) January 23, 2025 16:37
Copy link
Member

@croissanne croissanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@bcl bcl merged commit df16f7f into osbuild:main Jan 23, 2025
42 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants