openwisp / openwisp/openwisp-controller

[push] Add synchronized update strategy

Open
#182 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
773
Forks
315
Avg merge
2d 16h
Merged PRs (30d)
14

Description

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 https://github.com/openwisp/openwisp-config/issues/104

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the push strategy entry point and the related openwisp-config issue 104, then trace how the daemon is stopped, scheduled, and restarted on OpenWRT devices. Done means supporting a configurable delayed reload, randomized delay, synchronized application, rollback behavior, and a way for the agent to resume normal operation.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
backend, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.