proxy: support for software destruction
This introduces a new `state` column in `software` table. Because node already has support for reporting various states of software lifetime, this implementation stores the actual state of the software installation. ```plantuml @startuml start repeat -> client request software in state available \n ""supplySupply?state="available"""; if (already available ?) then (yes) :available; else (no ) :install_requested; -> node starts building \n ""buildingSoftwareRelease""; :building; if ( build result? ) then ( node report build successful \n ""availableSoftwareRelease"" ) :available; else (node report build error \n ""softwareReleaseError"" ) :error; endif endif repeat while () -> client request software in state destroyed \n ""supplySupply?state="destroyed""";; :destroyed; -> node notify software is deleted \n""destroyedSoftwareRelease""; stop @enduml ```
-
States has to follow the same API on master https://lab.nexedi.com/nexedi/slapos.core/tree/master/master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/installation_slap_interface_workflow/states
The decision to launch buildout or not, it is not based on the availability of the software, but based on a decision taken by slapgrid itself.
For all softwares that are on start_requested state, I process buildout, unless I found the flag .completed. For all softwares that are on destroy_requested state, remove it, unless I cannot find it.
Of course, that once it is finished (both procedures), the slapgrid notify master, and master takes its actions (invalidating the destroyed software). So on master we use validation workflow in addition to the declarative state (start_requested/destroy_requested).
-
mentioned in merge request nexedi/slapos.core!76 (merged)