OTA Update: partial execution
In it's current state, it is impossible to perform OTA upload without a fully compatible network, meaning that if one device is not compatible with uploaded handler or plugin, the entire process will not start.
There are two solutions in my mind:
- Extend the functionality and API to allow for OTA update of selected nodes
- This will require significant changes and additional logic: add
selectedNodes
, intersection of bonded (+ online) and selected nodes, remove incompatible nodes (compatibility logic already exists, but currently prevents the process in case of a single incompatible node), perform action and return objects with detailed information about each node (offline, incompatible), that information would then have to be used to specify nodes (online, compatible and successful operation result) to perform the next action in a following request (viaselectedNodes
). This is extremely unreliable, because while Webapp (UI) exists, we cannot prevent every single failure if the JSON API is used. (e.g. OtaUpload load code as the first one).
- Compound the OTA update steps into a single request that executes all three steps.
- I think this is a better approach, given that Daemon does not retain state of the update process between requests, it only makes sense that we would perform OTA update in one request. The idea is that we still extend the API and add
selectedNodes
, but we only use it for the initial selection of nodes. If no nodes are specified, we start with the entire network as a set and remove nodes in each stage (online nodes => compatible online nodes => verified compatible online nodes => result). In the response, we provide a report for each node and why the process failed for that particular device (it was offline, it is not compatible, verification failed, loading the code failed). If the request is sent with selected nodes, the subset logic will stay the same for the most part, but we also add "selected" qualifier.
Edited by Karel Hanák