-
Notifications
You must be signed in to change notification settings - Fork 8
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 use of zstd compression on compute services #336
Conversation
- Update env files to include zstandard - Update set_task_result in compute api and client to handle base64 encoded data. Rather than JSON serialize the ProtocolDAGResult (PDR) and use this is a the intermediate format, instead: 1) create a keyed chain representation of the PDR 2) JSON serialize this representation 3) compress the utf-8 encoded bytes with zstandard 4) encode with base64 - Use the above base64 encoded data as the intermediate format and reverse the operations above to recover the PDR.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #336 +/- ##
==========================================
+ Coverage 80.35% 80.49% +0.14%
==========================================
Files 26 27 +1
Lines 3711 3743 +32
==========================================
+ Hits 2982 3013 +31
- Misses 729 730 +1 ☔ View full report in Codecov by Sentry. |
Use more bytes Move compression and decompression functions to new module Use latin-1 decoded bytes
If a decompression error is raised, assume that the original data was never compressed.
4541b72
to
cce6e8d
Compare
Test getting extends ProtocolDAGResults as if they were stored through the old pdr.to_dict() -> json -> utf-8 encoded format. The new test can be removed in the next major release that drops the old format.
cce6e8d
to
b32f62d
Compare
To allow for better and clearer testing of result pushing and pulling, the act of executing a task and pushing its results were separated.
Code coverage was artificially low due to run test run order. A reset and reinitialization of the s3os_server shows the correct results.
It's more robust to paramterize the old tests to use the legacy kwarg for pushing results rather than writing a new test that covers less of the codebase.
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.
Looks fantastic @ianmkenney! Thanks for adding elegant compression-at-rest for ProtocolDAGResult
objects!
@ianmkenney I made some changes as we discussed. If you agree with these changes and tests are passing, feel free to merge! |
This PR closes #220. It modifies the behavior of set_task_results in the compute client and api to use compressed keyed chain representations of ProtocolDAGResults instead of simple JSON serialization as the intermediate format.