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

✨Computational autoscaling: find out which EC2 type is necessary #4975

Merged

Conversation

sanderegg
Copy link
Member

@sanderegg sanderegg commented Nov 3, 2023

What do these changes do?

This PR shall allow the autoscaling service to find out which EC2 type is desired by looking into the task resources.

New

  • If a specific EC2 instance type is defined then autoscaling will pick it up, and if this is in accordance with EC2_INSTANCES_ALLOWED_TYPES then it will start such a machine instead of fitting it to the task needed resources. In case no specific EC2 instance type is defined, then the usual best fitting machine algorithm is used.
  • the created nodes are now also tagged with their respective EC2 type: e.g. a node label such as ec2-instance-type=t2.micro is set on each autoscaled node

Computational mode:

  • a Dask task specific EC2 instance type is defined as a "task restriction", named EC2-INSTANCE-TYPE

Dynamic mode:

  • a Docker service may define a "Placement Constraint" such as ```node.labels.ec2-instance-type=m6a.xlarge"

bonus

Related issue/s

How to test

DevOps Checklist

@sanderegg sanderegg added the a:autoscaling autoscaling service in simcore's stack label Nov 3, 2023
@sanderegg sanderegg added this to the 7peaks milestone Nov 3, 2023
@sanderegg sanderegg self-assigned this Nov 3, 2023
@sanderegg sanderegg force-pushed the comp-backend/autoscaling-multi-ec2 branch from bcdd1aa to 6d4a9fc Compare November 3, 2023 10:33
@sanderegg sanderegg force-pushed the comp-backend/autoscaling-multi-ec2 branch from 6d4a9fc to eadc959 Compare November 3, 2023 14:59
Copy link

codecov bot commented Nov 3, 2023

Codecov Report

Merging #4975 (9d0a3ed) into master (b7f43af) will increase coverage by 0.2%.
The diff coverage is 95.4%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #4975     +/-   ##
========================================
+ Coverage    87.2%   87.4%   +0.2%     
========================================
  Files        1239    1048    -191     
  Lines       51042   46200   -4842     
  Branches     1080     545    -535     
========================================
- Hits        44528   40424   -4104     
+ Misses       6277    5655    -622     
+ Partials      237     121    -116     
Flag Coverage Δ
integrationtests 64.9% <100.0%> (-0.1%) ⬇️
unittests 85.0% <95.4%> (+<0.1%) ⬆️

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

Files Coverage Δ
...ckages/models-library/src/models_library/docker.py 89.6% <100.0%> (+0.1%) ⬆️
...ing/src/simcore_service_autoscaling/core/errors.py 100.0% <100.0%> (ø)
...g/src/simcore_service_autoscaling/core/settings.py 100.0% <ø> (ø)
...oscaling/src/simcore_service_autoscaling/models.py 100.0% <100.0%> (ø)
...vice_autoscaling/modules/auto_scaling_mode_base.py 100.0% <100.0%> (ø)
...scaling/modules/auto_scaling_mode_computational.py 100.0% <100.0%> (+1.3%) ⬆️
...e_autoscaling/modules/auto_scaling_mode_dynamic.py 100.0% <100.0%> (ø)
...ing/src/simcore_service_autoscaling/modules/ec2.py 100.0% <100.0%> (ø)
...ore_service_autoscaling/utils/auto_scaling_core.py 94.2% <100.0%> (+3.8%) ⬆️
...service_autoscaling/utils/computational_scaling.py 100.0% <100.0%> (ø)
... and 6 more

... and 197 files with indirect coverage changes

@sanderegg sanderegg force-pushed the comp-backend/autoscaling-multi-ec2 branch 4 times, most recently from bd456b6 to 98987f7 Compare November 7, 2023 14:16
@sanderegg sanderegg marked this pull request as ready for review November 7, 2023 14:52
Copy link
Contributor

@bisgaard-itis bisgaard-itis left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 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
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.

Very nice job. Left a few comments. thx!

@sanderegg sanderegg force-pushed the comp-backend/autoscaling-multi-ec2 branch from 150daca to 9d0a3ed Compare November 8, 2023 07:53
Copy link

sonarcloud bot commented Nov 8, 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

Copy link

codeclimate bot commented Nov 8, 2023

Code Climate has analyzed commit 9d0a3ed and detected 0 issues on this pull request.

View more on Code Climate.

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.

👍

@sanderegg sanderegg merged commit 0e2a8b9 into ITISFoundation:master Nov 8, 2023
55 checks passed
@sanderegg sanderegg deleted the comp-backend/autoscaling-multi-ec2 branch November 8, 2023 08:47
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Nov 23, 2023
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:autoscaling autoscaling service in simcore's stack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autoscaling: provide a timeout before removing a docker node that is "down"
5 participants