From 30ed2064f4313f7c9db7e0590312677806dd57bd Mon Sep 17 00:00:00 2001 From: csquared Date: Wed, 14 Oct 2015 16:26:55 -0700 Subject: [PATCH 1/5] try rollover with cfn-signals by waiting on resource signals --- api/dist/kernel.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/dist/kernel.json b/api/dist/kernel.json index d5a5922f35..6c591811ab 100644 --- a/api/dist/kernel.json +++ b/api/dist/kernel.json @@ -508,6 +508,8 @@ "mkdir -p /etc/convox", { "Fn::Join": [ "", [ "echo \"", { "Ref": "AWS::Region" }, "\" > /etc/convox/region" ] ] }, "curl -s http://convox.s3.amazonaws.com/agent/0.3/convox.conf > /etc/init/convox.conf", + { "Fn::Join": [ " ", [ "cfn-init", "-s", { "Ref": "AWS::StackName" }, "-r", "Instances", "--region", {"Ref":"AWS::Region"} ] ] }, + { "Fn::Join": [ " ", [ "cfn-signal", "-s", "--stack", { "Ref": "AWS::StackName" }, "--resource", "Instances", "--region", {"Ref":"AWS::Region"} ] ] }, "start convox" ] ] } } @@ -551,7 +553,9 @@ "UpdatePolicy": { "AutoScalingRollingUpdate": { "MaxBatchSize": 1, - "MinInstancesInService": 1 + "MinInstancesInService": 1, + "PauseTime" : "PT5M", + "WaitOnResourceSignals": "true" } } }, From 2ebbcb187bf3c3ed5ec311c1283a8884209e4759 Mon Sep 17 00:00:00 2001 From: csquared Date: Wed, 14 Oct 2015 16:43:57 -0700 Subject: [PATCH 2/5] give it fifteen minutes, warning: magic constant --- api/dist/kernel.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/dist/kernel.json b/api/dist/kernel.json index 6c591811ab..255ab23485 100644 --- a/api/dist/kernel.json +++ b/api/dist/kernel.json @@ -554,7 +554,7 @@ "AutoScalingRollingUpdate": { "MaxBatchSize": 1, "MinInstancesInService": 1, - "PauseTime" : "PT5M", + "PauseTime" : "PT15M", "WaitOnResourceSignals": "true" } } From 2f233edc75272860a23705e2d8ca02f9340880db Mon Sep 17 00:00:00 2001 From: csquared Date: Wed, 14 Oct 2015 17:04:45 -0700 Subject: [PATCH 3/5] install cfn via aws-cfn-bootstrap --- api/dist/kernel.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/dist/kernel.json b/api/dist/kernel.json index 255ab23485..53bf3acaa5 100644 --- a/api/dist/kernel.json +++ b/api/dist/kernel.json @@ -494,6 +494,7 @@ "#!/bin/bash", "fallocate -l 5G /swapfile && chmod 0600 /swapfile && mkswap /swapfile && swapon /swapfile", "yum -y update", + "yum -y install aws-cfn-bootstrap", { "Fn::Join": [ "", [ "echo ECS_CLUSTER=", { "Ref": "Cluster" }, " >> /etc/ecs/ecs.config" ] ] }, "echo ECS_ENGINE_AUTH_TYPE=docker >> /etc/ecs/ecs.config", { "Fn::If": [ "BlankCertificate", @@ -508,8 +509,8 @@ "mkdir -p /etc/convox", { "Fn::Join": [ "", [ "echo \"", { "Ref": "AWS::Region" }, "\" > /etc/convox/region" ] ] }, "curl -s http://convox.s3.amazonaws.com/agent/0.3/convox.conf > /etc/init/convox.conf", - { "Fn::Join": [ " ", [ "cfn-init", "-s", { "Ref": "AWS::StackName" }, "-r", "Instances", "--region", {"Ref":"AWS::Region"} ] ] }, - { "Fn::Join": [ " ", [ "cfn-signal", "-s", "--stack", { "Ref": "AWS::StackName" }, "--resource", "Instances", "--region", {"Ref":"AWS::Region"} ] ] }, + { "Fn::Join": [ " ", [ "/opt/aws/bin/cfn-init", "-s", { "Ref": "AWS::StackName" }, "-r", "Instances", "--region", {"Ref":"AWS::Region"} ] ] }, + { "Fn::Join": [ " ", [ "/opt/aws/bin/cfn-signal", "-s", "--stack", { "Ref": "AWS::StackName" }, "--resource", "Instances", "--region", {"Ref":"AWS::Region"} ] ] }, "start convox" ] ] } } From e81a789764f9d98289fdbf0e5a69ca454d0592df Mon Sep 17 00:00:00 2001 From: csquared Date: Wed, 14 Oct 2015 17:12:18 -0700 Subject: [PATCH 4/5] have to pass a value --- api/dist/kernel.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/dist/kernel.json b/api/dist/kernel.json index 53bf3acaa5..bb4b393b01 100644 --- a/api/dist/kernel.json +++ b/api/dist/kernel.json @@ -510,7 +510,7 @@ { "Fn::Join": [ "", [ "echo \"", { "Ref": "AWS::Region" }, "\" > /etc/convox/region" ] ] }, "curl -s http://convox.s3.amazonaws.com/agent/0.3/convox.conf > /etc/init/convox.conf", { "Fn::Join": [ " ", [ "/opt/aws/bin/cfn-init", "-s", { "Ref": "AWS::StackName" }, "-r", "Instances", "--region", {"Ref":"AWS::Region"} ] ] }, - { "Fn::Join": [ " ", [ "/opt/aws/bin/cfn-signal", "-s", "--stack", { "Ref": "AWS::StackName" }, "--resource", "Instances", "--region", {"Ref":"AWS::Region"} ] ] }, + { "Fn::Join": [ " ", [ "/opt/aws/bin/cfn-signal", "-s", "true", "--stack", { "Ref": "AWS::StackName" }, "--resource", "Instances", "--region", {"Ref":"AWS::Region"} ] ] }, "start convox" ] ] } } From 125185ae4933892e40116a6ba505397fff23debc Mon Sep 17 00:00:00 2001 From: csquared Date: Wed, 14 Oct 2015 17:13:10 -0700 Subject: [PATCH 5/5] defaults to true --- api/dist/kernel.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/dist/kernel.json b/api/dist/kernel.json index bb4b393b01..f814b902a1 100644 --- a/api/dist/kernel.json +++ b/api/dist/kernel.json @@ -510,7 +510,7 @@ { "Fn::Join": [ "", [ "echo \"", { "Ref": "AWS::Region" }, "\" > /etc/convox/region" ] ] }, "curl -s http://convox.s3.amazonaws.com/agent/0.3/convox.conf > /etc/init/convox.conf", { "Fn::Join": [ " ", [ "/opt/aws/bin/cfn-init", "-s", { "Ref": "AWS::StackName" }, "-r", "Instances", "--region", {"Ref":"AWS::Region"} ] ] }, - { "Fn::Join": [ " ", [ "/opt/aws/bin/cfn-signal", "-s", "true", "--stack", { "Ref": "AWS::StackName" }, "--resource", "Instances", "--region", {"Ref":"AWS::Region"} ] ] }, + { "Fn::Join": [ " ", [ "/opt/aws/bin/cfn-signal", "--stack", { "Ref": "AWS::StackName" }, "--resource", "Instances", "--region", {"Ref":"AWS::Region"} ] ] }, "start convox" ] ] } }