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

✨ Ensure memory swap for computational services is same as memory (⚠️ devops) #3510

Merged

Conversation

sanderegg
Copy link
Member

@sanderegg sanderegg commented Nov 3, 2022

What do these changes do?

ensure memory-swap is set to the same value as memory limit if not set.
-1 disables it and any other value is equal to memory
MemorySwap = memory + swap

The PR effectively disables swapping for computational services.

Also @mrnicegyu11 concerning this #3506, this can to the best of my knowledge not happen in the dask-sidecar as it validates through pydantic and the 3 parameters in the use-case are not part of the pydantic model.
see https://github.com/itisfoundation/osparc-simcore/blob/59c34d86136ad0d4a2f584f2afc013ae32921ab7/services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/docker_utils.py

Related issue/s

resolves #3507
#3506

Bonus:

  • added shellcheck/hadolint extensions as recommended ones in vscode settings.template

How to test

Checklist

⚠️ devops:

Assert that the kernel feature for cgroup swap memory limits is enabled on all machines where this is rolled out. Run docker info to check. See gitlab ops issue 307

@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Merging #3510 (58cc014) into master (187f59e) will decrease coverage by 14.8%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #3510      +/-   ##
=========================================
- Coverage    82.4%   67.5%   -14.9%     
=========================================
  Files         834     349     -485     
  Lines       35446   17823   -17623     
  Branches      748     133     -615     
=========================================
- Hits        29220   12038   -17182     
+ Misses       6036    5736     -300     
+ Partials      190      49     -141     
Flag Coverage Δ
integrationtests 67.5% <ø> (+15.1%) ⬆️
unittests ?

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

Impacted Files Coverage Δ
...-v2/src/simcore_service_director_v2/cli/_client.py 0.0% <0.0%> (-100.0%) ⬇️
...v2/src/simcore_service_director_v2/cli/__init__.py 0.0% <0.0%> (-100.0%) ⬇️
...service_webserver/projects/_project_models_rest.py 0.0% <0.0%> (-100.0%) ⬇️
...service_director_v2/cli/_close_and_save_service.py 0.0% <0.0%> (-100.0%) ⬇️
...es/web/server/src/simcore_service_webserver/log.py 0.0% <0.0%> (-94.8%) ⬇️
...erver/src/simcore_service_webserver/rest_models.py 0.0% <0.0%> (-92.7%) ⬇️
...or-v2/src/simcore_service_director_v2/cli/_core.py 0.0% <0.0%> (-87.5%) ⬇️
...simcore_service_webserver/director/director_api.py 0.0% <0.0%> (-76.0%) ⬇️
...ce_director_v2/modules/db/repositories/clusters.py 23.0% <0.0%> (-71.7%) ⬇️
...e_service_webserver/login/handlers_confirmation.py 27.2% <0.0%> (-69.1%) ⬇️
... and 676 more

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.

Nice, just some questions below

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 a lot for implementing this, super! I hope we get the machines into a more predictable state with this :)

@mrnicegyu11 mrnicegyu11 changed the title ✨ Ensure memory swap for computational services is same as memory ✨ Ensure memory swap for computational services is same as memory (⚠️ devops) Nov 4, 2022
@sonarcloud
Copy link

sonarcloud bot commented Nov 4, 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.0% 0.0% Duplication

@sanderegg sanderegg merged commit 3701c9d into ITISFoundation:master Nov 4, 2022
@sanderegg sanderegg deleted the enhancement/dask-sidecar/no-swap branch November 4, 2022 09:27
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.

Disallow usage of swap memory by containers spawned by the dask-sidecar
4 participants