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

Add option to clean remote folder when deleting nodes #6732

Open
superstar54 opened this issue Jan 27, 2025 · 8 comments · May be fixed by #6756
Open

Add option to clean remote folder when deleting nodes #6732

superstar54 opened this issue Jan 27, 2025 · 8 comments · May be fixed by #6756
Labels
type/feature request status undecided

Comments

@superstar54
Copy link
Member

I want to clean the remote folder when I delete a node. For the moment, I need to find all the call jobs that are called by this node, and clean the workdir, and then delete the node.

It would be useful to add an option to clean the remote folders when deleting the node.

e.g., verdi node delete --clear-workdir <pk>

@superstar54 superstar54 added the type/feature request status undecided label Jan 27, 2025
@khsrali
Copy link
Contributor

khsrali commented Jan 28, 2025

Somehow related: #4693
would be nice while providing this feature, one would also address that issue.

@Kaustbh
Copy link

Kaustbh commented Feb 11, 2025

Hi @superstar54 , I’m interested in solving this issue. Could you guide me on how to get started? For example, are there any specific steps I should follow, or resources I should review to better understand the context of this issue?

@superstar54
Copy link
Member Author

Hi @Kaustbh , thanks for the interest. You may need to wait for the maintainers to decide.

@khsrali
Copy link
Contributor

khsrali commented Feb 12, 2025

I'm already working on this issue, soon will open a PR on it.

@unkcpz
Copy link
Member

unkcpz commented Feb 15, 2025

I want to clean the remote folder when I delete a node. For the moment, I need to find all the call jobs that are called by this node

At the moment, in aiida-core, only WorkChain will be "called by this node". If it is only workgraph related, since it is not integrated to aiida-core, please leave the features there only at the moment.

In aiida-core, at the moment, only calcjob and workchain will have remote resource that need to cleaned so I think it makes no sense to add functionality to add --clean-remote-folder to all node type since there are tons of other node type that has no remote folder attached. Even if you decide to add this to aiida-core. will it make more sense to add to verdi process subcommand?

@superstar54
Copy link
Member Author

At the moment, in aiida-core, only WorkChain will be "called by this node". If it is only workgraph related, since it is not integrated to aiida-core, please leave the features there only at the moment.

Nothing special to WorkGraph. From a user's point of view, an option to clean the remote folder when deleting the node is very useful. Note when you delete a calcfunction node, it could also delete the associated WorkChain/CalcJob, thus the --clear-workdir can also be applied.

will it make more sense to add to verdi process subcommand?

Could you explain why it makes more sense to add to verdi process instead of verdi node?

@unkcpz
Copy link
Member

unkcpz commented Feb 19, 2025

Note when you delete a calcfunction node, it could also delete the associated WorkChain/CalcJob, thus the --clear-workdir can also be applied.

Where you see the calls of workchain and calcjob from a calcfunction?

I want to clean the remote folder when I delete a node. For the moment, I need to find all the call jobs that are called by this node, and clean the workdir, and then delete the node.

Besides WorkChain and WorkGraph, I really don't see any other cases you were mentioning. What is your real example? What is the node you were deleted?

From a user's point of view, an option to clean the remote folder when deleting the node is very useful.

The option exist, and that is verdi calcjob cleanworkdir. Now the option you asked is a batch operation of "search the decent calcjobs and then call verdi calcjob cleanworkdir". I against it because it has strong side effect.

Could you explain why it makes more sense to add to verdi process instead of verdi node?

Because only "processes" will have remote workdir attached.

@unkcpz
Copy link
Member

unkcpz commented Feb 19, 2025

I may have a better solution. From my comment above: "Now the option you asked is a batch operation of "search the descendants calcjobs and then call verdi calcjob cleanworkdir". "

It can actually provide a command that do "search the decent calcjobs" and we find a way to pipe the verdi commands. Then you can do batch operations using the stdout from previous command.

Worst case, have two command separately implemented and having a command using click to call them in sequence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature request status undecided
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants