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

WIP: 🐛 fix max num of allowed dynamic services #4030

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

matusdrobuliak66
Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 commented Mar 27, 2023

What do these changes do?

  • 🐛 Fix situation, when the user is not able to start a dynamic service, because of max. num. of dynamic services is reached, where failed services are counted as running services.

When calling director v2 with list_dynamic_services(), we receive information about all currently running services and their respective states. Currently, this function may return services that have failed (as seen in the reported issue), but in theory, it is possible for a service in the completed state to also be returned. This pull request aims to filter out both of these states when calculating the maximum number of dynamic services that a user can run, for an improved user experience.

We can discuss whether this is a way to go, or we will fix it in the director v2. Then I will add additional unit tests.

Related issue/s

How to test

@matusdrobuliak66 matusdrobuliak66 marked this pull request as ready for review March 27, 2023 11:45
@codecov
Copy link

codecov bot commented Mar 27, 2023

Codecov Report

Merging #4030 (340f10c) into master (935557a) will decrease coverage by 18.2%.
The diff coverage is 100.0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #4030      +/-   ##
=========================================
- Coverage    83.0%   64.9%   -18.2%     
=========================================
  Files         946     394     -552     
  Lines       40979   20369   -20610     
  Branches      851     137     -714     
=========================================
- Hits        34034   13221   -20813     
- Misses       6736    7099     +363     
+ Partials      209      49     -160     
Flag Coverage Δ
integrationtests 62.0% <50.0%> (+15.9%) ⬆️
unittests 59.2% <100.0%> (-23.0%) ⬇️

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

Impacted Files Coverage Δ
...simcore_service_webserver/projects/projects_api.py 92.7% <100.0%> (-1.2%) ⬇️

... and 797 files with indirect coverage changes

project_active_running_nodes = [
node
for node in project_running_nodes
if node["service_state"] not in ["failed", "completed"]
Copy link
Member

Choose a reason for hiding this comment

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

so we also have completed ones??? that is very interesting...
@GitHK what is the concept here. I think this calls return the director-v2 tracked services correct? why do we see completed? I had the feeling they were removed from the list at some point, is that not true?
I'm ok for now with the fix, but I am a bit afraid that we can get failed services with a still running sidecar that are eating resources.

Copy link
Contributor

Choose a reason for hiding this comment

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

The name of this function is so outdated, with respect to what it returns. It's a list of states for the dynamic services (legacy and modern). Nothing more.

Had a chat with Matus and I think in this case he should only consider services which are started/starting when computing the count.

…tusdrobuliak66/osparc-simcore into is836/max-num-of-dynamic-services-fix
@codeclimate
Copy link

codeclimate bot commented Mar 28, 2023

Code Climate has analyzed commit 340f10c and detected 0 issues on this pull request.

View more on Code Climate.

@sonarcloud
Copy link

sonarcloud bot commented Mar 28, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@GitHK GitHK assigned GitHK and unassigned matusdrobuliak66 Mar 28, 2023
@GitHK
Copy link
Contributor

GitHK commented Mar 28, 2023

I will be taking over this @matusdrobuliak66

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

Both of the options below are valid considerations to be made. This PR changes from one of these behaviours to the other.

  • do we want the user to always be able to start up to 5 services?
  • or do we want the system to always be able to have max 5 running services like it is now?

We need to decide on what we want to obtain here.

Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

is this a WIP or can I review?

@matusdrobuliak66
Copy link
Contributor Author

matusdrobuliak66 commented Mar 28, 2023

is this a WIP or can I review?

yes you can review it, but as mentioned by previous comment Andrei will firstly have a look at #4034

@pcrespov pcrespov added this to the Jelly Beans milestone Apr 10, 2023
@pcrespov pcrespov modified the milestones: Jelly Beans, Pastel de Nata May 10, 2023
@pcrespov pcrespov modified the milestones: Pastel de Nata, Watermelon Jun 23, 2023
@pcrespov pcrespov modified the milestones: Watermelon, Sundae Jul 19, 2023
@pcrespov pcrespov removed this from the Sundae milestone Mar 13, 2024
@pcrespov pcrespov added this to the Schoggilebe milestone Mar 13, 2024
@sanderegg sanderegg removed this from the Schoggilebe milestone Apr 12, 2024
@pcrespov pcrespov added this to the Enchanted Odyssey milestone Apr 26, 2024
@sanderegg sanderegg modified the milestones: South Island Iced Tea, Tom Bombadil Jul 23, 2024
@matusdrobuliak66 matusdrobuliak66 added the bug buggy, it does not work as expected label Jul 23, 2024
@sanderegg sanderegg modified the milestones: Tom Bombadil, Eisbock Aug 13, 2024
@sanderegg sanderegg modified the milestones: Eisbock, MartinKippenberger Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug buggy, it does not work as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Max. number of dynamic services reached with failed services
5 participants