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 retrieve temporary list to CalcInfo datastructure #903

Merged

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Nov 9, 2017

This was already merged into develop with PR's #892 and #894 but we are backporting it in the release

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.
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
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
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
This means that the parsing of the output file can be moved from
the daemon test to the actual parser itself
If no files were specified in the 'retrieve_temporary_list' of the
calculations CalcInfo, we should not pass an empty FolderData to
the parse_from_calc call of the Parser. Otherwise the parse_with_retrieved
call will always get a retrieved_temporary_folder, even if it is
empty. By setting retrieved_temporary_folder to None, unless some
files have been specified in the retrieve_temporary_list member
we maintain the original behavior of the execmanager calling the
parser
@giovannipizzi
Copy link
Member

I approved, note however that there is at least a file that needs to get the headers updated.

@sphuber
Copy link
Contributor Author

sphuber commented Nov 9, 2017

I will do the headers when I will release the final version, along with contributors, version number etcetera

@sphuber sphuber merged commit 318a6e5 into aiidateam:release_v0.10.0rc3 Nov 9, 2017
@sphuber sphuber deleted the fix_886_retrieve_temporary_list branch November 9, 2017 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants