-
Notifications
You must be signed in to change notification settings - Fork 29
Nodeports/add file checksum #2011
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
Nodeports/add file checksum #2011
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2011 +/- ##
========================================
+ Coverage 72.6% 73.4% +0.7%
========================================
Files 405 413 +8
Lines 14846 15097 +251
Branches 1503 1526 +23
========================================
+ Hits 10785 11084 +299
+ Misses 3664 3620 -44
+ Partials 397 393 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
ad26f5b
to
eeb26d0
Compare
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.
Generally very nice work in v2!! Added some requests for your consideration.
Regarding your note in the description: Should add some
warnings.warn(
category=DeprecationWarning,
)
in simcore_skd to avoid
@@ -151,7 +161,7 @@ class ServiceProperty(BaseModel): | |||
description="Place the data associated with the named keys in files", | |||
examples=[{"dir/input1.txt": "key_1", "dir33/input2.txt": "key2"}], | |||
) | |||
default_value: Optional[Union[str, float, bool, int]] = Field( | |||
default_value: Optional[Union[StrictBool, StrictInt, StrictFloat, str]] = Field( | |||
None, alias="defaultValue", examples=["Dog", True] |
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.
So with the stricts you ensure that "3" or "True" -> str
but 3 -> int
and True -> bool
??
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.
so first:
very important is to use the ordering in the Union: go for most restricted values to less restricted (e.g. bool -> int -> float -> str).
Then the strict means that 0 is not False (which could be an issue in some cases but not here yet), also 3 is an int but 3.0 isn't.
packages/pytest-simcore/src/pytest_simcore/services_api_mocks_for_aiohttp_clients.py
Outdated
Show resolved
Hide resolved
await file_pointer.write(chunk) | ||
file_size = int(response.headers.get("content-length", 0)) or None | ||
|
||
with tqdm( |
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.
very nice! I find it very fancy for consoles but how good is to send log info between machines?
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 sure I get what you mean?
|
||
file_path = data_items_utils.create_file_path(key, file_name) | ||
if value == file_path: | ||
# this can happen in case |
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.
in case ... what? :-)
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.
good catch. that was a copy paste from node_ports_v1.. which I will correct as well.
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.
ok so I cannot change in the node_ports_v1 cause that is the very file that makes black hook fail with error 123... and I don't know how to make black skip it but by changing the pre-commit-config.yml file.
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.
Actually my comments before are not so critical as to request changes. They do not actually need re-review.
af65f98
to
8743ae8
Compare
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.
Very nice job.
I have expressed some concerns regarding network errors (which can happen for different reasons like: timeouts, errors during file upload and download etc...)
Please try to figure out if they are valid and might have an impact and if it is possible to handle them gracefully to avoid future errors or bugs.
chunk = await response.content.read(CHUNK_SIZE) | ||
while chunk: | ||
await file_pointer.write(chunk) | ||
file_size = int(response.headers.get("content-length", 0)) or None |
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.
basically only when content-length==0
because when undefined(missing) is always 0. I would just remove the or None
part.
packages/simcore-sdk/src/simcore_sdk/node_ports_v2/nodeports_v2.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.
👍 Thank you!
288798b
to
cfd5817
Compare
fixing small issues
cfd5817
to
898c9c5
Compare
What do these changes do?
This PR will add the S3 ETag in the payload of project/comp_tasks such that:
Nodeports package v2
NOTE: nodeports v1 is deprecated, stop using it!
if a file with the same name is uploaded, the ETag will change, triggering a new download
should allow the ControlCore use case with any dynamic service
NOTE: download is not yet prevented if the ETag is the same. this will come later.
Bonus:
Related issue number
refering to PR #1999
How to test
Checklist
make openapi-specs
,git commit ...
and thenmake version-*
)