Skip to content
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

✨ dynamic-services will fail if they have any required input that is not set #5845

Merged

Conversation

GitHK
Copy link
Contributor

@GitHK GitHK commented May 17, 2024

What do these changes do?

Changes

  • starting a dynamic-service which has required inputs that are not satisfied (file is missing or link is not present) will display a warning message to the user advising them on what to do.
  • if a project is open and an auto started service has required inputs that are not satisfied, this service will not start. If the user presses on it to start a message will be displayed hinting at the problem.

Users warning messages

Case 1 (input link to port is missing)

Screenshot 2024-05-29 at 15 16 00

Case 2 (file in input port not present)

Screenshot 2024-05-29 at 15 17 06

Related issue/s

How to test

Dev-ops checklist

@GitHK GitHK self-assigned this May 17, 2024
@GitHK GitHK added the a:webserver issue related to the webserver service label May 17, 2024
@GitHK GitHK added this to the Leeroy Jenkins milestone May 17, 2024
Copy link

codecov bot commented May 17, 2024

Codecov Report

Attention: Patch coverage is 46.29630% with 29 lines in your changes are missing coverage. Please review.

Project coverage is 70.2%. Comparing base (cafbf96) to head (b77c261).
Report is 247 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #5845      +/-   ##
=========================================
- Coverage    84.5%   70.2%   -14.4%     
=========================================
  Files          10     553     +543     
  Lines         214   27997   +27783     
  Branches       25     205     +180     
=========================================
+ Hits          181   19656   +19475     
- Misses         23    8290    +8267     
- Partials       10      51      +41     
Flag Coverage Δ
integrationtests 60.3% <22.2%> (?)
unittests 74.2% <46.2%> (-10.4%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...core_service_webserver/projects/_nodes_handlers.py 91.0% <50.0%> (ø)
...c/simcore_service_webserver/projects/exceptions.py 88.7% <60.0%> (ø)
...simcore_service_webserver/projects/projects_api.py 80.2% <40.5%> (ø)

... and 560 files with indirect coverage changes

@GitHK GitHK marked this pull request as ready for review May 29, 2024 12:45
@GitHK GitHK requested review from elisabettai and odeimaiz May 29, 2024 12:45
Copy link
Member

@odeimaiz odeimaiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Collaborator

@elisabettai elisabettai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! I see how we can apply this to many use-cases. Maybe @wvangeit is interested as well.

So @GitHK. the requirements to use this feature are (please correct me if this is wrong):

  1. a service has to be dynamic
  2. in the DB, we need to set which inputs are required. Could you maybe add a screenshot that shows that to the PR description?

@GitHK
Copy link
Contributor Author

GitHK commented May 29, 2024

Very nice! I see how we can apply this to many use-cases. Maybe @wvangeit is interested as well.

So @GitHK. the requirements to use this feature are (please correct me if this is wrong):

  1. a service has to be dynamic

correct both legacy and new style work

  1. in the DB, we need to set which inputs are required. Could you maybe add a screenshot that shows that to the PR description?

OM will add an UI element for this a PR will follow

@wvangeit
Copy link
Contributor

One question, I assume that if there is a file from a previous run of the study present, it will pass the test and run the service?

@GitHK
Copy link
Contributor Author

GitHK commented May 29, 2024

One question, I assume that if there is a file from a previous run of the study present, it will pass the test and run the service?

Correct. this only checks for the port connections and the presence of a file in the port. It cannot do more that this (like inspecting if a file changes) that requires the sidecar to be running (a.k.a. the service to be running)

@wvangeit
Copy link
Contributor

@GitHK Ok, makes sense.
(@elisabettai so for my use case I can't use it yet, because I need to make sure I get 'fresh' files (i.e. with handshakes))

Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in your PR I see that the error message shows the port key not the port displayed name. Can this not be done otherwise? How as a user will I instantly recognize which port is missing?

@GitHK
Copy link
Contributor Author

GitHK commented Jun 3, 2024

in your PR I see that the error message shows the port key not the port displayed name. Can this not be done otherwise? How as a user will I instantly recognize which port is missing?

So the data is coming from the workbench. I'm not sure exactly how to fetch some more information inside the webserver. I would need to pull the data of all the services that are connecting to my node in order to properly format these messages.

@GitHK GitHK requested a review from sanderegg June 3, 2024 11:04
Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@GitHK GitHK requested a review from pcrespov June 3, 2024 12:19
Copy link

sonarqubecloud bot commented Jun 3, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.1% Duplication on New Code

See analysis details on SonarCloud

@GitHK GitHK merged commit 0538066 into ITISFoundation:master Jun 3, 2024
57 checks passed
@GitHK GitHK deleted the pr-osparc-fail-if-input-required-and-missing branch June 3, 2024 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:webserver issue related to the webserver service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dynamic services fail to boot if input is missing
7 participants