Skip to content

Introducing AvailableMemoryProvider to allow custom calculations of a… #4617

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

Merged
merged 2 commits into from
May 7, 2025

Conversation

strategicpause
Copy link
Contributor

@strategicpause strategicpause commented May 4, 2025

Summary

By default the ECS Agent will read from the MemTotal field from /proc/meminfo to determine the default amount of memory available on the container instance. This PR introduces a provider for supporting custom strategies for determining the amount of available memory on the container instance.

Implementation details

This change is implemented by introduction a new ECS Client option via WithAvailableMemoryProvider where ECS clients can provide their own custom AvailableMemoryProvider. If a custom provider is not provided, a provider encapsulating the existing behavior will be provided instead.

Testing

New unit tests were introduced to test the newly added code.

New tests cover the changes: yes

Description for the changelog

Enhancement - Add support for custom providers to determine the initial amount of available memory on a container instance.

Additional Information

Does this PR include breaking model changes? If so, Have you added transformation functions? No

Does this PR include the addition of new environment variables in the README? No

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@strategicpause strategicpause marked this pull request as ready for review May 4, 2025 21:14
@strategicpause strategicpause requested a review from a team as a code owner May 4, 2025 21:14
xxx0624
xxx0624 previously approved these changes May 5, 2025
amogh09
amogh09 previously approved these changes May 5, 2025
Nick Peters added 2 commits May 6, 2025 19:13
@strategicpause strategicpause merged commit b425f66 into aws:dev May 7, 2025
40 of 43 checks passed
strategicpause added a commit to strategicpause/amazon-ecs-agent that referenced this pull request May 14, 2025
Introducing AvailableMemoryProvider to allow custom calculations of a…
@danehlim danehlim mentioned this pull request May 20, 2025
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.

4 participants