Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[push] Add synchronized update strategy #182

Open
nemesifier opened this issue Apr 8, 2020 · 0 comments
Open

[push] Add synchronized update strategy #182

nemesifier opened this issue Apr 8, 2020 · 0 comments

Comments

@nemesifier
Copy link
Member

nemesifier commented Apr 8, 2020

We need a strategy that allows pushing updates that will be executed at a certain time in the future.

This would allow to push configurations that can break a network (eg: change the channel or routing deamon of a mesh network) in a relatively safe way, because the changes will be executed at the same time on all the devices, if anything goes wrong, openwisp-config will rollback the configuration to the previous state.

By default the reload of the configuration on the device should happen after 5 minutes from the change, we shall call this as the reload_config_datetime for the sake of explaining. This delay should be configurable.

The strategy shall be designed only for OpenWRT devices which have openwisp-config installed on board. It should consist of the following steps:

  • connect to the device
  • stop the openwisp-config deamon to avoid it from downloading and applying the configuration by itself
  • modify the openwisp-config daemon configuration in order to set the date of the upgrade, save the change, sleep for a number of seconds randomized between 0 and 30 (to avoid overloading the controller, the value of 30 should be configurable and default to 10% of the delay, hence 30 seconds), then start the deamon again
  • the deamon will then download the configuration but wait to apply it until the reload_config_datetime, once the configuration is applied we must add a way for the agent to resume working normally, maybe this configuration can be cleared out or another configuration key can be added, eg: reload_config_datetime_enabled which can be set to False

Related to openwisp/openwisp-config#104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant