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

feat(rust): implement a new software service in Rust #1829

Draft
wants to merge 15 commits into
base: product-registration
Choose a base branch
from

Conversation

imobachgs
Copy link
Contributor

@imobachgs imobachgs commented Dec 12, 2024

Warning

This code is still a work in progress and so functionality is missing or temporary. The PR is open against the product-registration branch.

This PR implements a new version of the software service using our libzypp bindings. The API is exposed through the /api/software_ng namespace, so it can coexist with the old software service.

Architecture

This solution makes heavy use of channels. The software service is composed of two parts:

  • SoftwareServiceServer which implements the service logic. It runs as an independent Tokio task and receives the requests using a channel.
  • SoftwareServiceClient which is just a wrapper around the channel to send messages.

This approach is quite flexible, as the server is always running (so it could listen to other events) and processes one action at a time (it is hard to get into a deadlock), and it is fairly easy to reason about. The downside is that it requires some boilerplate code.

Note

I would like to experiment with a simpler approach based on mutexes, but it can wait a bit.

Tasks

  • Put the foundations of the new software service.
  • Improve ProductsRegistry to handle the filters by architecture.
  • Add an alias or name to the list of repositories.
  • Import the GPG keys (waiting for the C-API).
  • Select the product if there is a single one.
  • Emit an event when the product is selected.
  • Implement product selection.
  • Implement /probe.
  • Run the probe on a separate Task so it does not block (see the manager's example although it is not part of our codebase yet, but you get the idea).
  • Implement /proposal.
  • Implement /resolvables/:id.
  • Implement the list of patterns (/patterns)
  • Implement patterns selection (as part of PUT /config).
  • Implement /install.
  • Add issues support (under /issues).
  • Implement the registration logic.

@imobachgs imobachgs changed the title Software service feat(rust): implement a new software service in Rust Dec 12, 2024
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.

1 participant