Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Firebolt Lifecycle 2.0: Simplified Lifecycle 2.0 

HLA

draw.io Diagram
bordertrue
diagramNameHLA
simpleViewerfalse
width
linksauto
tbstyletop
lboxtrue
diagramWidth751
height429
revision1

Step 0-3 Common Prelaunch

...

PlantUML Macro
@startuml

autonumber "[0]"
'hide footbox

title Setup Listeners for AI 2.0

participant ":SystemApp" as SystemApp
participant ":Package Manager" as PM
participant ":App Manager" as AM
participant ":Lifecycle Manager" as LM
participant ":Runtime Manager" as RM
participant ":Window Manager" as WM
participant ":Ripple" as Ripple

SystemApp -> AM: Listen for \nonAppLifecycleStateChanged()
AM -> LM: Listen for\nonAppLifecycleStateChanged()
AM -> PM: Listen for\nonAppInstallationStatus()
Ripple -> LM:  Listen for\nonAppLifecycleStateChanged()
LM -> WM: Listen for\n onReady()
LM -> WM: Listen for\n onVisible()
LM -> RM: Listen for\n onStateChanged()
@enduml

...

PlantUML Macro
@startuml

autonumber 24 "[0]"
'hide footbox

title Container Launch

participant ":App Manager" as AM
participant ":Lifecycle Manager" as LM
participant ":Runtime Manager" as RM
participant ":Window Manager" as WM
participant ":OCI" as OCI
participant ":Ripple" as Ripple

LM -> RM: run( appId, env )
activate RM
RM ->> LM: onStateChanged(Starting)
RM -> RM: Create Dobby Spec\n from Config Object
RM -> RM: Create User Id
 Note left of RM: Add Storage Manager.get using user Id
RM -> WM: createDisplay(appInstanceId)
WM --> RM: Wayland env variable display name
RM -> RM : Update display name
RM -> OCI: startContainer(spec)
OCI -> App: exec()
OCI ->> RM: onStarted
RM ->> LM : onStateChanged(Running)
LM -> LM: newAppLifecycleState = INITIALIZING
LM ->> AM: onAppLifecycleStateChanged\nINITIALIZING
LM ->> Ripple: onAppLifecycleStateChanged\n INITIALIZING 
Ripple ->> Ripple: Update app state
deactivate RM
@enduml

...

PlantUML Macro
@startuml

autonumber 3937 "[0]"
'hide footbox

title Launch for an Active Interactive App

participant ":SystemApp" as SystemApp
participant ":App Manager" as AM
participant ":Lifecycle Manager" as LM
participant ":Runtime Manager" as RM
participant ":Window Manager" as WM
participant ":Ripple" as Ripple
participant ":Firebolt App" as App

note right of SystemApp: Launch with target lifecycle state of ACTIVE
== 1. App Lifecycle Start up ==

activate App
note right of Ripple: url = getenv( "FIREBOLT_ENDPOINT" )
activate Ripple
App -> Ripple: Setup Lifecycle Listeners
App -> Ripple: Lifecycle.ready
Ripple -> LM: appReady() [JQ]
LM -> LM: newAppLifecycleState = PAUSED
LM ->> AM: onAppLifecycleStateChanged\nPAUSED
LM ->> Ripple: onAppLifecycleStateChanged\n PAUSED 
Ripple ->> App: onStart()
opt If frame is already rendered
LM -> WM: renderReady()
WM --> LM: true
end
opt else
note right of WM: Render first frame
App ->> WM: Wayland event
WM ->> LM: onReady(appInstanceId)
end
LM -> LM: newAppLifecycleState = ACTIVE
LM ->> Ripple : onAppLifecycleStateChanged\nACTIVE
Ripple ->> App: onActivate()
LM ->> AM: onAppLifecycleStateChanged\nACTIVE
AM ->> SystemApp: onAppLifecycleStateChanged\nACTIVE

opt SystemApp handling visibility and focus
SystemApp -> WM: wayland set_properties(appInstanceId,visible)
WM ->> LM: onVisible(appInstanceId)
SystemApp -> WM: wayland set_client_focus(appInstanceId)
end

deactivate Ripple
deactivate App


@enduml

...

PlantUML Macro
@startuml

autonumber 3937 "[0]"
'hide footbox

title Launch for an Suspended Interactive App

participant ":SystemApp" as SystemApp
participant ":App Manager" as AM
participant ":Lifecycle Manager" as LM
participant ":Runtime Manager" as RM
participant ":Window Manager" as WM
participant ":Ripple" as Ripple
participant ":Firebolt App" as App

