Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated architecture #333

Merged
merged 6 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added architecture/resources/jataware.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added architecture/resources/mit.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added architecture/resources/ml4ai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added architecture/resources/pnnl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added architecture/resources/sciml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added architecture/resources/uncharted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 54 additions & 50 deletions architecture/system-arch.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
"center": "true",
"beautify": "true",
"layout": "dot",
"rankdir": "TB", # Direction of graph, "TB" is top to bottom, "LR" is left to right
"splines": "spline", # How edges are drawn. Other options: "ortho", "curved", etc.
"nodesep": "1", # Adjust the space between nodes
"ranksep": "2.0", # Adjust the space between ranks of nodes
"margin": "0.5", # Margin around the graph
"pad": "0.5", # Padding between the graph and the margin
"dpi": "120"
"rankdir": "TB", # Direction of graph, "TB" is top to bottom, "LR" is left to right
"splines": "ortho", # How edges are drawn. Other options: "ortho", "curved", etc.
"nodesep": "1", # Adjust the space between nodes
"ranksep": "2.0", # Adjust the space between ranks of nodes
"margin": "20", # Margin around the graph
"pad": "0.5", # Padding between the graph and the margin
"dpi": "120"
}

node_attr = {
Expand All @@ -51,9 +51,10 @@

# Nodes
with Diagram("Terarium System Architecture", show=True,
graph_attr=graph_attr,
node_attr=node_attr,
edge_attr=edge_attr):
graph_attr=graph_attr,
node_attr=node_attr,
edge_attr=edge_attr):

with Cluster("Logging and Monitoring"):
grafana = Grafana("Grafana")
loki = Loki("Loki")
Expand All @@ -67,33 +68,36 @@

with Cluster("TA4 Kubernetes Cluster"):
with Cluster("Middle Tier"):
hmi_server = Pod("HMI Server")
web_servers = [Pod("Web Server"), Pod("Docs Server")]
hmi_server = Custom("HMI Server", "./resources/uncharted.png")
web_servers = [Custom("Web Server", "./resources/uncharted.png"), Custom("Docs Server", "./resources/uncharted.png")]
keycloak = Custom("Keycloak", "./resources/keycloak.png")
message_queue = Rabbitmq("Message Queue")
llm = Pod("Jupyter LLM")
hmi_extraction_service = Pod("HMI Extraction Service")
llm = Custom("Jupyter LLM", "./resources/jataware.jpeg")
hmi_extraction_service = Custom("HMI Extraction Service", "./resources/uncharted.png")

with Cluster("Data Tier"):
tds = Pod("Data Service (TDS)")
tds = Custom("Data Service (TDS)", "./resources/jataware.jpeg")
graphdb = Custom("GraphDB", "./resources/graphdb.png")

with Cluster("Model Services"):
model_service = Pod("Model Service")
model_service = Custom("Model Service", "./resources/uncharted.png")

with Cluster("Simulation Services"):
pyciemss_api = Pod("pyciemss API")
pyciemss_worker = Pod("pyciemss Worker")
simulation_service = Pod("Simulation Service")
pyciemss_api = Custom("pyciemss API", "./resources/pnnl.png")
pyciemss_worker = Custom("pyciemss Worker", "./resources/pnnl.png")
sciml_service = Custom("SciML Service", "./resources/sciml.png")

with Cluster("Knowledge Services"):
knowledge_middleware_api = Pod("Knowledge Middleware API")
knowledge_middleware_worker = Pod("Knowledge Middleware Worker")
skema_unified = Pod("Skema Unified")
skema_rs = Pod("Skema RS")
skema_tr = Pod("Skema TR")
mit_tr = Pod("MIT TR")
skema_memgraph = Pod("Skema Memgraph")
knowledge_middleware_api = Custom("Knowledge Middleware API", "./resources/jataware.jpeg")
knowledge_middleware_worker = Custom("Knowledge Middleware Worker", "./resources/jataware.jpeg")
mit_proxy = Custom("MIT Proxy", "./resources/uncharted.png")
mit_tr = Custom("MIT TR", "./resources/mit.jpeg")
skema_unified = Custom("Skema Unified", "./resources/ml4ai.png")
skema_rs = Custom("Skema Rs", "./resources/ml4ai.png")
skema_text_reading = Custom("Skema Text Reading", "./resources/ml4ai.png")
#skema_eq2mml = Custom("Skema EQ2MML", "./resources/ml4ai.png")
skema_mathjax = Custom("Skema MathJax", "./resources/ml4ai.png")
skema_memgraph = Custom("Skema Memgraph", "./resources/ml4ai.png")

