-
Notifications
You must be signed in to change notification settings - Fork 604
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
Support for setting PIDs limit for ECS tasks #3790
Conversation
@@ -363,9 +363,10 @@ func (task *Task) PostUnmarshalTask(cfg *config.Config, | |||
|
|||
task.adjustForPlatform(cfg) | |||
|
|||
// TODO, add rudimentary plugin support and call any plugins that want to |
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.
this TODO was 8 years old....probably time to remove
@@ -1,3 +1,6 @@ | |||
//go:build unit |
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.
unrelated to this change, but these tests were not running without this tag
assert.Equal(t, 0, parseTaskPidsLimit()) | ||
} | ||
|
||
func TestParseContainerInstanceTags(t *testing.T) { |
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.
this test is unrelated to this change, but am going to add a bunch of unrelated unit tests for the parse.go function that didnt previously exist
d3f5bdc
to
03839b6
Compare
Do we need to update https://github.com/aws/amazon-ecs-agent/blob/dev/agent/config/parse_unsupported.go too? |
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.
(comment resolved)
Summary
Adds a new agent configuration variable:
ECS_TASK_PIDS_LIMIT
This variable defaults to being unset, which results in the current behavior of no PID limit being set at the task level.
If the user sets this to a value 1 or more, then agent will set the pids.max pid limit cgroup parameter to the provided value, for the task-level cgroup for all ECS tasks that are launched on this container instance. Note that this limit is applied for the whole task, not per-container.
addresses aws/containers-roadmap#354 for the EC2 launch type.
Implementation details
Testing
Functionality was verified manually and unit tests were added in this PR. Functional tests will be added before merging to dev branch.
New tests cover the changes: yes
Description for the changelog
Enhancement: ECS_TASK_PIDS_LIMIT for setting the task-level PIDs limit.
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.