-
Notifications
You must be signed in to change notification settings - Fork 807
1636 long aws check #1919
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
1636 long aws check #1919
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! Just make sure it is tested on actual AWS instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small suggestions.
Codecov Report
@@ Coverage Diff @@
## develop #1919 +/- ##
===========================================
- Coverage 55.43% 55.37% -0.07%
===========================================
Files 449 448 -1
Lines 12816 12927 +111
===========================================
+ Hits 7105 7158 +53
- Misses 5711 5769 +58
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the complications that have arisen, I think an overall better approach is provide a function called get_aws_info() -> AWSInfo
where AWSInfo
is a named tuple or dataclass. We can use @lru_cache
to cache the results of get_aws_info()
to prevent the slow calls from being made more than once.
See the comments for more detail.
Singleton is a common pattern, potentially usable in the Agent so it belongs in common
AWS related services call AWS metadata service which might take a long time to timeout, that's why they are ran on a separate thread
Locks will avoid the situation where is_running_on_aws is called before this service finished initializing
Update the IAM role change screenshot and add a note about firewall rules
This change simplifies the codebase by removing unnecessary inheritance and nested directory structure
This also changes AwsInstance from singleton and instead the aws_service package is used as one
501827a
to
e895897
Compare
What does this PR do?
Fixes #1636
Add any further explanations here.
PR Checklist
Testing Checklist