-
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
✨ Is355/optimizer projects ports #3504
✨ Is355/optimizer projects ports #3504
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3504 +/- ##
========================================
+ Coverage 83.4% 83.6% +0.1%
========================================
Files 848 824 -24
Lines 35779 35376 -403
Branches 748 706 -42
========================================
- Hits 29862 29588 -274
+ Misses 5726 5603 -123
+ Partials 191 185 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
56604a1
to
fce73bc
Compare
55f5003
to
b90aacf
Compare
04c22dd
to
ac9ac96
Compare
# | ||
|
||
ARG PYTHON_VERSION="3.9.12" | ||
FROM python:${PYTHON_VERSION}-slim-buster as base |
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.
sometimes I wonder if the non-slim version without installing 10 tools is not better than the slim version + 10 tools in term of size and build time.
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.
yep. we could explore that. @mguidon showed me some tools we could use in the new HB registry. It might in addition help us decide more secure base images
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.
Great work!
👍 |
c5af8f6
to
1330a2a
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.
So if I get this correctly the purpose of the PR, is to allow you to read and write input ports and read output ports.
Could you please add that in the description or body. It is not obvious.
Some comments and questions below
packages/models-library/src/models_library/utils/services_io.py
Outdated
Show resolved
Hide resolved
services/web/server/src/simcore_service_webserver/projects/_ports.py
Outdated
Show resolved
Hide resolved
and node.key.startswith("simcore/services/frontend/parameter/") | ||
and node.outputs | ||
): | ||
# invariants |
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.
This is not that helpful
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.
I will add extra comments but i refer to a common programming term here: https://en.wikipedia.org/wiki/Invariant-based_programming
services/web/server/src/simcore_service_webserver/projects/_ports.py
Outdated
Show resolved
Hide resolved
services/web/server/src/simcore_service_webserver/projects/_ports.py
Outdated
Show resolved
Hide resolved
services/web/server/src/simcore_service_webserver/projects/_ports.py
Outdated
Show resolved
Hide resolved
services/web/server/src/simcore_service_webserver/projects/projects_ports_handlers.py
Outdated
Show resolved
Hide resolved
mock_catalog_service_api_responses: None, | ||
expected: type[web.HTTPException], | ||
): | ||
"""This tests implements a minimal workflow to support the MVP |
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.
MVP stands for?
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.
resp = await client.get(f"/v0/projects/{project_id}/outputs") | ||
project_outputs, error = await assert_status(resp, expected_cls=expected) | ||
|
||
if not error: |
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 would there be an error here? if this is expected in some cases, please provide it as an expectation parameter to the test. I think this allows to better detect issues.
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.
this is a technique we use a lot. The test parametrization adds a expected
value with a status code that might be error or not. In the latter case, we perform some extra checks e.g. on the response
the expectation you refer is already checked in assert_status( resp, expected_cls=expected)
. If expected
is a non-error, then that assert function will make sure that error is None
e7287f5
to
a737c33
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.
👍
40d0175
to
69ca14b
Compare
extra fix in requests_validation
69ca14b
to
bccd8cd
Compare
Kudos, SonarCloud Quality Gate passed!
|
What do these changes do?
The PR extend the concept of ports of a service to a project: a project can now have input/output ports. The inputs can be read and updated and the latter can be read using the web API. The input ports in a project are defined by parameter nodes and the project outputs by probe nodes.
Highlights
webserver
API updates toversion 0.10.0
GET/PATCH projects/{project_id}/inputs
andGET projects/{project_id}/outputs
: seeproject_ports_handlers.py
models-library
fastapi_encoder
service_io
(will be used incatalog
in coming PR)api/specs/webserver/scripts/openapi_projects_ports.py
helper scripts to produce OASRelated issue/s
How to test
For manual testing (with swagger) :
X
,on
andZ
Random sleep interval_2
,Random sleep interval
andArray probe
Array probe
is disconnectedprojects/{project_id}/inputs
, patchprojects/{project_id}/inputs
projects/{project_id}
projects/{project_id}/outputs
Checklist
make version-*
make openapi.json
cd packages/postgres-database
,make setup-commit
,sc-pg review -m "my changes"