-
Notifications
You must be signed in to change notification settings - Fork 200
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 the retrieve_temporary_list member to the CalcInfo datastructure #892
Add the retrieve_temporary_list member to the CalcInfo datastructure #892
Conversation
For some calculation one wants to retrieve certain files for parsing but does not want to store them permanently in the repository because for example they may take up a lot of space. To facilitate for this use case we introduce the concept of the retrieve_temporary_list member in the CalcInfo datastructure. Implementations of a Calculation can opt to provide a list of directives, identical to that of the original retrieve_list member, that will instruct the exectution manager to retrieve those files to a local folder for parsing. The difference is that the files listed in the retrieve_temporary_list member will be stored in a FolderData node that will not be stored in the database and which will only be alive for the duration of the parsing. After parsing is completed the retrieved files are garbage collected.
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.
Minor fixes
aiida/common/datastructures.py
Outdated
# ['remotepath','localpath',depth] ] | ||
'retrieve_temporary_list', # a list of files or patters to retrieve that will only be kept during parsing and will be deleted after parsing is completed | ||
# possible formats: ['remotepath', # just the name of the file to retrieve. Will be put in '.' of the repository with name os.path.split(item)[1] | ||
# ['remotepath','localpath', depth]] | ||
# second format will copy the remotepath file/folder to localpath. |
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.
This comment belongs still to 'retrieve_list', whose description is not 'cut'
aiida/daemon/execmanager.py
Outdated
@@ -806,6 +771,7 @@ def retrieve_computed_for_authinfo(authinfo): | |||
calc.pk, retrieved_files.dbnode.pk), | |||
extra=logger_extra) | |||
retrieved_files.store() | |||
|
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.
Add a comment that we are not storing the _temp files
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.
Thanks, fine for me. I'll approve this and let you merge or decide to put an explicit clear of the SandboxFolder for the temporary FolderData
Also deleted the link that was added to the retrieved_temporary_folder which was a left over from testing phase. Since the FolderData is never going to be stored, it also shouldn't have any links
The parser will not do anything, but if the 'retrieve_temporary_files' key was set in the 'template' input node, then it is expected that those files will be temporarily stored in an unstored FolderData node which should be passed in the 'retrieved' argument of the parse_with_retrieved call of the Parser class. In that case, the arguments are checked for the presence of the unstored FolderData node
634e4ba
to
bc6bdcf
Compare
The daemon integration test leverages the TemplatereplacerCalculation to launch some trivial calculations. We add the output filepath to the 'retrieve_temporary_files' entry of the template dictionary which will cause the TemplatereplacerParser class to check for an unstored FolderData node containing those files, which should be passed to the parse_with_retrieved function called by the execmanager
bc6bdcf
to
1ea8548
Compare
I have added a |
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.
Great job!
Also enhance the parser by explicitly verifying that all the files that are listed in the 'template' input node in the retrieve_temp_list key are present in the temporary folder
8f7e1d5
to
fad81b4
Compare
This means that the parsing of the output file can be moved from the daemon test to the actual parser itself
fad81b4
to
53c3479
Compare
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.
With the most recent modifications, that actually test the content of the temporarily retrieved files, it's ready to be merged
Fixes #886