-
Story
-
Resolution: Done
-
Normal
-
None
-
None
-
Upstream
-
3
-
False
-
None
-
False
User Story
As a user I would like to create to provide solver constraints to the Solver in order to solve a specific problem (e.g. package dependencies, sudoku, scheduling, etc.)
Summary / Background
Deppy is a framework for creating constraint solvers over "entities". It is composed of the following components:
1. `Entity`: a structure with an unique string id and a set of properties (map[string]string)
2. `EntitySource`: an interface to a source of entities. It implements an entity query interface that allows consumers to find entities that contain certain properties, sort the result rest on an arbitrary basis, and also group entities by an arbitrary key function (e.g. `GroupBy(func(entity *Entity) string) map[string][]Entity)`)
3. `ConstraintGenerator`: an interface that can produce []solver.Variable given an entity query interface (something that can query over a set of EntitySources`)
Acceptance Criteria
- ConstraintGenerator interface produces []solver.Variable
- ConstraintGenerator consumes an entity query interface that allows it to find the entities it needs to build the constraints
- Review existing work and determine if any changes should be made
Scenarios
- Constraint generators that form a basis for a DSL used by the host application (e.g. requirePackage(...), gvkUniqueness(...), etc.
- Constraint generators that have their own internal process that generate constraints based on async communication with other services, e.g. a `Declarative Constraint` k8s api extension
- Constraint generators that can derive constraints based on observed states, e.g. kubernetes api version, or openshift version
Assumptions
Links (docs, drawings, designs, etc)
[Deppy-as-a-Framework](https://hackmd.io/fDfcLKNzRPCgILMIQ8aPOw?view#Appendix-III-Deppy-as-a-Framework)
Dependencies
Definition of Done
- unit tests
- extensive godoc (this is a framework after all)
- reviewed and merged
- create any new tickets as necessary for any new changes that need to be made to existing work
Upstream Github issue: https://github.com/operator-framework/deppy/issues/42