-
Notifications
You must be signed in to change notification settings - Fork 24
Backup action changes for UX improvements #1069
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR improves Backup/Restore UX by adding cleanup behavior on termination, introducing an action to import backup destinations from a cluster backup payload, and enriching defaults returned to the UI.
Changes:
- Add SIGTERM-triggered cleanup tasks support to agent task runner and use it to auto-remove half-restored modules.
- Introduce
import-backup-destinationsaction plus JSON schemas for validating its input/output. - Extend
get-defaultsoutput withhas_additional_disksand reuse shared helpers for hostname/volumes.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| core/imageroot/var/lib/nethserver/cluster/actions/restore-module/50restore_module | Registers a SIGTERM cleanup task for restore-module and changes failure exit behavior. |
| core/imageroot/var/lib/nethserver/cluster/actions/import-backup-destinations/10import_backup_destinations | New Python action to decrypt/decompress backup payload and import destinations into Redis. |
| core/imageroot/var/lib/nethserver/cluster/actions/import-backup-destinations/validate-input.json | Adds input JSON schema for the new import action. |
| core/imageroot/var/lib/nethserver/cluster/actions/import-backup-destinations/validate-output.json | Adds output JSON schema for the new import action. |
| core/imageroot/var/lib/nethserver/cluster/actions/get-defaults/50read | Computes has_additional_disks and uses shared hostname helper. |
| core/imageroot/var/lib/nethserver/cluster/actions/get-defaults/validate-input.json | Changes input schema for get-defaults. |
| core/imageroot/var/lib/nethserver/cluster/actions/get-defaults/validate-output.json | Adds has_additional_disks to get-defaults output schema. |
| core/imageroot/usr/local/agent/pypkg/agent/tasks/run.py | Adds on_sigterm_tasks support and refactors progress/extra handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...t/var/lib/nethserver/cluster/actions/import-backup-destinations/10import_backup_destinations
Outdated
Show resolved
Hide resolved
...imageroot/var/lib/nethserver/cluster/actions/import-backup-destinations/validate-output.json
Outdated
Show resolved
Hide resolved
.../imageroot/var/lib/nethserver/cluster/actions/import-backup-destinations/validate-input.json
Outdated
Show resolved
Hide resolved
core/imageroot/var/lib/nethserver/cluster/actions/get-defaults/validate-input.json
Show resolved
Hide resolved
core/imageroot/var/lib/nethserver/cluster/actions/get-defaults/validate-output.json
Outdated
Show resolved
Hide resolved
...t/var/lib/nethserver/cluster/actions/import-backup-destinations/10import_backup_destinations
Show resolved
Hide resolved
core/imageroot/var/lib/nethserver/cluster/actions/restore-module/50restore_module
Show resolved
Hide resolved
Return a new boolean attribute "has_additional_disks" describing the NS8 node storage. This boolean guides the user through the correct cluster disaster recovery procedure path. If an additional disk exists, the procedure must direct the user to the Backup page.
If restore-module action is canceled by user, run a cleanup task that removes the restored instance from the cluster. Introduce on_sigterm_tasks optional array for agent.tasks.run/runp: it registers additional tasks that are submitted in nowait mode when the process receives SIGTERM, without overriding the internal cancel-task behavior. Sanitize kwargs variable in _runp(), pop()ing unexpected arguments to sub-functions.
Import backup destinations from a cluster backup encrypted file. This new action expects a file generated by download-cluster-backup as input and the password to decrypt it. During import, existing backup destinations are skipped. Configurations are not validated, they are assumed to be correct. For this reason, interal cluster destinations are ignored if the cluster backup was generated by another cluster (cluster UUIDs are compared for this purpose).
bcb9f35 to
ae4bedc
Compare
This PR addresses multiple enhancements for the Backup/Restore UX.
See individual commit for details.
Refs
see mattermost discussion: https://mattermost.nethesis.it/nethesis/pl/p8uu8moi47rbxcmg58ersjcywc