image-builder icon indicating copy to clipboard operation
image-builder copied to clipboard

package search: Add repository queryparam which invokes dnf-json

Open croissanne opened this issue 3 years ago • 5 comments

Instead of https://github.com/osbuild/image-builder/issues/244:

  • keep the package lists for the predefined repos
  • expand /packages to take ?repo= as well, which would invoke dnf-json and search in that repo

This would give package search for non-predefined repos.

croissanne avatar Sep 28 '21 14:09 croissanne

We should be careful about how this would perform, but overall: I like!

teg avatar Sep 28 '21 14:09 teg

Yea the assumption is that this would be slow. There's a few options here though:

Get the entire package list? Currently you need to specify search as well, but we could change it to take * or something and it would give you all packages. Edge/fleet mgmt could grab the list once and store it for x amount of time?

We could generate the json blob and store it for x amount of time as well?

croissanne avatar Sep 28 '21 14:09 croissanne

If we go down this path, we should make dnf-json into a daemon, and pin the caches, that should at least avoid the 1.5s overhead per request. It might then be that (the correct) search is quick (much quicker than depsolving), so this might not be a big problem. Another option would be to make I package searching API, separate from image builder (this really has nothing to do with the rest of the API).

teg avatar Sep 28 '21 14:09 teg

Hm I'm not entirely sure I follow. /packages is something that the frontend needs for sure (not for 3rd party repos but still), so why doesn't it belong here?

croissanne avatar Sep 28 '21 14:09 croissanne

I mean it could be in a separate API, as it does not speak to composer, it does not use the database and the compose API could be used without it. It could also be used independently of image-builder. dnf-as-a-service, if you wish ;) The benefit would be (albeit minimal), that if this gets overloaded it would not affect regular operations. That might be overkill though, just a thought.

teg avatar Sep 28 '21 14:09 teg