-
Notifications
You must be signed in to change notification settings - Fork 26
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
✨adds cli command to monitor study status #3401
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3401 +/- ##
========================================
+ Coverage 81.9% 83.0% +1.1%
========================================
Files 738 818 +80
Lines 31319 34680 +3361
Branches 848 1363 +515
========================================
+ Hits 25673 28811 +3138
- Misses 5497 5688 +191
- Partials 149 181 +32
Flags with carried forward coverage won't be shown. Click here to find out 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.
supercool, thanks a lot!
services/director-v2/src/simcore_service_director_v2/cli/__init__.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.
some minors
services/director-v2/src/simcore_service_director_v2/cli/core.py
Outdated
Show resolved
Hide resolved
services/director-v2/src/simcore_service_director_v2/cli/core.py
Outdated
Show resolved
Hide resolved
services/director-v2/src/simcore_service_director_v2/cli/core.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.
Great, thanks for the very nice CLI. Please have a look at the comments
services/director-v2/src/simcore_service_director_v2/cli/core.py
Outdated
Show resolved
Hide resolved
services/director-v2/src/simcore_service_director_v2/cli/core.py
Outdated
Show resolved
Hide resolved
nodes_failed_to_save: list[NodeIDStr] = [] | ||
for node_uuid, node_content in project_at_db.workbench.items(): | ||
# onl dynamic-sidecars are used | ||
if not await requires_dynamic_sidecar( |
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.
Q: do we have studies with legacy services? if yes what of them?
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.
Yes we still have some of there here and there. They are being deprecated at the moment, so I expect them to be rolled out.
async with _initialized_app() as app: | ||
dynamic_sidecar_client = api_client.get_dynamic_sidecar_client(app) | ||
await _save_node_state( | ||
app, dynamic_sidecar_client, retry_save, NodeIDStr(f"{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.
Q: no way to get the node label beforehand?
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.
No not in this case, I do not want you to provide the project_id just to fetch a label here. It is not worth the effort.
services/director-v2/src/simcore_service_director_v2/cli/core.py
Outdated
Show resolved
Hide resolved
services/director-v2/src/simcore_service_director_v2/cli/core.py
Outdated
Show resolved
Hide resolved
) -> Optional[DynamicServiceOut]: | ||
try: | ||
result = await client.get( | ||
f"http://localhost:8000/v2/dynamic_services/{node_uuid}", # NOSONAR |
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.
Q: why is this calling itself via the REST API? why not use directly the fct?
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.
It is a different process. For convenience you are just launching it from the same container. This CLI command only had the database connection configured nothing else.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
What do these changes do?
Monitoring the status of very large projects (20+ dynamic services) is very hard and current tooling is not sufficient.
These changes add a
cli option
added todirector-v2
to observe the status ofdynamic services
in a project, as seen by the backend.How to use
From inside
director-v2
runsimcore-service-director-v2 project-state PROJECT_ID
and a self updatingtable showing the status of all services will be shown. See below for more details:
$ simcore-service-director-v2 project-state --help Usage: simcore-service-director-v2 project-state [OPTIONS] PROJECT_ID Displays the state of the nodes in the project. Arguments: PROJECT_ID [required] Options: --blocking / --no-blocking [default: blocking] --update-interval INTEGER [default: 5] --help Show this message and exit.
--blocking
mode is enabled, the cli will not return and display a self updating window, with--no-blocking
it returns immediately--update-interval
is te rate at which the services status is queriedRelated issue/s
How to test
Checklist