Skip to content

Commit

Permalink
docs generated: updated statemachine docs
Browse files Browse the repository at this point in the history
  • Loading branch information
joelrebel committed May 4, 2023
1 parent cc26290 commit 72eed3c
Show file tree
Hide file tree
Showing 17 changed files with 443 additions and 203 deletions.
46 changes: 43 additions & 3 deletions docs/statemachine/README-action-statemachine.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,46 @@
# Flasher task action sub-statemachine
The Action sub-statemachine(s) is executed to install firmware for each component.

# Flasher task action sub-state machine(s)

The task Actions (sub-statemachines) are executed by the Task statemachine.

Note: Note each firmware to be installed is one action state machine.

```mermaid
graph TD;
n6("active");
n1("checkedCurrentFirmware");
n3("downloadedFirmware");
n4("failed");
n7("initiatedInstallFirmware");
n5("pending");
n8("polledFirmwareInstallStatus");
n11("poweredOffDevice");
n2("poweredOnDevice");
n9("resetBMC");
n10("resetDevice");
n12("succeeded");
n6-->|"Failed"|n4;
n6-->|"Power on device"|n2;
n1-->|"Download and verify firmware"|n3;
n1-->|"Failed"|n4;
n3-->|"Failed"|n4;
n3-->|"Initiate firmware install"|n7;
n7-->|"Failed"|n4;
n7-->|"Poll firmware install status"|n8;
n5-->|"Failed"|n4;
n8-->|"Failed"|n4;
n8-->|"Powercycle BMC"|n9;
n11-->|"Failed"|n4;
n11-->|"Success"|n12;
n2-->|"Check installed firmware"|n1;
n2-->|"Failed"|n4;
n9-->|"Failed"|n4;
n9-->|"Powercycle Device"|n10;
n10-->|"Failed"|n4;
n10-->|"Power off Device"|n11;
```
## Task Action (sub-statemachine) transitions

## Table of Contents

### States
Expand Down
72 changes: 45 additions & 27 deletions docs/statemachine/README-task-statemachine.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
# Flasher task state machine
The Task statemachine plans and executes Action (sub-statemachines) to install firmware.


The Task statemachine plans and executes Actions (sub-statemachines) to install firmware.

Note: The Task statemachine plans and and executes [Action sub-state machine(s)](docs/statemachine/README-action-statemachine.md) for each firmware being installed.

```mermaid
graph TD;
n1("active");
n3("failed");
n2("pending");
n4("succeeded");
n1-->|"Task failed"|n3;
n1-->|"Plan install actions"|n1;
n1-->|"Query device inventory"|n1;
n1-->|"Run install actions"|n4;
n1-->|"Task successful"|n4;
n2-->|"Initialize task"|n1;
n2-->|"Task failed"|n3;
```
## Task statemachine transitions

## Table of Contents

