Skip to content
Draft
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
23 changes: 23 additions & 0 deletions docs/diagrams/ActionDiagrams/ActorChange.md
Original file line number Diff line number Diff line change
@@ -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 <br> authentication <br> with token
A1 ->> C: Authentication <br> result
C ->> A2: Check user <br> authorization <br> with username
A2 ->> C: Authorization <br> result
Note over C: Remove User 1 <br> as actor
C ->> U1: Notification: Control surrendered
C ->> U1: WhoIsInCharge
C ->> U2: WhoIsInCharge
U2 ->> C: Take control
Note over C: Assign User 2 <br> as actor
```
57 changes: 57 additions & 0 deletions docs/diagrams/ActionDiagrams/AuthorizationAuthentication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# General command excecution
```mermaid
sequenceDiagram
participant User
participant PartM as Partition <br> Manager
participant GUI
participant PO as Process <br> Orchestrator
participant TC as Top <br> 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 <br> authentication <br> with token
A1 ->> C: Authentication <br> result
C ->> A2: Check user <br> authorized actions <br> with username
A2 ->> C: Return user <br> authorized actions
C ->> User: Command list

```
39 changes: 39 additions & 0 deletions docs/diagrams/ActionDiagrams/boot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
```mermaid
sequenceDiagram
participant User
participant PartM as Partition <br> Manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eugh... This isn't the correct terminology. I think this is now the Session Manager

participant GUI
participant PO as Process <br> Orchestrator
participant TC as Top <br> 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
```
30 changes: 30 additions & 0 deletions docs/diagrams/ActionDiagrams/fsm_transition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
```mermaid
sequenceDiagram
participant User
participant TC as Top <br> 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 <br> available from <br> current state
TC ->> User: Notify invalid transition
Note right of TC: If transition <br> invalid

Note over TC: Pre-transition <br> sequence <br> e.g. run_number
TC ->> SC: Forward command

Note over SC: Verify transition <br> available from <br> current state
SC ->> TC: Notify invalid transition
Note right of SC: If transition <br> invalid

SC ->> A: Forward command
Note over A: Execute commnad
A ->> SC: Notification: completed

Note over SC: Post transition <br> sequence e.g. <br> pin_thread
SC ->> TC: Notify completed

Note over TC: Post transition <br> sequence e.g. <br> ELISA logbook
TC ->> User: Notification: completed
```
23 changes: 23 additions & 0 deletions docs/diagrams/ActionDiagrams/partition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```mermaid
sequenceDiagram
participant User
participant AuthDB as Authorization and <br> authentication <br> database
participant ConfDB as Configuration <br> database
participant ResDB as Resource <br> database

Note over User: Request partition
User ->> AuthDB: Check Authorization
AuthDB ->> User: Return Authorization
Note right of User: If unautorized, <br> rejest request <br> and notify user

Note over User: Request configuration
User ->> ConfDB: Request configuration
ConfDB ->> User: Return configuration
User ->> ResDB: Check required <br> resource availability
ResDB ->> User: Return resource <br> availability
Note right of User: If unautorized, <br> rejest configuration <br> and notify user

Note over User: Choose apps/controllers to include/exclude

Note over User: Boot session
```
17 changes: 17 additions & 0 deletions docs/diagrams/ActionDiagrams/ssh-terminate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```mermaid
sequenceDiagram
participant User
participant PO as Process <br> Orchestrator
participant TC as Top <br> Controller
participant SC as Sub <br> Controller
participant A as App

User ->> PO: Send `terminate`
PO ->> A: Send `SIGHUP`
A ->> PO: Notification: <br> terminate complete
PO ->> SC: Send `SIGHUP`
SC ->> PO: Notification: <br> terminate complete
PO ->> TC: Send `SIGHUP`
TC ->> PO: Notification: <br> terminate complete
PO ->> User: Redirect to <br> partition handler
```
15 changes: 15 additions & 0 deletions docs/diagrams/ActionDiagrams/terminate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```mermaid
sequenceDiagram
participant User
participant RC as Run <br> Control
participant PartM as Partition <br> 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
```
19 changes: 19 additions & 0 deletions docs/diagrams/ActionDiagrams/terminate2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```mermaid
sequenceDiagram
participant User
participant TC as Top <br> Controller
participant SC as Sub <br> 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
```
15 changes: 15 additions & 0 deletions docs/reference/unified_shell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Module: `unified_shell`

::: mymodule
handler: python

## unified_shell()
```mermaid
flowchart TD
A[drunc_unified_shell &ltopts&gt &ltargs&gt] --> 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 <br> manager running}
F -- Yes --> G
F -- No --> H
```
Loading