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

Serialize the context of a WorkChain before persisting #1354

Merged

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Mar 29, 2018

Fixes #1353 and fixes #1291 by extension

This was the underlying issue that was causing the aiida-quantumespresso workflows to fail with SqlAlchemy on develop. The fact that it worked on Django was a lucky coincidence.

The user is free to populate the context with Node instances, which
means that if the WorkChain needs to be persisted that the nodes
need to be serialized. Since the nodes are not necessarily stored
upon calling save_instance_state, we also store them if they were
not yet stored. We also use this opportunity to replace the ad hoc
serialization in the pickle persister and use the new more complete
serializer and deserializer.

  • Add new plumpy release as dependency (awaiting release)

The user is free to populate the context with Node instances, which
means that if the WorkChain needs to be persisted that the nodes
need to be serialized. Since the nodes are not necessarily stored
upon calling save_instance_state, we also store them if they were
not yet stored. We also use this opportunity to replace the ad hoc
serialization in the pickle persister and use the new more complete
serializer and deserializer.
This release of plumpy fixes an issue where the inputs of a process
are recreated each time when loaded from a persisted state, meaning
that inputs that were not explicitly specified but taken from the
spec's default will be recreated. For default nodes in aiida-core
this means that the nodes are duplicated multiple times
@sphuber sphuber changed the title [WIP] Serialize the context of a WorkChain before persisting Serialize the context of a WorkChain before persisting Mar 29, 2018
@muhrin muhrin merged commit 4998141 into aiidateam:develop Mar 29, 2018
@muhrin muhrin deleted the fix_1353_serialize_workchain_context branch March 29, 2018 16:15
@sphuber sphuber restored the fix_1353_serialize_workchain_context branch March 29, 2018 16:16
@sphuber sphuber deleted the fix_1353_serialize_workchain_context branch March 29, 2018 16:16
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.

Nodes in the context are not serialized
2 participants