forked from FerrariDG/async-ml-inference
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiagram.py
43 lines (33 loc) · 835 Bytes
/
diagram.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""Module to generate diagram figure."""
from diagrams import Diagram
from diagrams.onprem.inmemory import Redis
from diagrams.onprem.queue import RabbitMQ
from diagrams.k8s.compute import Pod
graph_attr = {
"pad": "0.2",
"splines": "curved",
"nodesep": "0.5",
"ranksep": "1.0",
"fontcolor": "#000000"
}
node_attr = {
"fontsize": "15",
"width": "1.2",
"height": "1.2",
"fontcolor": "#000000"
}
with Diagram(
name="",
show=False,
filename="docs/diagram/architecture",
graph_attr=graph_attr,
node_attr=node_attr,
edge_attr={"color": "#566573"}
):
client = Pod("Clients")
api = Pod("APIs")
broker = RabbitMQ("Broker")
database = Redis("Backend")
worker = Pod("Workers")
client << api << database << worker
client >> api >> broker >> worker