### States
* [Active](#active)
* [Failed](#failed)
* [Initial](#initial)
* [Queued](#queued)
* [Requested](#requested)
* [Success](#success)

### Transition Types
Expand All @@ -18,11 +37,12 @@ Transition types are the events that can cause a state transition
* [Plan](#plan)
* [Query](#query)
* [Run](#run)
* [success](#success)
* [succeeded](#succeeded)

### Transition Rules
Transition rules are the rules that define the required source states and conditions needed to move to a particular destination state when a particular transition type happens

* [Initialize task](#initialize-task)
* [Task failed](#task-failed)
* [Plan install actions](#plan-install-actions)
* [Query device inventory](#query-device-inventory)
Expand All @@ -38,9 +58,10 @@ In this state the task has been initialized and begun execution in the statemach
* [Plan](#plan)
* [Query](#query)
* [Run](#run)
* [success](#success)
* [succeeded](#succeeded)

#### Transition types where this is the destination state
* [null](#null)
* [Plan](#plan)
* [Query](#query)

Expand All @@ -56,6 +77,7 @@ In this state the task has been initialized and begun execution in the statemach
#### Transition rules where this is the destination state
![destination_active](./media-task-sm/destination_active.svg)

* [Initialize task](#initialize-task)
* [Plan install actions](#plan-install-actions)
* [Query device inventory](#query-device-inventory)

Expand Down Expand Up @@ -95,32 +117,19 @@ The initial state of the state machine. This is a synthetic state that is not ac
In this state the task is being initialized (this is done outside of the state machine).

#### Transition types where this is the source state
* [null](#null)
* [failed](#failed)

#### Transition types where this is the destination state

#### Transition rules where this is the source state
![source_queued](./media-task-sm/source_queued.svg)
![source_pending](./media-task-sm/source_pending.svg)

* [Initialize task](#initialize-task)
* [Task failed](#task-failed)

#### Transition rules where this is the destination state
![destination_queued](./media-task-sm/destination_queued.svg)


### Requested
In this state the task has been requested (this is done outside of the state machine).

#### Transition types where this is the source state

#### Transition types where this is the destination state

#### Transition rules where this is the source state
![source_requested](./media-task-sm/source_requested.svg)


#### Transition rules where this is the destination state
![destination_requested](./media-task-sm/destination_requested.svg)
![destination_pending](./media-task-sm/destination_pending.svg)


### Success
Expand All @@ -130,14 +139,14 @@ In this state the task execution has completed successfully.

#### Transition types where this is the destination state
* [Run](#run)
* [success](#success)
* [succeeded](#succeeded)

#### Transition rules where this is the source state
![source_success](./media-task-sm/source_success.svg)
![source_succeeded](./media-task-sm/source_succeeded.svg)


#### Transition rules where this is the destination state
![destination_success](./media-task-sm/destination_success.svg)
![destination_succeeded](./media-task-sm/destination_succeeded.svg)

* [Run install actions](#run-install-actions)
* [Task successful](#task-successful)
Expand Down Expand Up @@ -195,7 +204,7 @@ In this transition the actions (sub state machines) for the firmware install are
![transition_type_run](./media-task-sm/transition_type_run.svg)

* [Run install actions](#run-install-actions)
### success
### succeeded
In this transition the task has completed successfully and any post failure steps are being executed.

#### Source states where this transition type applies
Expand All @@ -204,13 +213,22 @@ In this transition the task has completed successfully and any post failure step
#### Destination states where this transition type applies
* [Success](#success)
#### Transition rules using this transition type
![transition_type_success](./media-task-sm/transition_type_success.svg)
![transition_type_succeeded](./media-task-sm/transition_type_succeeded.svg)

* [Task successful](#task-successful)

## Transition Rules
Transition rules are the rules that define the required source states and conditions needed to move to a particular destination state when a particular transition type happens

### Initialize task
Performs any task initialization, and transitions the state from pending to active.

#### Source states
* [Queued](#queued)

#### Destination state
[Active](#active)

### Task failed
Task execution has failed because of a failed task action or task handler.

Expand Down
8 changes: 4 additions & 4 deletions docs/statemachine/action-statemachine.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{
"transition_type": "failed",
"source_states": [
"queued",
"pending",
"active",
"poweredOnDevice",
"checkedCurrentFirmware",
Expand Down Expand Up @@ -66,7 +66,7 @@
{
"transition_type": "poweringOnDevice",
"source_states": [
"queued"
"active"
],
"destination_state": "poweredOnDevice",
"name": "Power on device",
Expand All @@ -91,11 +91,11 @@
"description": "Powercycle Device - only when pollFirmwareInstallStatus() identifies a Device power cycle is required."
},
{
"transition_type": "success",
"transition_type": "succeeded",
"source_states": [
"poweredOffDevice"
],
"destination_state": "success",
"destination_state": "succeeded",
"name": "Success",
"description": "Firmware install on component completed successfully."
}
Expand Down
36 changes: 18 additions & 18 deletions docs/statemachine/media-action-sm/destination_poweredOnDevice.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 17 additions & 17 deletions docs/statemachine/media-action-sm/source_poweredOffDevice.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 72eed3c

Please sign in to comment.