Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

Conversation

@PettitWesley
Copy link
Contributor

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

@PettitWesley PettitWesley changed the title Add support for pidMode and ipcMOde Add support for pidMode and ipcMode Nov 19, 2018
@PettitWesley
Copy link
Contributor Author

ECS Params:

version: 1
task_definition:
  pid: task
  ipc: host
$ ecs-cli compose --ecs-params ecs-params-clowns.yml --project-name killer-klowns-from-outer-space  --debug create
DEBU[0000] Parsing the compose yaml...                  
DEBU[0000] Docker Compose version found: 3              
DEBU[0000] Parsing v3 project...                        
DEBU[0000] Parsing the ecs-params yaml...               
DEBU[0000] Parsing the ecs-registry-creds yaml...       
DEBU[0000] Transforming yaml to task definition...      
DEBU[0000] Finding task definition in cache or creating if needed  TaskDefinition="{\n  ContainerDefinitions: [{\n      Command: [],\n      Cpu: 0,\n      DnsSearchDomains: [],\n      DnsServers: [],\n      DockerSecurityOptions: [],\n      EntryPoint: [],\n      Environment: [],\n      Essential: true,\n      ExtraHosts: [],\n      Image: \"redis:latest\",\n      Links: [],\n      LinuxParameters: {\n        Capabilities: {\n\n        },\n        Devices: []\n      },\n      Memory: 512,\n      Name: \"redis\",\n      Privileged: false,\n      ReadonlyRootFilesystem: false\n    }],\n  Cpu: \"\",\n  ExecutionRoleArn: \"\",\n  Family: \"killer-klowns-from-outer-space\",\n  IpcMode: \"host\",\n  Memory: \"\",\n  NetworkMode: \"\",\n  PidMode: \"task\",\n  RequiresCompatibilities: [\"EC2\"],\n  TaskRoleArn: \"\",\n  Volumes: []\n}"
DEBU[0000] cache hit                                     taskDef="{\n  Compatibilities: [\"EC2\"],\n  ContainerDefinitions: [{\n      Essential: true,\n      Image: \"redis:latest\",\n      LinuxParameters: {\n        Capabilities: {\n\n        }\n      },\n      Memory: 512,\n      Name: \"redis\"\n    }],\n  Family: \"killer-klowns-from-outer-space\",\n  RequiresAttributes: [{\n      Name: \"com.amazonaws.ecs.capability.docker-remote-api.1.17\"\n    }],\n  RequiresCompatibilities: [\"EC2\"],\n  Revision: 1,\n  Status: \"ACTIVE\",\n  TaskDefinitionArn: \"arn:aws:ecs:us-west-2:144718711470:task-definition/killer-klowns-from-outer-space:1\"\n}" taskDefHash=2f94bc469a3fabea3bb7225919e88257
INFO[0000] Using ECS task definition                     TaskDefinition="killer-klowns-from-outer-space:1"

Something seems to be going wrong though, because while the --debug info clearly shows PidMode and IPCMode in the registered task definition, I can't see those fields when I describe the task def with the latest version of AWS CLI or with the ECS Console. So far I can't figure out why that would be the case, the ECS CLI appears to be doing the right thing 🤔.

@PettitWesley PettitWesley force-pushed the insane-clown-processes branch 2 times, most recently from 5201dd0 to ad612fe Compare November 19, 2018 20:04
@PettitWesley
Copy link
Contributor Author

It works now!

$ ecs-cli compose --ecs-params ecs-params-clowns.yml --project-name killer-klowns-from-outer-space7  --debug create
DEBU[0000] Parsing the compose yaml...                  
DEBU[0000] Docker Compose version found: 3              
DEBU[0000] Parsing v3 project...                        
DEBU[0000] Parsing the ecs-params yaml...               
DEBU[0000] Parsing the ecs-registry-creds yaml...       
DEBU[0000] Transforming yaml to task definition...      
DEBU[0000] Finding task definition in cache or creating if needed  TaskDefinition="{\n  ContainerDefinitions: [{\n      Command: [],\n      Cpu: 0,\n      DnsSearchDomains: [],\n      DnsServers: [],\n      DockerSecurityOptions: [],\n      EntryPoint: [],\n      Environment: [],\n      Essential: true,\n      ExtraHosts: [],\n      Image: \"redis:latest\",\n      Links: [],\n      LinuxParameters: {\n        Capabilities: {\n\n        },\n        Devices: []\n      },\n      Memory: 512,\n      Name: \"redis\",\n      Privileged: false,\n      ReadonlyRootFilesystem: false\n    }],\n  Cpu: \"\",\n  ExecutionRoleArn: \"\",\n  Family: \"killer-klowns-from-outer-space7\",\n  IpcMode: \"host\",\n  Memory: \"\",\n  NetworkMode: \"\",\n  PidMode: \"task\",\n  RequiresCompatibilities: [\"EC2\"],\n  TaskRoleArn: \"\",\n  Volumes: []\n}"
INFO[0000] Using ECS task definition                     TaskDefinition="killer-klowns-from-outer-space7:1"
$ aws ecs describe-task-definition --region us-west-2 --task-definition killer-klowns-from-outer-space7:1
{
    "taskDefinition": {
        "taskDefinitionArn": "arn:aws:ecs:us-west-2:144718711470:task-definition/killer-klowns-from-outer-space7:1",
        "containerDefinitions": [
            {
                "name": "redis",
                "image": "redis:latest",
                "cpu": 0,
                "memory": 512,
                "links": [],
                "portMappings": [],
                "essential": true,
                "entryPoint": [],
                "command": [],
                "environment": [],
                "mountPoints": [],
                "volumesFrom": [],
                "linuxParameters": {
                    "capabilities": {},
                    "devices": []
                },
                "privileged": false,
                "readonlyRootFilesystem": false,
                "dnsServers": [],
                "dnsSearchDomains": [],
                "extraHosts": [],
                "dockerSecurityOptions": []
            }
        ],
        "family": "killer-klowns-from-outer-space7",
        "revision": 1,
        "volumes": [],
        "status": "ACTIVE",
        "requiresAttributes": [
            {
                "name": "ecs.capability.pid-ipc-namespace-sharing"
            },
            {
                "name": "com.amazonaws.ecs.capability.docker-remote-api.1.17"
            },
            {
                "name": "com.amazonaws.ecs.capability.docker-remote-api.1.24"
            }
        ],
        "placementConstraints": [],
        "compatibilities": [
            "EC2"
        ],
        "requiresCompatibilities": [
            "EC2"
        ],
        "pidMode": "task",
        "ipcMode": "host"
    }
}

@PettitWesley PettitWesley force-pushed the insane-clown-processes branch from ad612fe to be34de6 Compare November 19, 2018 21:08
README.md Outdated
cpu_limit: string
mem_limit: string
pid: string
ipc: string
Copy link
Contributor

Choose a reason for hiding this comment

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

similar to line 441, do we want to add a comment like:
// Supported string values: host or task / Supported string values: host, task, or none

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

@PettitWesley PettitWesley force-pushed the insane-clown-processes branch from be34de6 to a000488 Compare November 19, 2018 21:34
@PettitWesley PettitWesley merged commit 63224ec into aws:dev Nov 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants