Uploaded image for project: 'Operator Runtime'
  1. Operator Runtime
  2. OPRUN-2812

[UPSTREAM] Solver API #41

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • None
    • Upstream
    • 3
    • False
    • None
    • False

      User Story

      As a user I would like to create a Solver configured with the constraint generators and entity sources of my choosing. Given the constraints generated from the entities queried from the entity sources I would like to get a selection of entities that respect the given constraints, or an error that explains why the constraints could not me met.

      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`)

      This API will function as the main interface to Deppy.

      Acceptance Criteria

      • Solver can be configured with an arbitrary number of `ConstraintGenerators` and `EntitySources`
      • Solver orchestrates the generation of constraints and engages with the sat solver to get the selection (or error)
      • Can be tested with real world scenarios, e.g. [sudoku](https://github.com/go-air/gini/blob/871d828a26852598db2b88f436549634ba9533ff/sudoku_test.go) given suitable implementations of the EntitySource and ConstraintGenerator
      • Review existing work and determine if any changes should be made
      • Solutions must be deterministic, so ensure the order that constraints and variables get fed into the sat solver are consistent

      Scenarios

      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)
      • example in documentation
      • 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/41

              pegoncal@redhat.com Per Goncalves da Silva
              rh-ee-cchantse Catherine Chan-Tse
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: