-
Notifications
You must be signed in to change notification settings - Fork 32
🎨Computational backend: Fail fast in case of malformed input syntax and improve unzipping #7804
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
🎨Computational backend: Fail fast in case of malformed input syntax and improve unzipping #7804
Conversation
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.
Pull Request Overview
This PR enhances the robustness of the dask-sidecar by introducing a fast fail when a file-to-key mapping is used with zip data and by improving the unzipping process using a temporary directory. Key changes include:
- Adding a new error (ServiceInputsUseFileToKeyMapButReceivesZipDataError) to trigger a fail in case of mismatched file mapping and zip input.
- Enhancing the unzipping process with a dedicated function (check_need_unzipping) and temporary directory usage.
- Adjusting log levels and updating test fixtures to cover these scenarios.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| services/dask-sidecar/tests/unit/test_computational_sidecar_tasks.py | Updated tests and fixtures to validate the new error behavior with file-to-key mapping and zip input data. |
| services/dask-sidecar/src/simcore_service_dask_sidecar/utils/files.py | Introduced check_need_unzipping and adjusted the extraction logic using a temporary directory. |
| services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/task_shared_volume.py | Modified log level from debug to info when creating the input folder. |
| services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/core.py | Added logic to raise the new error when a file mapping is present along with zip data that needs extraction. |
| packages/dask-task-models-library/src/dask_task_models_library/container_tasks/errors.py | Defined a new error class for the file-to-key mapping and zip data mismatch scenario. |
services/dask-sidecar/src/simcore_service_dask_sidecar/utils/files.py
Outdated
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7804 +/- ##
==========================================
+ Coverage 86.73% 88.05% +1.31%
==========================================
Files 1850 1269 -581
Lines 71875 54189 -17686
Branches 1215 189 -1026
==========================================
- Hits 62338 47714 -14624
+ Misses 9196 6416 -2780
+ Partials 341 59 -282
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/core.py
Outdated
Show resolved
Hide resolved
matusdrobuliak66
left a comment
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.
👍
1951113 to
f2da9ef
Compare
|
@mergify queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at dc35a5e |
odeimaiz
left a comment
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
|



What do these changes do?
As part of the issues found by @wvangeit where a service would define file_to_key mapping for input and pass in a zip file.

Having a service input port defining a
file_to_keymapping and at the same time passing azipfile at runtime produces confusing results:values.json)values.jsonfile which overrides the originalvalues.jsonzip filevalues.jsonfile--> the jsonifier service would actually run with an empty input data and will not complain as it can run with no inputs.
This PR improves the dask-sidecar to raise an exception if it detects:
application/zipOn the other hand the unzipping process is enhanced by:
Related issue/s
How to test
Dev-ops