AERPAW-Platform-Control / aerpaw-portal

AERPAW Portal v2
0 stars 2 forks source link

API logic - experiment state and state transition logic #15

Open mjstealey opened 2 years ago

mjstealey commented 2 years ago

Experiment states and transitions

Define the logic for how an experiment transitions between states as defined below

Endpoints:

Functions:

Fields:

--- /experiments/{int:pk}/state
experiment_flags:    - string
experiment_id:       - int
experiment_state:    - string
experiment_uuid:     - string

Request body data (TODO: define these as needed for operation)

Possible states

ETP Flags

Possible state transitions

ACTIVE_DEVELOPMENT

# 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"
}

ACTIVE_EMULATION

# set flags to 101
data = {
  "emulation_passed": true,
  "next_state": "saved"
}
# set flags to 100
data = {
  "emulation_passed": false,
  "next_state": "saved"
}

ACTIVE_SANDBOX

# 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"
}

ACTIVE_TESTBED

SAVE_DEVELOPMENT

SAVE_SANDBOX

SAVED

WAIT_DEVELOPMENT_DEPLOY

WAIT_EMULATION_DEPLOY

WAIT_EMULATION_SCHEDULE

WAIT_SANDBOX_DEPLOY

WAIT_TESTBED_DEPLOY

WAIT_TESTBED_SCHEDULE

Transitioning between states

The following need to be defined for EVERY transition listed above

mjstealey commented 2 years ago

Update experiment state and transition logic based on diagram

Screenshot 2022-11-04 at 4 28 12 PM