[feature] Wire persistent-mass-upgrade Beat tasks into ansible-openwisp2 #621#623
Conversation
…ders into the Beat schedule #621 Added the two new firmware-upgrader Beat entries to CELERY_BEAT_SCHEDULE in templates/openwisp2/settings.py, gated on openwisp2_firmware_upgrader and a new openwisp2_firmware_upgrader_periodic_tasks toggle mirroring the existing monitoring/radius/metric_collection gating. Cadences come from two new ansible variables (default 10 minutes and 7 days) so operators can tune from inventory. Uses timedelta() because these are scan workloads, not fixed-clock cron jobs. Documented the three new variables in docs/user/role-variables.rst next to the existing *_periodic_tasks rows. Related to #621
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR wires the new persistent-mass-upgrade Celery Beat tasks from openwisp-firmware-upgrader into the ansible-openwisp2 role, adding role variables to control the scan cadences and to allow disabling the firmware-upgrader Beat entries.
Changes:
- Adds two new firmware-upgrader entries to
CELERY_BEAT_SCHEDULE, gated byopenwisp2_firmware_upgraderandopenwisp2_firmware_upgrader_periodic_tasks. - Introduces new default variables for enabling/disabling the firmware-upgrader periodic tasks and configuring their scan intervals (minutes/days), and documents them.
- Updates the default
openwisp2_firmware_upgrader_versionpin (currently to a feature branch tarball).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
templates/openwisp2/settings.py |
Adds two new Celery Beat schedule entries for persistent upgrade retry/reminder scans, gated by role flags. |
docs/user/role-variables.rst |
Documents the new firmware-upgrader periodic-task variables alongside other periodic-task flags. |
defaults/main.yml |
Adds defaults for the new cadence variables and the periodic-task toggle; also changes the firmware-upgrader version pin. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| openwisp2_controller_version: "openwisp-controller @ https://github.com/openwisp/openwisp-controller/tarball/master" | ||
| openwisp2_network_topology_version: "openwisp-network-topology @ https://github.com/openwisp/openwisp-network-topology/tarball/master" | ||
| openwisp2_firmware_upgrader_version: "openwisp-firmware-upgrader @ https://github.com/openwisp/openwisp-firmware-upgrader/tarball/master" | ||
| openwisp2_firmware_upgrader_version: "openwisp-firmware-upgrader @ https://github.com/openwisp/openwisp-firmware-upgrader/tarball/gsoc26-persistent-scheduled-upgrades" |
0dfd790 to
eee0260
Compare
…e converge — revert before merge Molecule installs the master tarball by default, which does not yet ship the new Beat tasks. Overriding only in the test inventory keeps the production default in defaults/main.yml clean. Points at the openwisp-firmware-upgrader branch issues/417-persistence-schema-fields (the PR #436 head). Revert this override before this branch merges to master, once PR #436 has merged and a release is cut. Related to #621
eee0260 to
0f5fe44
Compare
Checklist
Reference to Existing Issue
Closes #621.
Related to openwisp/openwisp-firmware-upgrader#379 (parent — Persistent Mass Upgrades) and openwisp/openwisp-firmware-upgrader#436 (upstream implementation).
Description of Changes
Once openwisp-firmware-upgrader ships the persistent-mass-upgrades feature, an ansible-deployed install still won't fire its retry loop or its reminder notifications. The
CELERY_BEAT_SCHEDULE = { … }block intemplates/openwisp2/settings.pyhas Jinja gates for users, notifications, monitoring, radius and metrics but no firmware-upgrader entry. Operators would deploy the new release and quietly get none of the new behaviour.This PR adds the missing entries.
run_checks(the closest precedent, also a periodic scan). The gate isopenwisp2_firmware_upgrader and openwisp2_firmware_upgrader_periodic_tasks, mirroring how monitoring/radius/metric_collection wire their Beat entries, so disabling firmware-upgrader at the role level hides the schedule too.openwisp2_firmware_upgrader_periodic_tasks(default true),openwisp2_firmware_upgrader_check_pending_period_minutes(default 10, the retry-scan period),openwisp2_firmware_upgrader_reminder_scan_period_days(default 7, how often the reminder task looks at long-running batches). The per-batch reminder cadence stays controlled upstream byOPENWISP_FIRMWARE_UPGRADER_PERSISTENT_REMINDER_PERIOD, default 60 days.timedelta(...)is used rather thancrontab(...)— matchesrun_checks. Nocron_*string is needed invars/main.yml.docs/user/role-variables.rstnext to the existing*_periodic_tasksrows. The tracking issue suggestsREADME.md, but the repo's per-variable reference actually lives in role-variables.rst —README.mdis 20 lines and has no variable table. Happy to also add a README mention if reviewers prefer.The second commit (
[chores] TEMPORARY pin firmware-upgrader to gsoc26 branch in molecule converge) adds anopenwisp2_firmware_upgrader_versionoverride inmolecule/resources/converge.ymlonly, so Molecule installs a version that actually ships the new tasks.defaults/main.ymlstays untouched. Must be reverted before this branch merges to master.