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

🚑️ tuning down scheduler for dynamic sidecars #3025

Merged
merged 13 commits into from
May 10, 2022

Conversation

GitHK
Copy link
Contributor

@GitHK GitHK commented May 6, 2022

What do these changes do?

  • The dynamic-sidecar scheduler was a bit aggressive and would end up scheduling too many retry attempts. Tuned down the value
  • director-v2 will now start dynamic-sidecars with log leve set to WARNING, for development DEBUG will still be set
  • Fixed an issue when starting the dynamic-sidecar spawned container. After the first failed attempt, all attempts would add more networks to the network list inside the container service spec.

Related issue/s

How to test

Checklist

@codecov
Copy link

codecov bot commented May 6, 2022

Codecov Report

Merging #3025 (651e292) into master (66ea86c) will increase coverage by 13.2%.
The diff coverage is 75.0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #3025      +/-   ##
=========================================
+ Coverage    66.5%   79.7%   +13.2%     
=========================================
  Files         572     698     +126     
  Lines       22425   29221    +6796     
  Branches     2905    3756     +851     
=========================================
+ Hits        14917   23297    +8380     
+ Misses       6999    5086    -1913     
- Partials      509     838     +329     
Flag Coverage Δ
integrationtests 65.9% <72.7%> (?)
unittests 75.4% <66.6%> (+8.9%) ⬆️

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

Impacted Files Coverage Δ
...or_v2/models/schemas/dynamic_services/scheduler.py 98.6% <ø> (ø)
...es/dynamic_sidecar/docker_service_specs/sidecar.py 79.0% <ø> (ø)
...ector_v2/modules/dynamic_sidecar/scheduler/task.py 81.9% <50.0%> (ø)
...2/src/simcore_service_director_v2/core/settings.py 96.1% <75.0%> (ø)
...v2/modules/dynamic_sidecar/docker_compose_specs.py 100.0% <100.0%> (ø)
...c/simcore_service_dynamic_sidecar/core/settings.py 96.0% <100.0%> (ø)
...rvice-library/src/servicelib/common_aiopg_utils.py 88.2% <0.0%> (-8.9%) ⬇️
...service_director_v2/api/routes/dynamic_services.py 88.2% <0.0%> (ø)
...ices/storage/src/simcore_service_storage/models.py 78.8% <0.0%> (ø)
..._director_v2/modules/dynamic_sidecar/_constants.py 100.0% <0.0%> (ø)
... and 239 more

# avoid duplicate entries, this is important when the dynamic-sidecar
# fails to run docker-compose up, otherwise it will
# continue adding lots of entries to this list
target_container_spec["networks"] = list(set(container_networks))
Copy link
Member

Choose a reason for hiding this comment

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

question, can't it just be a set instead of a list?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it has to be a list inside the yaml that docker-compose up receives.

@@ -22,7 +22,7 @@ class DynamicSidecarSettings(BaseCustomSettings):
)

# LOGGING
LOG_LEVEL: str = Field("DEBUG")
LOG_LEVEL: str = Field("WARNING")
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@mrnicegyu11 mrnicegyu11 left a comment

Choose a reason for hiding this comment

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

thanks!

@GitHK GitHK self-assigned this May 6, 2022
@GitHK GitHK added this to the Macarons +1 milestone May 6, 2022
@@ -148,6 +148,9 @@ class DynamicSidecarProxySettings(BaseCustomSettings):


class DynamicSidecarSettings(BaseCustomSettings):
DYNAMIC_SIDECAR_LOG_LEVEL: str = Field(
Copy link
Member

Choose a reason for hiding this comment

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

MINOR: ..._LOG_LEVEL: Literal["DEBUG", "WARNING", "INFO", "ERROR"] = ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently the literal is not working. Something about inheritance, it cannot be subclassed. As an alternative I've added a validator.

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 9, 2022

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.5% 0.5% Duplication

@GitHK GitHK merged commit 046b370 into ITISFoundation:master May 10, 2022
@GitHK GitHK deleted the adding-log-level-dysdcr branch May 10, 2022 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants