Skip to content

Commit

Permalink
Merge branch 'master' into autoupdater
Browse files Browse the repository at this point in the history
  • Loading branch information
dave-gantenbein authored Aug 21, 2023
2 parents 4a66e29 + 95faa44 commit c2f749a
Show file tree
Hide file tree
Showing 7 changed files with 311 additions and 147 deletions.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
152 changes: 8 additions & 144 deletions docs/design/diagrams/relationships/generate.py
Original file line number Diff line number Diff line change
@@ -1,147 +1,11 @@
from diagrams import Cluster, Diagram, Edge
from diagrams.onprem.database import PostgreSQL
from diagrams.onprem.inmemory import Redis
from diagrams.k8s.controlplane import API
from diagrams.custom import Custom
import subprocess

graph_attr = {
"concentrate": "false",
"splines": "ortho",
"pad": "2",
"nodesep": "0.30",
"ranksep": "1.5",
"fontsize": "20",
}
def run_scripts():
# Run generate_v1.py
subprocess.run(["python", "generate_v1.py"])

node_attr = {
# decrease image size
"fixedsize": "true",
"width": "1",
"height": "1",
"fontsize": "15",
}
# Run generate_v2.py
subprocess.run(["python", "generate_v2.py"])

edge_attr = {
"minlen": "1",
}

cluster_attr_common = {
"margin": "20",
"fontsize": "15",
}

cluster_attr_server = {
"labelloc": "b",
"bgcolor": "#c7ffd5",
}
cluster_attr_server = {**cluster_attr_common, **cluster_attr_server}

cluster_attr_exec = {
"labelloc": "t",
"bgcolor": "#c7ffd5",
}

cluster_attr_exec = {**cluster_attr_common, **cluster_attr_exec}

armada_logo = "../files/armada.png"
pulsar_logo = "../files/pulsar.png"
browser_logo = "../files/browser.png"

with Diagram(
name="Armada Systems Diagram",
show=False,
direction="LR",
graph_attr=graph_attr,
edge_attr=edge_attr,
node_attr=node_attr,
filename="out/armada_systems_diagram",
):
pulsar = Custom("Pulsar", pulsar_logo)

# Databases
postgres_lookout = PostgreSQL("Postgres (Lookout)")
postgres_scheduler = PostgreSQL("Postgres (Scheduler)")
redis_events = Redis("Redis (Events)")

# Components
server = Custom("Server", armada_logo)
client = Custom("Client", armada_logo)
scheduler = Custom("Scheduler", armada_logo)

# Lookout Parts
lookout_api = Custom("Lookout API", armada_logo)
lookoutUI = Custom("Lookout UI", armada_logo)

# Ingesters
lookout_ingester = Custom("Lookout Ingester", armada_logo)
scheduler_ingester = Custom("Scheduler Ingester", armada_logo)
event_ingerster = Custom("Event Ingester", armada_logo)

with Cluster("Executor Cluster", graph_attr=cluster_attr_server):
executor = Custom("Executor", armada_logo)
k8s_api = API("K8s API")
binoculars = Custom("Binoculars", armada_logo)

with Cluster("Executor Cluster 2", graph_attr=cluster_attr_server):
executor2 = Custom("Executor 2", armada_logo)
k8s_api2 = API("K8s API 2")
binoculars2 = Custom("Binoculars", armada_logo)

# Relationships

# client sends requests to the server
client >> Edge(color="black") >> server

# submit api talks to pulsar
server >> Edge(color="red") >> pulsar

# pulsar talks to each of the ingesters
pulsar >> Edge(color="red") >> lookout_ingester
pulsar >> Edge(color="red") >> scheduler_ingester
pulsar >> Edge(color="red") >> event_ingerster

# make postgres blue, redis orange
# lookout and scheduler ingesters talk to postgres
# the other ingesters talk to redis
lookout_ingester >> Edge(color="blue") >> postgres_lookout
scheduler_ingester >> Edge(color="blue") >> postgres_scheduler

event_ingerster >> Edge(color="orange") >> redis_events

# the postgres scheduler talks to the scheduler and executor api
postgres_scheduler >> Edge(color="blue") >> scheduler

# the scheduler talks to pulsar
scheduler >> Edge(color="red") >> pulsar

executor >> Edge(color="blue") >> k8s_api
k8s_api >> Edge(color="blue") >> executor

executor2 >> Edge(color="blue") >> k8s_api2
k8s_api2 >> Edge(color="blue") >> executor2

# The binoculars in every cluster talks to k8s, and
# then talks directly to the lookout UI
k8s_api >> Edge(color="blue") >> binoculars
binoculars >> Edge(color="black") >> lookoutUI

k8s_api2 >> Edge(color="blue") >> binoculars2
binoculars2 >> Edge(color="black") >> lookoutUI

# Lookout API gets its data from postgres
# and passes it to the lookout UI
postgres_lookout >> Edge(color="blue") >> lookout_api
lookout_api >> Edge(color="black") >> lookoutUI

