amazon-ecs-cli icon indicating copy to clipboard operation
amazon-ecs-cli copied to clipboard

Support shm_size for compose 3 projects

Open allisaurus opened this issue 6 years ago • 6 comments

Summary

Support shm_size for docker compose 3 projects

Description

Currently, ecs-cli does not support shm_size for compose 3 projects because the ServiceConfig the v3 parser returns does not include this field (Potentially related to https://github.com/moby/moby/issues/26714 ). Adding support for this field will allow customers who require shm_size in their projects to use v3 syntax with the ecs-cli.

allisaurus avatar Jun 05 '18 23:06 allisaurus

I use ECS-CLI compose to start containers which needs shm_size - any ETA for this feature or is there a documented workaround?

lucasgut avatar Jul 16 '18 16:07 lucasgut

Hi @lucasgut - thanks for letting us know about your need for this. The immediate work around is (if possible) to use a compose 2 project, which will support shm_size; no ETA on support for shm_size in compose 3 projects yet, but we will update this issue as we have more info.

allisaurus avatar Jul 24 '18 22:07 allisaurus

@allisaurus Is there an update on this?

We are using selenium based containers which requires shm_size - otherwise the containers could crash randomly.

Update It seems that this option is already supported / although still not in fargate. Could this issue be closed if that's the case?

OneEyedSpaceFish avatar May 10 '19 11:05 OneEyedSpaceFish

@OneEyedSpaceFish You're right that ECS supports shm_size for the EC2 launch mode, however the ecs-cli still doesn't support using this field with docker compose 3 syntax since it was removed as a service-level field there (more context above).

ecs-cli users today can specify shm_size per-service using compose 2 projects, however if that's not an option for you, something we could consider is adding service-level shm_size to the ecs-params file, similar to how you'd specify service-level CPU or memory constraints with a compose 3 project today. Would either the v2 options or the addition of shm_size to ecs-parms unblock your use case?

allisaurus avatar May 10 '19 16:05 allisaurus

@allisaurus We are using Fargate, so I don't think that any of the following features would benefit us directly.

Unfortunately, I assumed that the option is not supported at all in ECS, but upon further research - after I already made a comment - I realized that it's supported in ECS, just not in Fargate lunch mode.

Is there an option to add the shm_size support for Fargate lunch modes?

OneEyedSpaceFish avatar May 13 '19 12:05 OneEyedSpaceFish

@OneEyedSpaceFish , no worries re: previous comment, that's why we're here :) Unfortunately, shm_size is not available in Fargate and is unlikely to be added due to its effect on the host instance (which is largely abstracted away in Fargate).

If you're seeing containers randomly crash, you may be able to mitigate this by allocating more task-level memory, though YMMV given your specific use case.

allisaurus avatar May 14 '19 20:05 allisaurus