Append the option to deploy from local task definition file
The issue: for now ecs-deploy just updates the current task definition, but can't deplot the new one with modifications. It's a kind of annoying if you want to append the volume to your container, tweak cpu/memory settings etc..
Hence, here I tried to append this feature trying to leave the current core functionality consistent and healthy.
A couple of notions:
- If we use the local task def file, there is no reason for filter
jq .taskDefinition. So, I removed that from file existence case. - Appended one more jq filter when generationg
NEW_DEFfilter to convert anullvolume values to the empty line. This should work if we don't want to declarevolumedirective in our task definition. Without this filter, AWS API returns error about data type mismactching.
Finally, I provide the example of task definitions I used to deploy.
Without volumes
{
"containerDefinitions": [
{
"name": "test1",
"image": "1234567890.dkr.ecr.eu-central-1.amazonaws.com/test1:latest",
"memory": 1024,
"cpu": 1024,
"essential": true,
"portMappings": [
{
"hostPort": 0,
"containerPort": 8080,
"protocol": "tcp"
}
],
"ulimits": [
{
"softLimit": 8192,
"hardLimit": 8192,
"name": "nofile"
}
],
"logConfiguration": {
"logDriver": "fluentd",
"options": {
"fluentd-address": "127.0.0.1:24224",
"tag": "my.app.test1"
}
}
}
],
"family": "test1"
}
With volumes
{
"containerDefinitions": [
{
"name": "test2",
"image": "507902546598.dkr.ecr.us-east-1.amazonaws.com/test2:latest",
"memory": 2048,
"cpu": 2048,
"essential": true,
"portMappings": [
{
"hostPort": 0,
"containerPort": 8080,
"protocol": "tcp"
}
],
"ulimits": [
{
"softLimit": 8192,
"hardLimit": 8192,
"name": "nofile"
}
],
"mountPoints": [
{
"containerPath": "/var/run/td-agent/td-agent.sock",
"sourceVolume": "fluentd-sock"
}
],
"logConfiguration": {
"logDriver": "fluentd",
"options": {
"fluentd-address": "127.0.0.1:24224",
"tag": "my.app.test2"
}
}
}
],
"volumes": [
{
"host": {
"sourcePath": "/var/run/td-agent/td-agent.sock"
},
"name": "fluentd-sock"
}
],
"family": "test2"
}
@fillup any news about this PR? It seems to take so long in waiting queue and has no feedback about the feature.
Hi @cazorla19 is this still something you're interested in? Sorry its been just about a year since you submitted it, I've been quite busy lately. This feature is not something I'm in need of myself and is a bit out of the scope of a CI/CD tool, but I'm not opposed to it so long as it doesn't cause any issues. If you're still interested do you mind rebasing your changes on current develop branch and I'll be happy to test and merge it in?
Closing this since there has been no response to fillup's comment from Jul 24, 2018.