Request body data (TODO: define these as needed for operation)
emulation_passed - true or false
ACTIVE_EMULATION --> SAVED - emulation complete Flags 100 or 101 (see below)
exit_development - true or false
ACTIVE_DEVELOPMENT --> SAVE_DEVELOPMENT - save vs. save & exit development session (see below)
exit_sandbox - true or false
ACTIVE_SANDBOX --> SAVE_SANDBOX - save vs. save & exit sandbox session (see below)
Possible states
ACTIVE_DEVELOPMENT
ACTIVE_EMULATION
ACTIVE_SANDBOX
ACTIVE_TESTBED
SAVING_DEVELOPMENT
SAVING_SANDBOX
SAVED (default - set when experiment is created)
WAIT_DEVELOPMENT_DEPLOY
WAIT_EMULATION_DEPLOY
WAIT_EMULATION_SCHEDULE
WAIT_SANDBOX_DEPLOY
WAIT_TESTBED_DEPLOY
WAIT_TESTBED_SCHEDULE
ETP Flags
Binary triple denoting experiment state as ETP
E: Returned from Emulation (1 is true, 0 is false)
T: Returned from Testbed (1 is true, 0 is false)
P: Passed Emulation Run (1 is passed, 0 is failed)
Valid Flag statuses as ETP
000: Saved by experimenter
100: Returned from emulation - did not pass
101: Returned from emulation - passed
010: Returned from testbed
Possible state transitions
ACTIVE_DEVELOPMENT
ACTIVE_DEVELOPMENT --> SAVE_DEVELOPMENT - save development session - Flags 000 (e.g. experimenter logged out of all VMs for one hour)
Examples:
# save and exit development session
data = {
"exit_development": true,
"next_state": "save_development"
}
# save and resume development session
data = {
"exit_development": false,
"next_state": "save_development"
}
# set flags to 101
data = {
"emulation_passed": true,
"next_state": "saved"
}
# set flags to 100
data = {
"emulation_passed": false,
"next_state": "saved"
}
ACTIVE_SANDBOX
ACTIVE_SANDBOX --> SAVE_SANDBOX - save sandbox session - Flags 000 (e.g. end of scheduled sandbox session)
Examples:
# save and exit sandbox session
data = {
"exit_sandbox": true,
"next_state": "save_sandbox"
}
# save and resume sandbox session
data = {
"exit_sandbox": false,
"next_state": "save_sandbox"
}
Experiment states and transitions
Define the logic for how an experiment transitions between states as defined below
Endpoints:
/experiments/{int:pk}/state
Functions:
experiment_id
as experiment member or as operatorexperiment_id
as experiment member or as operatorFields:
Request body data (TODO: define these as needed for operation)
emulation_passed
-true
orfalse
ACTIVE_EMULATION
-->SAVED
- emulation complete Flags100
or101
(see below)exit_development
-true
orfalse
ACTIVE_DEVELOPMENT
-->SAVE_DEVELOPMENT
- save vs. save & exit development session (see below)exit_sandbox
-true
orfalse
ACTIVE_SANDBOX
-->SAVE_SANDBOX
- save vs. save & exit sandbox session (see below)Possible states
ACTIVE_DEVELOPMENT
ACTIVE_EMULATION
ACTIVE_SANDBOX
ACTIVE_TESTBED
SAVING_DEVELOPMENT
SAVING_SANDBOX
SAVED
(default - set when experiment is created)WAIT_DEVELOPMENT_DEPLOY
WAIT_EMULATION_DEPLOY
WAIT_EMULATION_SCHEDULE
WAIT_SANDBOX_DEPLOY
WAIT_TESTBED_DEPLOY
WAIT_TESTBED_SCHEDULE
ETP Flags
ETP
E
: Returned from Emulation (1
is true,0
is false)T
: Returned from Testbed (1
is true,0
is false)P
: Passed Emulation Run (1
is passed,0
is failed)ETP
000
: Saved by experimenter100
: Returned from emulation - did not pass101
: Returned from emulation - passed010
: Returned from testbedPossible state transitions
ACTIVE_DEVELOPMENT
ACTIVE_DEVELOPMENT
-->SAVE_DEVELOPMENT
- save development session - Flags000
(e.g. experimenter logged out of all VMs for one hour)ACTIVE_EMULATION
ACTIVE_EMULATION
-->SAVED
- emulation complete - Flags100
or101
ACTIVE_SANDBOX
ACTIVE_SANDBOX
-->SAVE_SANDBOX
- save sandbox session - Flags000
(e.g. end of scheduled sandbox session)ACTIVE_TESTBED
ACTIVE_TESTBED
-->SAVED
- execution complete - Flags010
SAVE_DEVELOPMENT
SAVE_DEVELOPMENT
-->SAVED
- save development session - Flags000
(e.g. experimenter logged out of all VMs for one hour)SAVE_DEVELOPMENT
-->WAIT_DEVELOPMENT_DEPLOY
- save development session and return to developmentSAVE_SANDBOX
SAVE_SANDBOX
-->SAVED
- save sandbox session - Flags000
(e.g. end of scheduled sandbox session)SAVE_SANDBOX
-->WAIT_SANDBOX_DEPLOY
- save sandbox session and return to sandboxSAVED
SAVED
-->WAIT_DEVELOPMENT_DEPLOY
- start development sessionSAVED
-->WAIT_SANDBOX_DEPLOY
- schedule sandbox sessionSAVED
-->WAIT_EMULATION_SCHEDULE
- reqeust emulation sessionSAVED
-->WAIT_TESTBED_SCHEDULE
- request testbed session (allowed if(E&&P)|T
WAIT_DEVELOPMENT_DEPLOY
WAIT_DEVELOPMENT_DEPLOY
-->ACTIVE_DEVELOPMENT
- deployment on development VMs completeWAIT_DEVELOPMENT_DEPLOY
-->SAVED
- failure to deployWAIT_EMULATION_DEPLOY
WAIT_EMULATION_DEPLOY
-->ACTIVE_EMULATION
- scheduled deployment of emulation completeWAIT_EMULATION_DEPLOY
-->SAVED
- cancelWAIT_EMULATION_SCHEDULE
WAIT_EMULATION_SCHEDULE
-->WAIT_EMULATION_DEPLOY
- scheduleWAIT_EMULATION_SCHEDULE
-->SAVED
- cancel pending emulation sessionWAIT_SANDBOX_DEPLOY
WAIT_SANDBOX_DEPLOY
-->ACTIVE_SANDBOX
- scheduled deployment on sandbox completeWAIT_SANDBOX_DEPLOY
-->SAVED
- cancel pending sandbox sessionWAIT_TESTBED_DEPLOY
WAIT_TESTBED_DEPLOY
-->ACTIVE_TESTBED
- scheduled deployment of testbed completeWAIT_TESTBED_DEPLOY
-->SAVED
- cancelWAIT_TESTBED_SCHEDULE
WAIT_TESTBED_SCHEDULE
-->WAIT_TESTBED_DEPLOY
- scheduleWAIT_TESTBED_SCHEDULE
-->SAVED
- cancel pending testbed sessionTransitioning between states
The following need to be defined for EVERY transition listed above
PREFLIGHT CHECK
: Preflight validation for requested state change / logic / data collectionACTION ITEMS
: Transition action items (e.g. start/stop Session)UPDATE STATE
: Update experiment statePORTAL CF
: portal control framework decision points