Skip to content

Commit

Permalink
add high-level architecture diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
backmari committed Sep 5, 2024
1 parent c41defb commit eae3bd2
Show file tree
Hide file tree
Showing 2 changed files with 149 additions and 9 deletions.
46 changes: 37 additions & 9 deletions docs/developer/design/communication_flows.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.. _communication_flows:

ActiveMQ Communication Flows
============================

.. contents:: :local:

Autoreducers
------------

Expand Down Expand Up @@ -95,7 +99,7 @@ parameters for instruments that have implemented

DASMON
------
DASMON, from Data Acquisition System (DAS) Monitor, provides process variable (PV) updates from the
DASMON, from Data Acquisition (DAQ) System Monitor, provides process variable (PV) updates from the
beamlines to WebMon. Due to the high volume of PV updates, DASMON writes directly to the database.

.. mermaid::
Expand All @@ -105,13 +109,12 @@ beamlines to WebMon. Due to the high volume of PV updates, DASMON writes directl
participant Workflow DB
participant Dasmon listener
DASMON->>Workflow DB: PV update
Workflow DB->>Dasmon listener: PV update
DASMON->>Dasmon listener: Heartbeats

Dasmon listener
---------------

Streaming Message Service (SMS)
Stream Management Service (SMS)
...............................

.. mermaid::
Expand All @@ -138,12 +141,35 @@ admins by email when a service has missed heartbeats (needs to be verified that
participant Dasmon listener
participant Workflow DB
actor Subscribed users
Other services->>Dasmon listener: Heartbeat
Dasmon listener->>Workflow DB: Status update
opt There are missed heartbeats
loop Every N s
Other services->>Dasmon listener: Heartbeat
Dasmon listener->>Workflow DB: Status update
end
opt Service has 3 missed heartbeats
Dasmon listener->>Subscribed users: Email
end


.. mermaid::

flowchart LR
SMS["SMS (per beamline)"]
PVSD["PVSD (per beamline)"]
DASMON["DASMON (per beamline)"]
STC
Autoreducers
DasmonListener
WorkflowDB[(DB)]
SMS-->|heartbeat|DasmonListener
PVSD-->|heartbeat|DasmonListener
DASMON-->|heartbeat|DasmonListener
STC-->|heartbeat|DasmonListener
Autoreducers-->|heartbeat|DasmonListener
WorkflowManager-->|heartbeat|DasmonListener
DasmonListener-->|heartbeat|DasmonListener
DasmonListener-->WorkflowDB
DasmonListener-.->|if missed 3 heartbeats|InstrumentScientist

WebMon interaction with Live Data Server
----------------------------------------

Expand All @@ -164,13 +190,15 @@ or HTML div) to Live Data Server.
participant Live Data Server

WebMon->>Autoreducer: REDUCTION.DATA_READY
Autoreducer->>Live Data Server: publish_plot
Note over Live Data Server: Store plot in DB
opt Publish plot
Autoreducer->>Live Data Server: publish_plot
Note over Live Data Server: Store plot in DB
end

Display plot from Live Data Server
................................

Run overview pages (monitor.sns.gov/report/<instrument>/<run number>/) will query the Live
Run overview pages (``monitor.sns.gov/report/<instrument>/<run number>/``) will query the Live
Data Server for a plot for that instrument and run number and display it if available.

.. mermaid::
Expand Down
112 changes: 112 additions & 0 deletions docs/developer/design/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,115 @@ Design Overview
:maxdepth: 1

communication_flows


High-level architecture
-----------------------

The diagram below describes the high-level architecture of WebMon. The gray box labeled "DAS" are
services owned by the Data Acquisition System team that feed information to WebMon but are not part
of WebMon. The services communicate mainly through an ActiveMQ message broker. The communication
flow is described in :ref:`communication_flows`.

.. mermaid::

flowchart LR
FileArchive[("`SNS/HFIR
File archive`")]
subgraph DAS
DASMON
TranslationService["`Streaming
Translation
Client
(STC)`"]
SMS["`Stream
Management
Service
(SMS)`"]
PVSD
end
subgraph "Workflow Manager"
WorkflowManager[Workflow Manager]
DasmonListener[Dasmon listener]
Database[(DB)]
end
subgraph Autoreduction
Autoreducers-->|cataloging|ONCat
LiveDataServer<-->LiveDataDB[(DB)]
LiveReduce
end
subgraph Frontend
WebMon["`WebMon
monitor.sns.gov`"]
end
SMS-->|live data stream|LiveReduce
TranslationService-->|trigger reduction|WorkflowManager
DASMON-->|status|DasmonListener
DASMON-->|PV updates|Database
WorkflowManager<-->|instructions|Autoreducers
Autoreducers-->|publish plots|LiveDataServer
Database-->WebMon
ONCat-->|run metadata|WebMon
LiveDataServer-->|plots|WebMon
LiveReduce-->|publish plots|LiveDataServer
DasmonListener-->Database
WorkflowManager-->Database
TranslationService-->|NeXus file|FileArchive
FileArchive<-->Autoreducers
style DAS fill:#D3D3D3, stroke-dasharray: 5 5


High-level architecture
-----------------------

The diagram below describes the high-level architecture of WebMon. The gray box labeled "DAS" are
services owned by the Data Acquisition System team that feed information to WebMon, e.g. to trigger
autoreduction when a run is finished. The services mainly communicate through an ActiveMQ message
broker. The communication flow is described in :ref:`communication_flows`.

.. mermaid::

flowchart LR
FileArchive[("`SNS/HFIR
File archive`")]
subgraph DAS
DASMON
TranslationService["`Streaming
Translation
Client
(STC)`"]
SMS["`Stream
Management
Service
(SMS)`"]
PVSD
end
subgraph "Workflow Manager"
WorkflowManager[Workflow Manager]
DasmonListener[Dasmon listener]
Database[(DB)]
end
subgraph Autoreduction
Autoreducers-->|REST API|ONCat
LiveDataServer<-->LiveDataDB[(DB)]
LiveReduce
end
subgraph Frontend
WebMon["`WebMon
monitor.sns.gov`"]
end
SMS-->LiveReduce
TranslationService-.->|ActiveMQ|WorkflowManager
DASMON-.->|ActiveMQ|DasmonListener
DASMON-->Database
WorkflowManager<-.->|ActiveMQ|Autoreducers
Autoreducers-->|REST API|LiveDataServer
Database-->WebMon
ONCat-->|REST API|WebMon
LiveDataServer-->|REST API|WebMon
LiveReduce-->|REST API|LiveDataServer
DasmonListener-->Database
WorkflowManager-->Database
TranslationService-->FileArchive
FileArchive<-->Autoreducers
style DAS fill:#D3D3D3, stroke-dasharray: 5 5

0 comments on commit eae3bd2

Please sign in to comment.