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

✨ Comp backend: allow multiple amis/bootscripts/pre-pull images #5033

Merged

Conversation

sanderegg
Copy link
Member

@sanderegg sanderegg commented Nov 14, 2023

What do these changes do?

This PR makes the autoscaling service to define an AMI, specific boot scripts, pre-pull images per EC2 instance type instead of one for all.

This means the following ENVs are deprecated in Autoscaling service:
EC2_INSTANCES_AMI_ID
EC2_INSTANCES_CUSTOM_BOOT_SCRIPTS
EC2_INSTANCES_PRE_PULL_IMAGES
EC2_INSTANCES_PRE_PULL_IMAGES_CRON_INTERVAL

and following ENVs are deprecated in Clusters-keeper service:
WORKERS_EC2_INSTANCES_AMI_ID
WORKERS_EC2_INSTANCES_AMI_ID

The ENV EC2_INSTANCES_ALLOWED_TYPES and WORKERS_EC2_INSTANCES_ALLOWED_TYPES are now a dictionary and may be created like so

json.dumps(
  {
    "t2.micro": 
      {
        "ami_id": AMISTRING, 
        "custom_boot_scripts": Optional[list[COMMAND]], 
        "pre_pull_images": Optional[list[IMAGETAG]], 
        "pre_pull_images_cron_interval": Optional[timedelta]
     }
  }
)

Bonus

Related issue/s

How to test

Dev Checklist

multiple changes in ENVs for autoscaling and clusters-keeper
documented in:

DevOps Checklist

@sanderegg sanderegg added the a:autoscaling autoscaling service in simcore's stack label Nov 14, 2023
@sanderegg sanderegg added this to the 7peaks milestone Nov 14, 2023
@sanderegg sanderegg self-assigned this Nov 14, 2023
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Merging #5033 (89fd705) into master (5477e3d) will increase coverage by 0.9%.
The diff coverage is 78.6%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #5033     +/-   ##
========================================
+ Coverage    86.2%   87.2%   +0.9%     
========================================
  Files        1059    1252    +193     
  Lines       45012   51451   +6439     
  Branches      835    1108    +273     
========================================
+ Hits        38834   44879   +6045     
- Misses       5993    6333    +340     
- Partials      185     239     +54     
Flag Coverage Δ
integrationtests 64.9% <ø> (+<0.1%) ⬆️
unittests 85.0% <78.6%> (+0.8%) ⬆️

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

Files Coverage Δ
...kages/settings-library/src/settings_library/ec2.py 100.0% <ø> (ø)
...ling/src/simcore_service_autoscaling/api/health.py 100.0% <100.0%> (ø)
...e_service_autoscaling/modules/auto_scaling_core.py 94.9% <100.0%> (-0.1%) ⬇️
...ore_service_autoscaling/utils/auto_scaling_core.py 94.2% <100.0%> (-0.1%) ⬇️
.../simcore_service_clusters_keeper/utils/clusters.py 74.0% <100.0%> (+2.2%) ⬆️
...g/src/simcore_service_autoscaling/core/settings.py 97.8% <86.6%> (-2.2%) ⬇️
...c/simcore_service_clusters_keeper/core/settings.py 97.5% <77.7%> (-2.5%) ⬇️
packages/aws-library/src/aws_library/ec2/models.py 87.1% <66.6%> (ø)

... and 197 files with indirect coverage changes

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.

tldr thx

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.

👍

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.

🎉 spotless

@sanderegg sanderegg force-pushed the comp-backend/allow-multiple-amis branch from 1f79bec to b23e712 Compare November 15, 2023 10:04
@sanderegg sanderegg force-pushed the comp-backend/allow-multiple-amis branch from dcab8c1 to b9561d7 Compare November 15, 2023 15:21
@sanderegg sanderegg force-pushed the comp-backend/allow-multiple-amis branch from db3e085 to 89fd705 Compare November 16, 2023 10:13
Copy link

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 16, 2023

Code Climate has analyzed commit 89fd705 and detected 0 issues on this pull request.

View more on Code Climate.

@sanderegg sanderegg merged commit 163d47f into ITISFoundation:master Nov 16, 2023
@sanderegg sanderegg deleted the comp-backend/allow-multiple-amis branch November 16, 2023 10:44
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
6 participants