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

Remove the EntitySource API and replace it with the VariableSource API #97

Closed
awgreene opened this issue May 9, 2023 · 3 comments · Fixed by #108
Closed

Remove the EntitySource API and replace it with the VariableSource API #97

awgreene opened this issue May 9, 2023 · 3 comments · Fixed by #108
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@awgreene
Copy link
Member

awgreene commented May 9, 2023

At a high level, the Deppy Library checks if a set of constraints can be satisfied by a set of entities. Today, the Deppy Library expects users to implement the EntitySource interface to provide the entities that Deppy considers. There are a number of shortcomings with the existing interface that justify moving to using the VariableSource interface.

  1. This API doesn't provide value: Deppy should not care if a user has given it an EntitySource, it should only rely on a set of Variables being provided, which are retrievable through the existing VariableSource interface
  2. Needless conversion:: When Deppy is given a EntitySource, it is converted into Entities, which are further converted into variables for resolution. After resolution, we again convert the variables to entities to get the final list of output. The flow looks like: Input -> Entities -> Variables -> Solver -> Solution set (variables) -> Entities.

Moving away from EntitySources / entities will yield the following benefits:

  • Simplification of the codebase.
  • The EntitySource interface is strongly tied to the bundle concept introduced by OLM. Moving away from EntitySources/Entites would allow us to support other formats.

Open Questions:

  • [spike] Do we need separate variable sources for each constraint? (eg). How would OLM specific constraints look like?

Follow up:

  • Currently we have BundleEntities in operator controller, these need to be converted in variable sources and directly fed to resolver. The GetVariables method would take in the BMD and packages, construct a valid deppy identifier and add it to the resolver here
  • Catalogd should also be updated to use VariableSources.

Related PRs:

Demo Script:

  • Is there a need for a demo script?
@awgreene
Copy link
Member Author

awgreene commented May 9, 2023

Tagging @perdasilva and @varshaprasad96 for review on this one.

@varshaprasad96
Copy link
Member

varshaprasad96 commented May 9, 2023

One change:

Catalogd should also be updated to use VariableSources.

Catalogd does not deal with deppy directly. Its only the operator controller that fetches in contents from v1 catalog and converts them into deppy consumable format. As such Catalogd project/repository shouldn't require any change (afaik).

@github-actions
Copy link

github-actions bot commented Jul 9, 2023

This issue has become stale because it has been open 60 days with no activity. The maintainers of this repo will remove this label during issue triage or it will be removed automatically after an update. Adding the lifecycle/frozen label will cause this issue to ignore lifecycle events.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants