Description
In AiiDA v2.6+ (after PR #6756), verdi node delete includes a --clean-workdir option to clean remote working directories before deleting nodes.
The same functionality is currently missing from verdi group delete --delete-nodes.
Current behavior
When deleting a group with --delete-nodes, the nodes are removed from the database, but their associated remote working directories are not cleaned up. This can leave behind unused data on the remote system.
Expected behavior
It would be useful if verdi group delete supported a --clean-workdir flag, similar to verdi node delete, so that remote directories can be cleaned as part of the deletion process.
Implementation idea
group_delete in
src/aiida/cmdline/commands/cmd_group.py
doesn’t include the clean_mapping_remote_paths logic that exists in cmd_node.py
Approach I thought of:
Collect relevant CalcJobNode instances (optionally including descendants if needed)
Call aiida.orm.utils.remote.clean_mapping_remote_paths before deleting nodes
This would bring consistency between node-level and group-level deletion and help avoid leftover remote data.
Description
In AiiDA v2.6+ (after PR #6756), verdi node delete includes a --clean-workdir option to clean remote working directories before deleting nodes.
The same functionality is currently missing from verdi group delete --delete-nodes.
Current behavior
When deleting a group with --delete-nodes, the nodes are removed from the database, but their associated remote working directories are not cleaned up. This can leave behind unused data on the remote system.
Expected behavior
It would be useful if verdi group delete supported a --clean-workdir flag, similar to verdi node delete, so that remote directories can be cleaned as part of the deletion process.
Implementation idea
group_delete in
src/aiida/cmdline/commands/cmd_group.py
doesn’t include the clean_mapping_remote_paths logic that exists in cmd_node.py
Approach I thought of:
Collect relevant CalcJobNode instances (optionally including descendants if needed)
Call aiida.orm.utils.remote.clean_mapping_remote_paths before deleting nodes
This would bring consistency between node-level and group-level deletion and help avoid leftover remote data.