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

Allow Covalent server to process workflows without requiring their deps #754

Merged
merged 116 commits into from
Jul 15, 2022

Conversation

cjao
Copy link
Contributor

@cjao cjao commented Jun 30, 2022

  • I have added the tests to cover my changes.
  • I have updated the documentation and CHANGELOG accordingly.
  • I have read the CONTRIBUTING document.

Closes #748 (design doc in the link).

cjao added 22 commits June 28, 2022 12:25
Use JSON-encodability to test if the object is a built-in type.
Same interface as `build_graph` except args and kwargs are
assumed to comprise of TransportableObjects.

TransportableObjects which encode fundamental types (determined by
JSON-encodability) are deserialized before invoking the workflow
function. It is assumed that only such arguments are used to determine
control flow in the workflow (e.g. `for i in range(iterations)` where
`iterations` is a lattice-level argument).
Also add `serialize_to_json()` method
Idempotent version of usual constructor:

`make_transportable(make_transportable(obj)) == make_transportable(obj)`
Precisely, "collection" == list or dict

Each item in the collection is assumed to be either a
`TransportableObject` or a collection, which we deserialize
recursively.
* Workflow inputs are encoded to `TransportableObjects`, and
`build_graph` is replaced by `build_graph_encoded`.

* Parameter type nodes are also encoded.

* Dispatcher passes encoded inputs directly to `executor.execute()`

* `wrapper_fn` decodes each arg and kwarg. Lists and dicts are
recursively decoded. After the main function is run, the output is
encoded before returning it to the dispatcher.

* Handle collection-type inputs to electrons by modifying
`to_electron_collection` to return a collection of decoded objects
List/dict structure is preserved.
Will be removed after _post_process starts running outside the
dispatcher process.
* Add new result statuses PENDING_POSTPROCESSING and
FAILED_POSTPROCESSING
* Default to "local" (dispatcher process) preprocessing executor for now.
Potentially useful if the server lacks the dependencies to
_post_process the workflow.

Supercedes previous `get_decoded_result()`
Workflows willbe postprocessed using that executor. The special value
"client" pauses the workflow before postprocessing. In this case, the
client can retrieve the result object and perform postprocessing
client-side using Result.post_process().
The same executor could be used for building sublattice graphs.
This gives one the option to postprocess client-side.
Store docstring in a attribute of TransportableObject to be accessed
without deserializing the object
@cjao
Copy link
Contributor Author

cjao commented Jun 30, 2022

Need to adjust some tests to expect encoded outputs.

cjao added 7 commits June 30, 2022 14:43
Record "__name__" attr when serializing an object
These are the keys in the executor_plugins_map
Classes covered:
* Deps
* DepsCall
* DepsBash
* LocalExecutor
* DaskExecutor

Preparation for making `TransportGraph` JSON-serializable
scottwn
scottwn previously approved these changes Jul 13, 2022
@scottwn scottwn enabled auto-merge (squash) July 13, 2022 14:16
scottwn
scottwn previously approved these changes Jul 14, 2022
scottwn
scottwn previously approved these changes Jul 14, 2022
@cjao
Copy link
Contributor Author

cjao commented Jul 14, 2022

Hi @mshkanth and @Prasy12 , could you review the changes to result_webhook.py when you get a chance?

Prasy12
Prasy12 previously approved these changes Jul 15, 2022
@cjao cjao dismissed stale reviews from Prasy12 and AlejandroEsquivel via 8dddb4d July 15, 2022 10:16
@cjao cjao requested review from Prasy12 and AlejandroEsquivel and removed request for AlejandroEsquivel July 15, 2022 11:33
@scottwn scottwn merged commit f06f84a into develop Jul 15, 2022
@scottwn scottwn deleted the encoded-workflow-processing-exp branch July 15, 2022 16:20
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.

Covalent dispatcher requires all of a workflow's package dependencies.
6 participants