Merge Feature/task-resource-accounting to dev #3757
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This feature implements task resource accounting in agent.
STOPPED
to ECS backend. Tasks waiting for resources will wait in a queue until enough resources for them become available. Current resources being tracked are cpu, memory, ports (tcp/udp) and number of gpus.Implementation details
#3684 Host Resource Manager initialization
#3706 Add method to get host resources reserved for a task
#3700 Add host resource manager methods
#3723 Remove task serialization and use host resource manager for task resources
#3741 Add integ tests for task accounting
#3747 Change reconcile/container update order on init and waitForHostResources/emitCurrentStatus order
#3750 Dont consume host resources for tasks getting STOPPED while waiting in waitingTasksQueue
Related Containers Roadmap Issue
aws/containers-roadmap#325
Testing
Manual verification along with unit tests, integ tests and functional tests in the mentioned PRs to check methods and functional behavior
New tests cover the changes:
Yes
Description for the changelog
Add task resource accounting in ECS Agent
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.