# The scheduler talks to the executor api
scheduler >> Edge(color="blue") >> executor
scheduler >> Edge(color="blue") >> executor2

# pulsar talks to the server
pulsar >> Edge(color="red") >> server

# redis events are given back to the server
redis_events >> Edge(color="orange") >> server

# and passed to the client
server >> Edge(color="black") >> client
if __name__ == "__main__":
run_scripts()
144 changes: 144 additions & 0 deletions docs/design/diagrams/relationships/generate_v1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
from diagrams import Cluster, Diagram, Edge
from diagrams.onprem.database import PostgreSQL
from diagrams.onprem.inmemory import Redis
from diagrams.k8s.controlplane import API
from diagrams.custom import Custom

graph_attr = {
"concentrate": "false",
"splines": "ortho",
"pad": "2",
"nodesep": "0.30",
"ranksep": "1.5",
"fontsize": "20",
}

node_attr = {
# decrease image size
"fixedsize": "true",
"width": "1",
"height": "1",
"fontsize": "15",
}

edge_attr = {
"minlen": "1",
}

cluster_attr_common = {
"margin": "20",
"fontsize": "15",
}

cluster_attr_server = {
"labelloc": "b",
"bgcolor": "#c7ffd5",
}
cluster_attr_server = {**cluster_attr_common, **cluster_attr_server}

cluster_attr_exec = {
"labelloc": "t",
"bgcolor": "#c7ffd5",
}

cluster_attr_exec = {**cluster_attr_common, **cluster_attr_exec}

armada_logo = "./images/armada.png"
pulsar_logo = "./images/pulsar.png"
browser_logo = "./images/browser.png"

with Diagram(
name="Armada V1 System",
show=False,
direction="LR",
graph_attr=graph_attr,
edge_attr=edge_attr,
node_attr=node_attr,
# filename="out/armada_systems_diagram",
):
pulsar = Custom("Pulsar", pulsar_logo)

# Databases
postgres_lookout = PostgreSQL("Postgres (Lookout)")
redis_events = Redis("Redis (Events)")

# Components
server = Custom("Server", armada_logo)
client = Custom("Client", armada_logo)
executorAPI = Custom("Executor API", armada_logo)
lookoutV2API = Custom("Lookout V2 API", armada_logo)
lookoutV1API = Custom("Lookout V1 API", armada_logo)
lookoutV1UI = Custom("Lookout V1 UI", armada_logo)

# Ingesters
lookout_v2_ingester = Custom("Lookout V2 Ingester", armada_logo)
lookout_v1_ingester = Custom("Lookout V1 Ingester", armada_logo)

with Cluster("Executor Cluster", graph_attr=cluster_attr_server):
executor = Custom("Executor", armada_logo)
k8s_api = API("K8s API")

with Cluster("Executor Cluster 2", graph_attr=cluster_attr_server):
executor2 = Custom("Executor 2", armada_logo)
k8s_api2 = API("K8s API 2")

# Relationships

# The lookout V2 API talks to The Lookout V1 UI
lookoutV2API >> Edge(color="black") >> lookoutV1UI

# Lookout V2 ingester talks to each other Postgres lookout
lookout_v2_ingester >> Edge(color="blue") >> postgres_lookout

# Pulsar talks to lookout_ingester
pulsar >> Edge(color="red") >> lookout_v1_ingester

# Lookout V1 Ingester talks to Lookout V1 API
lookout_v1_ingester >> Edge(color="black") >> lookoutV1API

# Lookout V1 Ingester talks to Postgres(Lookout)
lookout_v1_ingester >> Edge(color="blue") >> postgres_lookout

# Pulsar talks to lookout_ingester
pulsar >> Edge(color="red") >> lookout_v2_ingester

# Lookout V2 Ingester talks to Lookout V2 API
lookout_v2_ingester >> Edge(color="black") >> lookoutV2API

# Pulsar talks to server
pulsar >> Edge(color="red") >> server

# Server and client talks to each other
server >> Edge(color="black") >> client
client >> Edge(color="black") >> server

# Executor API and server talks to each other
executorAPI >> Edge(color="black") >> server
server >> Edge(color="black") >> executorAPI

# server talks to redis_events
server >> Edge(color="orange") >> redis_events

# in Executor Cluster
executor >> Edge(color="blue") >> k8s_api
k8s_api >> Edge(color="blue") >> executor

# in Executor Cluster 2
executor2 >> Edge(color="blue") >> k8s_api2
k8s_api2 >> Edge(color="blue") >> executor2

# Executor talks to executor API
executor >> Edge(color="black") >> executorAPI
executorAPI >> Edge(color="black") >> executor

# Executor 2 talks to executor API
executor2 >> Edge(color="black") >> executorAPI
executorAPI >> Edge(color="black") >> executor2

# lookout v1 api talks to lookout v1 UI
lookoutV1API >> Edge(color="black") >> lookoutV1UI





Loading

0 comments on commit c2f749a

Please sign in to comment.