-
Notifications
You must be signed in to change notification settings - Fork 27
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
🐛 unarchiving_utils are now based on 7zip cli #6959
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6959 +/- ##
==========================================
- Coverage 87.02% 86.84% -0.18%
==========================================
Files 1621 1286 -335
Lines 63993 54997 -8996
Branches 2035 1161 -874
==========================================
- Hits 55687 47764 -7923
+ Misses 7972 7021 -951
+ Partials 334 212 -122
Continue to review full report in Codecov by Sentry.
|
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.
👍
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.
What is the idea behing this change?
Also I was wondering:
- the dask-sidecar checks the input file mime type. if it is set to zip, then it does not uncompress
services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/nodeports.py
Outdated
Show resolved
Hide resolved
services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/nodeports.py
Outdated
Show resolved
Hide resolved
services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/nodeports.py
Outdated
Show resolved
Hide resolved
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.
Please read my additional comments. I don't undersatnd how you wanna present this error to the user.
services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/nodeports.py
Outdated
Show resolved
Hide resolved
services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/nodeports.py
Outdated
Show resolved
Hide resolved
services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/nodeports.py
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
@giancarloromeo @matusdrobuliak66 @sanderegg |
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, but please let's look at some of the comments. we can have a quick chat.
@@ -0,0 +1,4 @@ | |||
class ArchiveError(Exception): |
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.
not using OsparcMixinError??
packages/service-library/src/servicelib/archiving_utils/_interface_7zip.py
Show resolved
Hide resolved
packages/service-library/src/servicelib/archiving_utils/_interface_7zip.py
Show resolved
Hide resolved
packages/service-library/src/servicelib/archiving_utils/_interface_7zip.py
Show resolved
Hide resolved
class ArchiveInfoParser: | ||
def __init__(self) -> None: | ||
self.total_bytes: NonNegativeInt | None = None | ||
self.file_count: NonNegativeInt | None = None | ||
|
||
async def parse_chunk(self, chunk: str) -> None: | ||
# search for ` NUMBER bytes ` -> set byte size | ||
if self.total_bytes is None and (match := re.search(_TOTAL_BYTES_RE, chunk)): | ||
self.total_bytes = int(match.group(1)) | ||
|
||
# search for ` NUMBER files` -> set file count | ||
if self.file_count is None and (match := re.search(_FILE_COUNT_RE, chunk)): | ||
self.file_count = int(match.group(1)) | ||
|
||
def get_parsed_values(self) -> tuple[NonNegativeInt, NonNegativeInt]: | ||
if self.total_bytes is None: | ||
msg = f"Unexpected value for {self.total_bytes=}. Should not be None" | ||
raise ArchiveError(msg) | ||
|
||
if self.file_count is None: | ||
msg = f"Unexpected value for {self.file_count=}. Should not be None" | ||
raise ArchiveError(msg) | ||
|
||
return (self.total_bytes, self.file_count) | ||
|
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.
you use pydantic types in a non pydantic class.
Why not use at a dataclass? or pydantic at this point.
@@ -187,7 +187,7 @@ h11==0.14.0 | |||
# uvicorn | |||
httpcore==1.0.7 | |||
# via httpx | |||
httpx==0.28.0 | |||
httpx==0.28.1 |
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.
why is httpx updated here?
@@ -93,7 +93,7 @@ httpcore==1.0.7 | |||
# via | |||
# -c requirements/_base.txt | |||
# httpx | |||
httpx==0.28.0 | |||
httpx==0.28.1 |
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.
why is httpx updated here?
@@ -112,7 +112,7 @@ httpcore==1.0.7 | |||
# via | |||
# -c requirements/_base.txt | |||
# httpx | |||
httpx==0.28.0 | |||
httpx==0.28.1 |
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.
?
@@ -328,11 +328,11 @@ opentelemetry-instrumentation-fastapi==0.49b2 | |||
# via -r requirements/../../../packages/service-library/requirements/_fastapi.in | |||
opentelemetry-instrumentation-httpx==0.49b2 | |||
# via -r requirements/../../../packages/service-library/requirements/_fastapi.in | |||
opentelemetry-instrumentation-logging==0.48b0 | |||
opentelemetry-instrumentation-logging==0.49b2 |
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.
there are a few updates I don't quite get why they come here. are you sure about these?
start_time = time.perf_counter() | ||
|
||
settings: ApplicationSettings = get_settings() | ||
PORTS: Nodeports = await node_ports_v2.ports( | ||
user_id=settings.DY_SIDECAR_USER_ID, | ||
project_id=ProjectIDStr(settings.DY_SIDECAR_PROJECT_ID), | ||
node_uuid=NodeIDStr(settings.DY_SIDECAR_NODE_ID), | ||
node_uuid=TypeAdapter(NodeIDStr).validate_python(settings.DY_SIDECAR_NODE_ID), |
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.
NodeIDStr is just a string. not sure you need to use the typeadapter here.
What do these changes do?
When a new style dynamic service has to fetch an input port containing a zip archive, it will try to unzip it.
If it's not able to open it (see issue here), the service would fail to start.
Important changes:
drop-in
implementation using7zip
cli for archiving and unarchiving7zip
alo addresses Deflate64 zip-files not supported by dynamic-sidecar powered services #2843Related issue/s
How to test
Dev-ops checklist