with Cluster("Ingress"):
ingress_app = Ing("application")
Expand All @@ -112,54 +116,54 @@
cosmos = Server("xDD Cosmos")
xdd = Server("xDD")

with Cluster("TA1 External Services"):
skema_unified_external = Server("TA1 Unified")

with Cluster("Web Tier"):
with Cluster("Users"):
hmi_client = Client("HMI Client")
docs = Client("Terarium Docs")
with Cluster("Admins"):
admin_ui = Client("Admin UI")
hmi_client = Client("HMI Client")
docs = Client("Terarium Docs")

# Connections
knowledge_middleware_api >> Edge() >> redis
knowledge_middleware_worker >> Edge() >> cosmos
knowledge_middleware_worker >> Edge() >> mit_tr
knowledge_middleware_worker >> Edge() >> redis
knowledge_middleware_worker >> Edge() >> skema_rs
knowledge_middleware_worker >> Edge() >> skema_unified_external
knowledge_middleware_worker << Edge() >> tds
grafana >> Edge() >> es
hmi_server << Edge() >> pyciemss_api
hmi_extraction_service >> Edge() >> knowledge_middleware_api
hmi_server >> Edge() >> pyciemss_api
hmi_server >> Edge() << ingress_app
hmi_server >> Edge() << keycloak
hmi_server >> Edge() << llm
hmi_server >> Edge() << tds
hmi_server >> Edge() >> keycloak
hmi_server >> Edge() >> llm
hmi_server >> Edge() >> tds
hmi_server >> Edge() >> github
hmi_server >> Edge() >> hmi_extraction_service
hmi_server >> Edge() >> jsdelivr
hmi_server >> Edge() >> knowledge_middleware_api
hmi_server >> Edge() >> message_queue
hmi_server >> Edge() >> model_service
hmi_server >> Edge() >> pyciemss_api
hmi_server >> Edge() >> simulation_service
hmi_server >> Edge() >> sciml_service
hmi_server >> Edge() >> xdd
hmi_extraction_service << Edge() >> knowledge_middleware_api
ingress_app >> Edge() << hmi_client
ingress_docs >> Edge() << docs
ingress_keycloak >> Edge() << admin_ui
keycloak >> Edge() << ingress_keycloak
knowledge_middleware_api >> Edge() >> knowledge_middleware_worker
knowledge_middleware_api >> Edge() >> redis
knowledge_middleware_worker << Edge() >> mit_proxy
knowledge_middleware_worker << Edge() >> tds
knowledge_middleware_worker >> Edge() >> cosmos
knowledge_middleware_worker >> Edge() >> redis
knowledge_middleware_worker >> Edge() >> skema_unified
llm >> Edge() >> openai
llm >> Edge() >> simulation_service
llm >> Edge() >> sciml_service
loki >> Edge() >> es
mit_proxy >> Edge() >> mit_tr
pyciemss_api >> Edge() >> pyciemss_worker
pyciemss_api >> Edge() >> redis
pyciemss_api >> Edge() >> tds
pyciemss_worker >> Edge() >> message_queue
pyciemss_worker >> Edge() >> redis
pyciemss_worker >> Edge() >> tds
sciml_service >> Edge() >> message_queue
skema_rs >> Edge() >> skema_memgraph
skema_unified >> Edge() >> mit_tr
skema_unified >> Edge() >> skema_rs
skema_unified >> Edge() >> skema_tr
skema_unified >> Edge() >> skema_text_reading
skema_unified >> Edge() >> skema_mathjax
skema_unified >> Edge() >> skema_memgraph
tds >> Edge() >> dkg
tds >> Edge() >> es
tds >> Edge() >> graphdb
Expand Down
Binary file modified architecture/terarium_system_architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 2 additions & 6 deletions kubernetes/base/services/skema/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ namespace: terarium
resources:
- skema-rs-deployment.yaml
- skema-rs-service.yaml
- skema-py-deployment.yaml
- skema-py-service.yaml
- skema-memgraph-deployment.yaml
- skema-memgraph-service.yaml
- skema-eq2mml-deployment.yaml
- skema-eq2mml-service.yaml
- skema-mathjax-deployment.yaml
- skema-mathjax-service.yaml
- skema-tr-deployment.yaml
- skema-tr-service.yaml
- skema-text-reading-deployment.yaml
- skema-text-reading-service.yaml
- skema-unified-deployment.yaml
- skema-unified-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: skema-tr
name: skema-text-reading
labels:
software.uncharted.terarium/name: skema-tr
software.uncharted.terarium/component: tr
software.uncharted.terarium/name: skema-text-reading
software.uncharted.terarium/component: text-reading
software.uncharted.terarium/service: skema
software.uncharted.terarium/part-of: services
spec:
replicas: 1
selector:
matchLabels:
software.uncharted.terarium/name: skema-tr
software.uncharted.terarium/name: skema-text-reading
strategy:
type: Recreate
template:
metadata:
labels:
software.uncharted.terarium/name: skema-tr
software.uncharted.terarium/name: skema-text-reading
spec:
containers:
- name: skema-tr
image: skema-tr-image
- name: skema-text-reading
image: skema-text-reading-image
imagePullPolicy: Always
env:
- name: secret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
apiVersion: v1
kind: Service
metadata:
name: skema-tr
name: skema-text-reading
labels:
software.uncharted.terarium/name: skema-tr
software.uncharted.terarium/component: tr
software.uncharted.terarium/name: skema-text-reading
software.uncharted.terarium/component: text-reading
software.uncharted.terarium/service: skema
software.uncharted.terarium/part-of: services
annotations:
Expand All @@ -17,6 +17,6 @@ spec:
protocol: TCP
targetPort: 9000
selector:
software.uncharted.terarium/name: skema-tr
software.uncharted.terarium/name: skema-text-reading
status:
loadBalancer: {}
10 changes: 9 additions & 1 deletion kubernetes/base/services/skema/skema-unified-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,17 @@ spec:
- name: SKEMA_RS_ADDESS
value: http://skema-rs:4040
- name: SKEMA_TR_ADDRESS
value: http://skema-tr:4047
value: http://skema-text-reading:4047
- name: MIT_TR_ADDRESS
value: http://mit-tr:4046
- name: SKEMA_MATHJAX_ADDRESS
value: http://skema-mathjax:8031
- name: SKEMA_GRAPH_DB_PROTO
value: bolt://
- name: SKEMA_GRAPH_DB_PROTO
value: skema-memgraph
- name: SKEMA_GRAPH_DB_PROTO
value: '7687'
command: ['uvicorn']
args: ['skema.rest.api:app', '--host', '0.0.0.0', '--port', '8000']
ports:
Expand Down
3 changes: 1 addition & 2 deletions kubernetes/overlays/prod/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ patches:
- path: services/pyciemss-service/pyciemss-api-deployment.yaml
- path: services/pyciemss-service/pyciemss-worker-deployment.yaml
- path: services/sciml-service/sciml-service-deployment.yaml
- path: services/skema/skema-eq2mml-deployment.yaml
- path: services/skema/skema-mathjax-deployment.yaml
- path: services/skema/skema-memgraph-deployment.yaml
- path: services/skema/skema-py-deployment.yaml
- path: services/skema/skema-rs-deployment.yaml
- path: services/skema/skema-text-reading-deployment.yaml
- path: services/skema/skema-unified-deployment.yaml
- path: services/knowledge-middleware/knowledge-middleware-api-deployment.yaml
- path: services/knowledge-middleware/knowledge-middleware-worker-deployment.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ spec:
- name: SKEMA_RS_URL
value: 'http://skema-rs:4040'
- name: SKEMA_TR_URL
value: 'http://skema-tr:4047'
value: 'http://skema-text-reading:4047'
- name: MIT_TR_URL
value: 'http://mit-tr:4046'
- name: TA1_UNIFIED_URL
value: 'https://api.askem.lum.ai'
value: 'https://skema-unifed:4045"'
- name: OPENAI_API_KEY
valueFrom:
secretKeyRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ spec:
- name: SKEMA_RS_URL
value: 'http://skema-rs:4040'
- name: SKEMA_TR_URL
value: 'http://skema-tr:4047'
value: 'http://skema-text-reading:4047'
- name: MIT_TR_URL
value: 'http://mit-tr:4046'
- name: TA1_UNIFIED_URL
value: 'https://api.askem.lum.ai'
value: 'https://skema-unifed:4045"'
- name: OPENAI_API_KEY
valueFrom:
secretKeyRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: skema-tr
name: skema-text-reading
spec:
strategy:
type: RollingUpdate
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ patches:
- path: services/pyciemss-service/pyciemss-api-deployment.yaml
- path: services/pyciemss-service/pyciemss-worker-deployment.yaml
- path: services/sciml-service/sciml-service-deployment.yaml
- path: services/skema/skema-tr-deployment.yaml
- path: services/skema/skema-text-reading-deployment.yaml
configMapGenerator:
- files:
- keycloak/realm/Uncharted-realm.json
Expand Down Expand Up @@ -104,7 +104,7 @@ images:
- name: skema-memgraph-image
newName: ghcr.io/darpa-askem/memgraph-platform
newTag: '2.6.5-memgraph2.5.2-lab2.4.0-mage1.6'
- name: skema-tr-image
- name: skema-text-reading-image
newName: lumai/askem-skema-text-reading
newTag: 'sha-3ee47d1'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ spec:
spec:
containers:
- name: sciml-service
resources:
requests:
memory: "2Gi"
cpu: "500m"
limits:
memory: "3Gi"
cpu: "1"
env:
- name: SIMSERVICE_RABBITMQ_HOST
value: 'b-68052fee-712b-461b-81c3-7a82a8112d50.mq.us-east-1.amazonaws.com'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: skema-tr
name: skema-text-reading
spec:
template:
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ software.uncharted.terarium/name=model-service ghcr.io/darpa-askem/model-service
software.uncharted.terarium/name=pyciemss-api ghcr.io/darpa-askem/pyciemss-api:latest
software.uncharted.terarium/name=pyciemss-worker ghcr.io/darpa-askem/pyciemss-worker:latest
software.uncharted.terarium/name=sciml-service ghcr.io/darpa-askem/sciml-service:latest
software.uncharted.terarium/name=skema-py ghcr.io/darpa-askem/skema-py:latest
software.uncharted.terarium/name=skema-rs ghcr.io/darpa-askem/skema-rs:latest
software.uncharted.terarium/name=skema-unified ghcr.io/darpa-askem/skema-py:latest
software.uncharted.terarium/name=terarium-docs ghcr.io/darpa-askem/terarium-docs:latest
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,6 @@ spec:
port:
number: 3030

- host: "skema-py.staging.terarium.ai"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: skema-py
port:
number: 4041

- host: "skema-rs.staging.terarium.ai"
http:
paths:
Expand All @@ -140,7 +129,7 @@ spec:
pathType: Prefix
backend:
service:
name: skema-tr
name: skema-text-reading
port:
number: 4047

Expand Down Expand Up @@ -189,8 +178,7 @@ spec:
- "model-service.staging.terarium.ai"
- "pyciemss.staging.terarium.ai"
- "sciml-service.staging.terarium.ai"
- "skema-py.staging.terarium.ai"
- "skema-rs.staging.terarium.ai"
- "skema-tr.staging.terarium.ai"
- "skema-text-reading.staging.terarium.ai"
- "skema-unified.staging.terarium.ai"
- "knowledge-middleware.staging.terarium.ai"
Loading
Loading