[x] create - by experiment workflow - event driven and not via the API, see experiment_sessions.py
[x] update - by experiment workflow - event driven and not via the API, see experiment_sessions.py
[x] delete - by experiment workflow - event driven and not via the API, see experiment_sessions.py
Fields
--- /sessions
end_date_time: - string
ended_by: - int
experiment_id: - int
session_id: - int
session_type: - string
start_date_time: - string
started_by: - int
--- /sessions/{int:pk}
created_by - string
end_date_time: - string
ended_by: - int
experiment_id: - int
is_active - bool
session_id: - int
session_type: - string
start_date_time: - string
started_by: - int
Notes
Rows are created as immutable (other than ended_by and end_time which are NULL and then both populated at the same time (generally by an operator controlled action)
All testbed (and emulation?) sessions currently created by an operator
Sandbox sessions can be created by online tools as an experimenter
Development sessions could be automated by the experimenter when they submit to the testbed via tools
For any experiment there can only be 1 active execution session
Experiment states and sessions
Define the session create/activate, start, stop and deactivate criterea for each state transition
class SessionType(models.TextChoices):
DEVELOPMENT = 'development', _('Development')
EMULATION = 'emulation', _('Emulation')
SANDBOX = 'sandbox', _('Sandbox')
TESTBED = 'testbed', _('Testbed')
Possible states - session(s)
ACTIVE_DEVELOPMENT - DEVELOPMENT start, started by, active=True
ACTIVE_EMULATION - EMULATION start, started by, active=True
ACTIVE_SANDBOX - SANDBOX start, started by, active=True
ACTIVE_TESTBED - TESTBED start, started by, active=True
/sessions
Endpoints
/sessions
paginated/sessions/{int:pk}
Functions
experiment_id
asoperator
session_id
asoperator
experiment_sessions.py
experiment_sessions.py
experiment_sessions.py
Fields
Notes
ended_by
andend_time
which areNULL
and then both populated at the same time (generally by anoperator
controlled action)operator
experimenter
experimenter
when they submit to the testbed via toolsExperiment states and sessions
Define the session create/activate, start, stop and deactivate criterea for each state transition
Possible states - session(s)
ACTIVE_DEVELOPMENT
-DEVELOPMENT
start, started by, active=TrueACTIVE_EMULATION
-EMULATION
start, started by, active=TrueACTIVE_SANDBOX
-SANDBOX
start, started by, active=TrueACTIVE_TESTBED
-TESTBED
start, started by, active=TrueSAVED
-DEVELOPMENT, EMULATION, SANDBOX, TESTBED
stop, stopped by, active=FalseWAIT_DEVELOPMENT_DEPLOY
-DEVELOPMENT
create, active=TrueWAIT_EMULATION_DEPLOY
-EMULATION
active=TrueWAIT_EMULATION_SCHEDULE
-EMULATION
create, active=TrueWAIT_SANDBOX_DEPLOY
-SANDBOX
create, active=TrueWAIT_TESTBED_DEPLOY
-TESTBED
active=TrueWAIT_TESTBED_SCHEDULE
-TESTBED
create, active=TruePossible state transitions
ACTIVE_DEVELOPMENT
ACTIVE_DEVELOPMENT
-->SAVED
- save development session - Flags000
(e.g. experimenter logged out of all VMs for one hour)DEVELOPMENT
-end_date_time
,ended_by
,active=False
ACTIVE_DEVELOPMENT
-->ACTIVE_DEVELOPMENT
- save development session but do not exitDEVELOPMENT
-active=True
ACTIVE_EMULATION
ACTIVE_EMULATION
-->SAVED
- emulation complete - Flags100
or101
EMULATION
-end_date_time
,ended_by
,active=False
ACTIVE_SANDBOX
ACTIVE_SANDBOX
-->SAVED
- save sandbox session - Flags000
(e.g. end of scheduled sandbox session)SANDBOX
-end_date_time
,ended_by
,active=False
ACTIVE_SANDBOX
-->ACTIVE_SANDBOX
- save sandbox session but do not exitSANDBOX
-active=True
ACTIVE_TESTBED
ACTIVE_TESTBED
-->SAVED
- execution complete - Flags010
TESTBED
-end_date_time
,ended_by
,active=False
SAVED
SAVED
-->WAIT_DEVELOPMENT_DEPLOY
- start development sessionDEVELOPMENT
-created
,created_by
SAVED
-->WAIT_SANDBOX_DEPLOY
- schedule sandbox sessionSANDBOX
-created
,created_by
SAVED
-->WAIT_EMULATION_SCHEDULE
- reqeust emulation sessionEMULATION
-created
,created_by
SAVED
-->WAIT_TESTBED_SCHEDULE
- request testbed session (allowed if(E&&P)|T
TESTBED
-created
,created_by
WAIT_DEVELOPMENT_DEPLOY
WAIT_DEVELOPMENT_DEPLOY
-->ACTIVE_DEVELOPMENT
- deployment on development VMs completeDEVELOPMENT
-start_date_time
,started_by
WAIT_DEVELOPMENT_DEPLOY
-->SAVED
- failure to deployDEVELOPMENT
-active=False
WAIT_EMULATION_DEPLOY
WAIT_EMULATION_DEPLOY
-->ACTIVE_EMULATION
- scheduled deployment of emulation completeEMULATION
-start_date_time
,started_by
WAIT_EMULATION_DEPLOY
-->SAVED
- cancelEMULATION
-active=False
WAIT_EMULATION_SCHEDULE
WAIT_EMULATION_SCHEDULE
-->WAIT_EMULATION_DEPLOY
- scheduleEMULATION
-active=True
WAIT_EMULATION_SCHEDULE
-->SAVED
- cancel pending emulation sessionEMULATION
-active=False
WAIT_SANDBOX_DEPLOY
WAIT_SANDBOX_DEPLOY
-->ACTIVE_SANDBOX
- scheduled deployment on sandbox completeSANDBOX
-start_date_time
,started_by
WAIT_SANDBOX_DEPLOY
-->SAVED
- cancel pending sandbox sessionSANDBOX
-active=False
WAIT_TESTBED_DEPLOY
WAIT_TESTBED_DEPLOY
-->ACTIVE_TESTBED
- scheduled deployment of testbed completeTESTBED
-start_date_time
,started_by
WAIT_TESTBED_DEPLOY
-->SAVED
- cancelTESTBED
-active=False
WAIT_TESTBED_SCHEDULE
WAIT_TESTBED_SCHEDULE
-->WAIT_TESTBED_DEPLOY
- scheduleTESTBED
-active=True
WAIT_TESTBED_SCHEDULE
-->SAVED
- cancel pending testbed sessionTESTBED
-active=False