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 backend: allow to set custom ec2 tags (⚠️ devops) #5147

Merged

Conversation

sanderegg
Copy link
Member

@sanderegg sanderegg commented Dec 6, 2023

What do these changes do?

This PR allows to set ENV to define specific tags on EC2 instances created in external clusters to allow checking costs
These tags will be shown in the AWS console and may be used for filtering EC2s (for example to follow costs).

Related issue/s

How to test

Dev Checklist

DevOps Checklist

New environment variables:

Clusters-keeper:

  • PRIMARY_EC2_INSTANCES_CUSTOM_TAGS to add specific tags on the computational cluster primary machine
  • WORKERS_EC2_INSTANCES_CUSTOM_TAGS to add specific tags on the computational cluster worker machine(s)

Autoscaling:

  • EC2_INSTANCES_CUSTOM_TAGS to add specific tags on autoscaled worker machine(s)

@sanderegg sanderegg added a:autoscaling autoscaling service in simcore's stack a:clusters-keeper labels Dec 6, 2023
@sanderegg sanderegg added this to the Kobayashi Maru milestone Dec 6, 2023
@sanderegg sanderegg self-assigned this Dec 6, 2023
Copy link

codecov bot commented Dec 6, 2023

Codecov Report

Merging #5147 (cded45f) into master (32b1cc5) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #5147   +/-   ##
======================================
  Coverage    87.3%   87.4%           
======================================
  Files        1275    1275           
  Lines       52349   52358    +9     
  Branches     1133    1133           
======================================
+ Hits        45753   45765   +12     
+ Misses       6356    6353    -3     
  Partials      240     240           
Flag Coverage Δ
integrationtests 64.8% <ø> (-0.1%) ⬇️
unittests 85.2% <100.0%> (+<0.1%) ⬆️

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

Files Coverage Δ
packages/aws-library/src/aws_library/ec2/client.py 100.0% <100.0%> (ø)
packages/aws-library/src/aws_library/ec2/models.py 88.0% <100.0%> (+0.8%) ⬆️
...g/src/simcore_service_autoscaling/core/settings.py 97.8% <100.0%> (+<0.1%) ⬆️
...e_service_autoscaling/modules/auto_scaling_core.py 95.1% <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%> (ø)
...e_autoscaling/modules/auto_scaling_mode_dynamic.py 100.0% <100.0%> (ø)
...src/simcore_service_autoscaling/utils/utils_ec2.py 100.0% <100.0%> (ø)
...c/simcore_service_clusters_keeper/core/settings.py 95.6% <100.0%> (+<0.1%) ⬆️
...imcore_service_clusters_keeper/modules/clusters.py 100.0% <ø> (ø)
... and 2 more

... and 6 files with indirect coverage changes

@sanderegg sanderegg force-pushed the comp-backed/add-custom-ec2-tags branch 2 times, most recently from 229a1b3 to 8b3bc05 Compare December 7, 2023 17:21
@sanderegg sanderegg changed the title ✨Computational backend: allow to set custom ec2 tags ✨Computational backend: allow to set custom ec2 tags (⚠️ devops) Dec 7, 2023
@sanderegg sanderegg marked this pull request as ready for review December 7, 2023 17:37
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.

🎉

@sanderegg sanderegg force-pushed the comp-backed/add-custom-ec2-tags branch from 8b3bc05 to 53f68bd Compare December 10, 2023 19:15
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 Dec 11, 2023

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

View more on Code Climate.

Copy link
Contributor

@YuryHrytsuk YuryHrytsuk left a comment

Choose a reason for hiding this comment

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

Thank you 👍

Let's link the related ops-config PR so that we can double check that ENV is configure properly

https://git.speag.com/oSparc/osparc-ops-deployment-configuration/-/merge_requests/203

@sanderegg
Copy link
Member Author

Thank you 👍

Let's link the related ops-config PR so that we can double check that ENV is configure properly

https://git.speag.com/oSparc/osparc-ops-deployment-configuration/-/merge_requests/203

@YuryHrytsuk yes I already added it up there. thanks for the review!

@sanderegg sanderegg merged commit 9302f8b into ITISFoundation:master Dec 11, 2023
55 checks passed
@sanderegg sanderegg deleted the comp-backed/add-custom-ec2-tags branch December 11, 2023 08:38
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.

Cool! Thanks,
just a single question

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 a:clusters-keeper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tags to EC2 autoscaled machines for easy retrieval (user_id, wallet_id, ....)
5 participants