diff --git a/docs/diagrams/ActionDiagrams/ActorChange.md b/docs/diagrams/ActionDiagrams/ActorChange.md new file mode 100644 index 000000000..957d3d1c2 --- /dev/null +++ b/docs/diagrams/ActionDiagrams/ActorChange.md @@ -0,0 +1,23 @@ +```mermaid +--- +id: d0abd951-f88e-487f-a1a3-1c11060408d8 +--- +sequenceDiagram + participant U2 as User 2 + participant U1 as User 1 + participant C as Controller + participant A1 as Authenticator + participant A2 as Authorizer + + U1 ->> C: Surrender control + C ->> A1: Check user
authentication
with token + A1 ->> C: Authentication
result + C ->> A2: Check user
authorization
with username + A2 ->> C: Authorization
result + Note over C: Remove User 1
as actor + C ->> U1: Notification: Control surrendered + C ->> U1: WhoIsInCharge + C ->> U2: WhoIsInCharge + U2 ->> C: Take control + Note over C: Assign User 2
as actor +``` \ No newline at end of file diff --git a/docs/diagrams/ActionDiagrams/AuthorizationAuthentication.md b/docs/diagrams/ActionDiagrams/AuthorizationAuthentication.md new file mode 100644 index 000000000..43d47e411 --- /dev/null +++ b/docs/diagrams/ActionDiagrams/AuthorizationAuthentication.md @@ -0,0 +1,57 @@ +# General command excecution +```mermaid +sequenceDiagram + participant User + participant PartM as Partition
Manager + participant GUI + participant PO as Process
Orchestrator + participant TC as Top
Controller + participant A as Apps + + User ->> PartM: Boot + PartM ->> GUI: Start new GUI + Note over GUI: c'tor command sender + Note over GUI: c'tor status listener + GUI ->> GUI: Listen for notifications + GUI ->> PartM: Notify c'tor complete + + PartM ->> PO: Boot session + Note over PO: c'tor status notifier + PO ->> GUI: Handshake + PO ->> PartM: Handshake + Note over PO: c'tor command receiver + PO ->> PO: Listen for notifications + PO ->> TC: Boot top controller + Note over TC: c'tor status notifier + Note over TC: c'tor command receiver + TC ->> TC: Wait for commands + Note over TC: c'tor FSM + Note over TC: c'tor status listener + TC ->> TC: Listen for notifications + TC ->> A: Boot applications and controllers + Note over A: c'tor + A ->> TC: Handshake + A ->> TC: Notification: boot complete + Note over TC: c'tor command sender + TC ->> PO: Notification: boot complete + PO ->> PartM: Notification: boot complete + + PartM ->> User: Redirect User to GUI +``` + +# List available commands +```mermaid +sequenceDiagram + participant User + participant C as Controller + participant A1 as Authenticator + participant A2 as Authorizer + + User ->> C: Command request list + C ->> A1: Check user
authentication
with token + A1 ->> C: Authentication
result + C ->> A2: Check user
authorized actions
with username + A2 ->> C: Return user
authorized actions + C ->> User: Command list + +``` \ No newline at end of file diff --git a/docs/diagrams/ActionDiagrams/boot.md b/docs/diagrams/ActionDiagrams/boot.md new file mode 100644 index 000000000..a6d447987 --- /dev/null +++ b/docs/diagrams/ActionDiagrams/boot.md @@ -0,0 +1,39 @@ +```mermaid +sequenceDiagram + participant User + participant PartM as Partition
Manager + participant GUI + participant PO as Process
Orchestrator + participant TC as Top
Controller + participant A as Apps + + User ->> PartM: Boot + PartM ->> GUI: Start new GUI + Note over GUI: c'tor command sender + Note over GUI: c'tor status listener + GUI ->> GUI: Listen for notifications + GUI ->> PartM: Notify c'tor complete + + PartM ->> PO: Boot session + Note over PO: c'tor status notifier + PO ->> GUI: Handshake + PO ->> PartM: Handshake + Note over PO: c'tor command receiver + PO ->> PO: Listen for notifications + PO ->> TC: Boot top controller + Note over TC: c'tor status notifier + Note over TC: c'tor command receiver + TC ->> TC: Wait for commands + Note over TC: c'tor FSM + Note over TC: c'tor status listener + TC ->> TC: Listen for notifications + TC ->> A: Boot applications and controllers + Note over A: c'tor + A ->> TC: Handshake + A ->> TC: Notification: boot complete + Note over TC: c'tor command sender + TC ->> PO: Notification: boot complete + PO ->> PartM: Notification: boot complete + + PartM ->> User: Redirect User to GUI +``` \ No newline at end of file diff --git a/docs/diagrams/ActionDiagrams/fsm_transition.md b/docs/diagrams/ActionDiagrams/fsm_transition.md new file mode 100644 index 000000000..2df76b5fa --- /dev/null +++ b/docs/diagrams/ActionDiagrams/fsm_transition.md @@ -0,0 +1,30 @@ +```mermaid +sequenceDiagram + participant User + participant TC as Top
Controller + participant SC as Subcontroller + participant A as App + + User ->> TC: Send FSM command + Note over TC: FSM command received + Note over TC: Verify transition
available from
current state + TC ->> User: Notify invalid transition + Note right of TC: If transition
invalid + + Note over TC: Pre-transition
sequence
e.g. run_number + TC ->> SC: Forward command + + Note over SC: Verify transition
available from
current state + SC ->> TC: Notify invalid transition + Note right of SC: If transition
invalid + + SC ->> A: Forward command + Note over A: Execute commnad + A ->> SC: Notification: completed + + Note over SC: Post transition
sequence e.g.
pin_thread + SC ->> TC: Notify completed + + Note over TC: Post transition
sequence e.g.
ELISA logbook + TC ->> User: Notification: completed +``` \ No newline at end of file diff --git a/docs/diagrams/ActionDiagrams/partition.md b/docs/diagrams/ActionDiagrams/partition.md new file mode 100644 index 000000000..515ccaf0a --- /dev/null +++ b/docs/diagrams/ActionDiagrams/partition.md @@ -0,0 +1,23 @@ +```mermaid +sequenceDiagram + participant User + participant AuthDB as Authorization and
authentication
database + participant ConfDB as Configuration
database + participant ResDB as Resource
database + + Note over User: Request partition + User ->> AuthDB: Check Authorization + AuthDB ->> User: Return Authorization + Note right of User: If unautorized,
rejest request
and notify user + + Note over User: Request configuration + User ->> ConfDB: Request configuration + ConfDB ->> User: Return configuration + User ->> ResDB: Check required
resource availability + ResDB ->> User: Return resource
availability + Note right of User: If unautorized,
rejest configuration
and notify user + + Note over User: Choose apps/controllers to include/exclude + + Note over User: Boot session +``` \ No newline at end of file diff --git a/docs/diagrams/ActionDiagrams/ssh-terminate.md b/docs/diagrams/ActionDiagrams/ssh-terminate.md new file mode 100644 index 000000000..037fdf3da --- /dev/null +++ b/docs/diagrams/ActionDiagrams/ssh-terminate.md @@ -0,0 +1,17 @@ +```mermaid +sequenceDiagram + participant User + participant PO as Process
Orchestrator + participant TC as Top
Controller + participant SC as Sub
Controller + participant A as App + + User ->> PO: Send `terminate` + PO ->> A: Send `SIGHUP` + A ->> PO: Notification:
terminate complete + PO ->> SC: Send `SIGHUP` + SC ->> PO: Notification:
terminate complete + PO ->> TC: Send `SIGHUP` + TC ->> PO: Notification:
terminate complete + PO ->> User: Redirect to
partition handler +``` \ No newline at end of file diff --git a/docs/diagrams/ActionDiagrams/terminate.md b/docs/diagrams/ActionDiagrams/terminate.md new file mode 100644 index 000000000..92e993dac --- /dev/null +++ b/docs/diagrams/ActionDiagrams/terminate.md @@ -0,0 +1,15 @@ +```mermaid +sequenceDiagram + participant User + participant RC as Run
Control + participant PartM as Partition
Manager + participant App + + User ->> RC: Request end of partition + RC ->> PartM: Terminate partition + PartM ->> RC: Kill TopNodeController, d'tor + RC ->> RC: Kill subcontroller, d'tor + RC ->> App: Kill application, d'tor + App ->> PartM: Notify complete + PartM ->> User: Notify complete +``` \ No newline at end of file diff --git a/docs/diagrams/ActionDiagrams/terminate2.md b/docs/diagrams/ActionDiagrams/terminate2.md new file mode 100644 index 000000000..af7345f81 --- /dev/null +++ b/docs/diagrams/ActionDiagrams/terminate2.md @@ -0,0 +1,19 @@ +```mermaid +sequenceDiagram + participant User + participant TC as Top
Controller + participant SC as Sub
Controller + participant A as App + + User ->> TC: Send `terminate` + Note over TC: `terminate` received + TC ->> SC: Forward `terminate` + Note over SC: `terminate` received + SC ->> A: Forward `terminate` + Note over A: d'tor + A ->> SC: Notification: `terminate` complete + Note over SC: d'tor + SC ->> TC: Notification: `terminate` complete + Note over TC: d'tor + TC ->> User: Notification: `terminate` complete +``` \ No newline at end of file diff --git a/docs/reference/unified_shell.md b/docs/reference/unified_shell.md new file mode 100644 index 000000000..94e04885a --- /dev/null +++ b/docs/reference/unified_shell.md @@ -0,0 +1,15 @@ +# Module: `unified_shell` + +::: mymodule + handler: python + +## unified_shell() +```mermaid +flowchart TD + A[drunc_unified_shell <opts> <args>] --> B[Setup unified_shell logger with RichHandler] + B --> C[Check if need to spawn process manager or not by scheme] + C --> D[Setup logging to the process manager log file] + E --> F{Is process
manager running} + F -- Yes --> G + F -- No --> H +``` \ No newline at end of file