Open azriel91 opened 5 months ago
For rendering the flow graph, perhaps the following works:
peace_flow_model
, and define a FlowSpecInfo
which is essentially the Flow
without logic.WebiOutput
, is instantiated with FlowSpecInfo
, which is passed to a <FlowGraph flow_info=flow_info cmd_progress=cmd_progress />
component.FlowGraph
uses dot_ix
to render the graph -- specifying the nodes and edges.impl OutputWrite for WebiOutput
, the Progress*
updates are used to change the WriteSignal<CmdProgress>
, which influences the tailwind_css
styles passed by FlowGraph
to dot_ix
.Refactorings to make drawing the outcome diagram easier:
peace_resources
to peace_resources_rt
.Item
to Step
peace_resource_model
to house the ResourceInteractions
type, which represents:
n
resources (e.g. 3 servers all have X patch applied)n
servers modifiedPerhaps we do the first two as part of https://github.com/azriel91/peace/issues/187 first, then continue this.
Things to do:
Resource*
to Item*
.ItemInteraction
API to clearly represent nesting vs multiple resources being interacted with -- probably create ItemInteractions
.Flow
into flow_rt
crate.flow_spec_info
and related types behind feature = "resource_interactions"
.ItemInteractions
in ItemSpecInfo
(and ItemInfo
?).ItemInteraction
APIRetain ItemLocation
as is, but create one of:
ItemLocationAncestors
which is a Vec<ItemLocation>
newtype.ItemLocationTree
which is a struct { ItemLocation, Vec<ItemLocationTree> }
-- a parent ItemLocation
, and any children it has. Or should it be a Map<ItemLocation, Vec<ItemLocation>>
? (flat map so it's easy to see if an ItemLocation
is already recorded)How about both:
ItemLocationTree
is the tree of the topmost (known) ItemLocation
ancestor, to all of the lowest ItemLocation
s.ItemLocationAncestors
is a linear list from the topmost (known) ItemLocation
ancestor to each leaf ItemLocation
-- one path of an ItemLocationTree
.For each Item
's interactions, we want to know:
ItemLocation
(s?) -- ItemLocationAncestors
.ItemLocation
(s) -- Vec<ItemLocationAncestors>
? or ItemLocationTree
, where each leaf node is a destination.
Other names considered for ItemLocationAncestors
are:
ItemLocationAncestry
ItemLocationTaxonomy
ItemLocationLayers
Use cases we know of:
ItemLocationTree
for the cloud provider / subnet context? or leverage previous resource tracking to work it out?).ItemInteraction
s to be queried multiple times while Apply
is happening? -- i.e. some servers may have started up, and so we need the Item
to report that to us.ItemInteraction
s to be queriable without the items actually existing -- so we can generate diagrams to demonstrate what would happen upon execution.
Related: https://github.com/azriel91/peace/issues/125
Use
leptos
anddot_ix
to create a first cut web UI:Interactively rendering additional information, or highlighting the parts of the outcome when the progress step is hovered (or vice versa) is not necessarily in scope.