From b3d2ec5898b0d88740cd316ddfe3d3523086dbaf Mon Sep 17 00:00:00 2001 From: Renato Dinhani <101204870+dinhani-cw@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:08:45 -0300 Subject: [PATCH] chore: remove diagrams (#1610) --- .../rendered-stratus-components-graphviz.svg | 146 ------------------ .../rendered-stratus-components-mermaid.svg | 1 - .../rendered-stratus-components-plantuml.svg | 1 - static/diagrams/stratus-components.main.kts | 102 ------------ 4 files changed, 250 deletions(-) delete mode 100644 static/diagrams/rendered-stratus-components-graphviz.svg delete mode 100644 static/diagrams/rendered-stratus-components-mermaid.svg delete mode 100644 static/diagrams/rendered-stratus-components-plantuml.svg delete mode 100644 static/diagrams/stratus-components.main.kts diff --git a/static/diagrams/rendered-stratus-components-graphviz.svg b/static/diagrams/rendered-stratus-components-graphviz.svg deleted file mode 100644 index 823e29d7f..000000000 --- a/static/diagrams/rendered-stratus-components-graphviz.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - -%3 - -Stratus - Internals - Components - -cluster_2 - -Internals -[Container] - - - -10 - -Storage: Temporary -[Component: In-Memory] - - - -3 - -Importer Online -[Component] - - - -6 - -Core: Executor -[Component] - - - -3->6 - - -execute - - - -4 - -RPC: Server -[Component] - - - -5 - -RPC: Subscriptions -[Component] - - - -4->5 - - -manage - - - -4->6 - - -execute - - - -8 - -Storage -[Component] - - - -4->8 - - -read - - - -7 - -Core: Miner -[Component] - - - -5->7 - - -subscribe - - - -6->7 - - -writes - - - -6->8 - - -read - - - -7->8 - - -write - - - -8->10 - - -read/write - - - -9 - -Storage: Permanent -[Component: RocksDB] - - - -8->9 - - -read/write - - - diff --git a/static/diagrams/rendered-stratus-components-mermaid.svg b/static/diagrams/rendered-stratus-components-mermaid.svg deleted file mode 100644 index 95838075f..000000000 --- a/static/diagrams/rendered-stratus-components-mermaid.svg +++ /dev/null @@ -1 +0,0 @@ -
Stratus - Internals - Components
Internals
execute
manage
read
execute
subscribe
read
writes
write
read/write
read/write
Importer Online
[Component]
RPC: Server
[Component]
RPC: Subscriptions
[Component]
Core: Executor
[Component]
Core: Miner
[Component]
Storage
[Component]
Storage: Permanent
[Component: RocksDB]
Storage: Temporary
[Component: In-Memory]
\ No newline at end of file diff --git a/static/diagrams/rendered-stratus-components-plantuml.svg b/static/diagrams/rendered-stratus-components-plantuml.svg deleted file mode 100644 index 4bfc66fb6..000000000 --- a/static/diagrams/rendered-stratus-components-plantuml.svg +++ /dev/null @@ -1 +0,0 @@ -Stratus - Internals - ComponentsInternals[Container]Storage: Temporary[In-Memory]Importer OnlineRPC: ServerRPC: SubscriptionsCore: ExecutorCore: MinerStorageStorage: Permanent[RocksDB]executemanagereadexecutesubscribereadwriteswriteread/writeread/writeLegend  component  container boundary(dashed)  \ No newline at end of file diff --git a/static/diagrams/stratus-components.main.kts b/static/diagrams/stratus-components.main.kts deleted file mode 100644 index 95b244e2a..000000000 --- a/static/diagrams/stratus-components.main.kts +++ /dev/null @@ -1,102 +0,0 @@ -// Dependencies: -// * Kotlin and JVM for running this script. -// * mermaid-cli for Mermaid diagrams. -// * Graphviz for DOT diagrams. -// * PlantUML for PlantUML diagrams. -// -// Usage: -// kotlin stratus-components.main.kts | bash - -// ----------------------------------------------------------------------------- -// Imports -// ----------------------------------------------------------------------------- -@file:DependsOn("com.structurizr:structurizr-core:2.2.0") -@file:DependsOn("com.structurizr:structurizr-export:2.2.0") - -import com.structurizr.* -import com.structurizr.export.* -import com.structurizr.export.dot.* -import com.structurizr.export.mermaid.* -import com.structurizr.export.plantuml.* -import com.structurizr.model.* -import com.structurizr.view.* -import java.io.File - -// ----------------------------------------------------------------------------- -// Setup -// ----------------------------------------------------------------------------- -val workspace = Workspace("Stratus", null) -val views = workspace.views -val styles = views.configuration.styles -val model = workspace.model - -// ----------------------------------------------------------------------------- -// Components -// ----------------------------------------------------------------------------- -val stratus = model.addSoftwareSystem("Stratus") -val stratusInternals = stratus.addContainer("Internals") - -val importer = stratusInternals.addComponent("Importer Online") -val rpcServer = stratusInternals.addComponent("RPC: Server") -val rpcSubs = stratusInternals.addComponent("RPC: Subscriptions") -val executor = stratusInternals.addComponent("Core: Executor") -val miner = stratusInternals.addComponent("Core: Miner") -val storage = stratusInternals.addComponent("Storage") -val storagePerm = stratusInternals.addComponent("Storage: Permanent").also { it.technology = "RocksDB"; } -val storageTemp = stratusInternals.addComponent("Storage: Temporary").also { it.technology = "In-Memory"} - -// ----------------------------------------------------------------------------- -// Relationships -// ----------------------------------------------------------------------------- -importer.uses(executor, "execute") - -rpcServer.uses(rpcSubs, "manage") -rpcServer.uses(storage, "read") -rpcServer.uses(executor, "execute") - -rpcSubs.uses(miner, "subscribe") - -executor.uses(storage, "read") -executor.uses(miner, "writes") - -miner.uses(storage, "write") - -storage.uses(storageTemp, "read/write") -storage.uses(storagePerm, "read/write") - -// ----------------------------------------------------------------------------- -// Views -// ----------------------------------------------------------------------------- -val componentsView = views.createComponentView(stratusInternals, "", "") -componentsView.addAllElements() - -// ----------------------------------------------------------------------------- -// Exporters -// ----------------------------------------------------------------------------- -private fun export(exporter: AbstractDiagramExporter, view: ComponentView): File { - if (exporter is MermaidDiagramExporter) { - view.enableAutomaticLayout(AutomaticLayout.RankDirection.LeftRight) // mermaid is bugged - } else { - view.enableAutomaticLayout(AutomaticLayout.RankDirection.TopBottom) - } - val diagram = exporter.export(componentsView) - return createTempFile(prefix = "stratus-", suffix = ".diagram").also { it .writeText(diagram.definition) } -} - -val mermaidFile = export(MermaidDiagramExporter(), componentsView) -val dotFile = export(DOTExporter(), componentsView) -val plantUmlFile = export(C4PlantUMLExporter(), componentsView) - -val renderCommands = listOf( - "echo Rendering Mermaid", - "mmdc -i $mermaidFile -o ./rendered-stratus-components-mermaid.svg", - "echo Rendering Graphviz", - "dot -Tsvg $dotFile -o ./rendered-stratus-components-graphviz.svg", - "echo Rendering PlantUML", - "java -jar /usr/local/bin/plantuml.jar -failfast -tsvg -o $(pwd)/plantuml $plantUmlFile", - "mv ./plantuml/*.svg ./rendered-stratus-components-plantuml.svg", - "rm -rf plantuml" - -) -println(renderCommands.joinToString("\n")) -