note right of SystemApp: Preloaded with target lifecycle state of SUSPENDED
activate App
note right of Ripple: url = getenv( "FIREBOLT_ENDPOINT" )
activate Ripple
App -> Ripple: Setup Lifecycle Listeners
App -> Ripple: Lifecycle.ready
Ripple -> LM: appReady() [JQ]
LM -> LM: newAppLifecycleState = SUSPENDED
LM -> RM: suspend(appInstanceId)
LM ->>> AM: onAppLifecycleStateChanged\WM: enableDisplayRender(appInstanceId, false)
RM -> OCI: 
LM ->> AM: onAppLifecycleStateChanged\nSUSPENDED
LM ->> Ripple: onAppLifecycleStateChanged\n SUSPENDED 
Ripple ->> App: onStartSuspend

deactivate Ripple
deactivate App


@enduml

...

PlantUML Macro
@startuml

autonumber 58 "[0]"
'hide footbox

title Launch for an Suspended Interactive App

participant ":SystemApp" as SystemApp
participant ":App Manager" as AM
participant ":Lifecycle Manager" as LM
participant ":Window Manager" as WM
participant ":Ripple" as Ripple
participant ":Firebolt App" as App

note right of SystemApp: Contd from Step 4A
note right of SystemApp: If contd from Step 4b its 66
SystemApp -> AM: closeApp
AM -> LM: setTargetAppState(PAUSED)
LM -> LM: newAppLifecycleState = PAUSED
LM ->> Ripple: onAppLifecycleStateChanged\n PAUSED 
Ripple ->> App: onPause
LM ->> AM: onAppLifecycleStateChanged\nPAUSED
AM ->> SystemApp: onAppLifecycleStateChanged\nPAUSED
opt Termination
SystemApp -> AM: terminateAppnote right of AM: check for InstallBlocked/UninstallBlocked and move the app to terminate
AM ->> SystemApp: onAppLifecycleStateChanged\nPAUSED
AM -> LM: unloadApp
LM -> LM: newAppLifecycleState = TERMINATING
LM ->> Ripple: onAppLifecycleStateChanged\n TERMINATING 
note right of Ripple: No guarantee for this dispatch
Ripple -> Ripple: Cleanup
Ripple ->> App: onDestroy
LM -> LM: Cleanup
end
LM -> RM: terminate
RM -> OCI: stopContainer

@enduml


Step 5B Deactivate for Suspendable Apps

...

PlantUML Macro
@startuml

autonumber 65 "[0]"
'hide footbox

title Launch for an Suspended Interactive App

participant ":SystemApp" as SystemApp
participant ":App Manager" as AM
participant ":Lifecycle Manager" as LM
participant ":Runtime Manager" as RM
participant ":Window Manager" as WM
participant ":Ripple" as Ripple
participant ":Firebolt App" as App

note right of SystemApp: Contd from Step 4B contd
SystemApp -> AM: closeApp
AM -> LM: setTargetAppState(PAUSED)
LM -> LM: newAppLifecycleState = PAUSED
LM ->> Ripple: onAppLifecycleStateChanged\n PAUSED 
Ripple ->> App: onPause
LM ->> AM: onAppLifecycleStateChanged\nPAUSED
note right of AM: check for InstallBlocked/UninstallBlocked and move the app to terminate
AM ->> SystemApp: onAppLifecycleStateChanged\nPAUSED

note right of AM: Based on Suspension Policy
note right of AM: Need some methods in App Manager to support this TBD
AM -> LM: setAppTargetState(SUSPENDED)
LM -> LM: newAppLifecycleState = SUSPENDED
LM -> RM: suspend(appInstanceId)
LM ->> Ripple: onAppLifecycleStateChanged\n SUSPENDED 
Ripple ->> App: onSuspend
opt If App is enabled for Hibernation
note right of AM: Based on Hibernation Policy
note right of AM: Need some methods in App Manager to support this TBD
AM -> LM: setAppTargetState(HIBERNATED)
LM -> LM: newAppLifecycleState = HIBERNATED
LM -> RM: hibernate(appInstanceId)
end 


opt Termination
SystemApp -> AM: terminateApp
AM -> LM: unloadApp
opt Given current state is HIBERNATED
LM -> LM: newAppLifecycleState = SUSPENDED
LM -> RM: wake(appInstanceId,suspended)
LM -> LM: newAppLifecycleState = SUSPENDED
LM ->> Ripple: onAppLifecycleStateChanged\n SUSPENDED 
Ripple ->> App: onRestore
end
LM -> LM: newAppLifecycleState = TERMINATING
LM ->> Ripple: onAppLifecycleStateChanged\n TERMINATING 
note right of Ripple: No guarantee for this dispatch
Ripple -> Ripple: Cleanup
Ripple ->> App: onDestroy
LM -> LM: Cleanup
end
@enduml

...