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

ECS task definition cpu/memory #3267

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ipmb
Copy link
Contributor

@ipmb ipmb commented Aug 28, 2020

refs #3222

The rules around this are a little confusing. I haven't covered all the use cases, but I think this is an improvement.

Going from https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.htm

Task Definition

When you register a task definition, you can specify the total cpu and memory used for the task. This is separate from the cpu and memory values at the container definition level. If using the EC2 launch type, these fields are optional. If using the Fargate launch type, these fields are required and there are specific values for both cpu and memory that are supported.

Container Definition

cpu

This field is optional for tasks using the Fargate launch type, and the only requirement is that the total amount of CPU reserved for all containers within a task be lower than the task-level cpu value.

memory

The total amount of memory reserved for all containers within a task must be lower than the task memory value, if one is specified.

If using the Fargate launch type, this parameter is optional.

If using the EC2 launch type, you must specify either a task-level memory value or a container-level memory value. If you specify both a container-level memory and memoryReservation value, memory must be greater than memoryReservation. If you specify memoryReservation, then that value is subtracted from the available memory resources for the container instance on which the container is placed. Otherwise, the value of memory is used.

memoryReservation

If a task-level memory value is not specified, you must specify a non-zero integer for one or both of memory or memoryReservation in a container definition. If you specify both, memory must be greater than memoryReservation. If you specify memoryReservation, then that value is subtracted from the available memory resources for the container instance on which the container is placed. Otherwise, the value of memory is used.

Copy link
Collaborator

@bblommers bblommers left a comment

Choose a reason for hiding this comment

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

Looks like the build is failing: https://travis-ci.org/github/spulec/moto/builds/722091623

Would be good to get some tests for this as well

@bpandola
Copy link
Collaborator

@ipmb Hi there. This had gone a bit stale. I brought in the latest changes from master and re-ran CI. The tests are still failing based on some of the changes you introduced. Please let us know if you're still interested in working on this or if you've moved on. Thanks.

@ipmb
Copy link
Contributor Author

ipmb commented Nov 10, 2022

Thanks @bpandola! I am still interested (I maintain this patch locally), but time has been hard to come by. I'll do my best.

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.

3 participants