Skip to content

Commit 31ec1b6

Browse files
author
David Chung
committed
Merge remote-tracking branch 'upstream/master' into pmode-vendor
2 parents 41435b8 + a04aeea commit 31ec1b6

File tree

8 files changed

+111
-108
lines changed

8 files changed

+111
-108
lines changed

aws/cloudformation/docker_for_aws.json

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"AWSTemplateFormatVersion": "2010-09-09",
33

4-
"Description": "Docker for AWS Beta 10 (docker 1.12.3)",
4+
"Description": "Docker for AWS 1.13.0-rc1 (alpha11)",
55

66
"Parameters": {
77
"KeyName": {
@@ -71,8 +71,8 @@
7171

7272
"DockerForAWS" : {
7373
"version" : {
74-
"docker": "1.12.3",
75-
"forAws": "aws-v1.12.3-beta10"
74+
"docker": "1.13.0-rc1",
75+
"forAws": "aws-v1.13.0-rc1-alpha11"
7676
}
7777
},
7878

@@ -221,51 +221,50 @@
221221
},
222222
"AWSRegionArch2AMI": {
223223
"ap-northeast-1": {
224-
"HVM64": "ami-d3d271b2",
224+
"HVM64": "ami-d1b318b0",
225225
"HVMG2": "NOT_SUPPORTED"
226226
},
227227
"ap-northeast-2": {
228-
"HVM64": "ami-5e31e530",
228+
"HVM64": "ami-4f914621",
229229
"HVMG2": "NOT_SUPPORTED"
230230
},
231231
"ap-south-1": {
232-
"HVM64": "ami-d24b3fbd",
232+
"HVM64": "ami-19e79376",
233233
"HVMG2": "NOT_SUPPORTED"
234234
},
235235
"ap-southeast-1": {
236-
"HVM64": "ami-7a60c119",
236+
"HVM64": "ami-0e41e26d",
237237
"HVMG2": "NOT_SUPPORTED"
238238
},
239239
"ap-southeast-2": {
240-
"HVM64": "ami-869aa7e5",
240+
"HVM64": "ami-a2b986c1",
241241
"HVMG2": "NOT_SUPPORTED"
242242
},
243243
"eu-central-1": {
244-
"HVM64": "ami-922ed6fd",
244+
"HVM64": "ami-49995c26",
245245
"HVMG2": "NOT_SUPPORTED"
246246
},
247247
"eu-west-1": {
248-
"HVM64": "ami-6af5bd19",
248+
"HVM64": "ami-029ccc71",
249249
"HVMG2": "NOT_SUPPORTED"
250250
},
251251
"sa-east-1": {
252-
"HVM64": "ami-3cc35f50",
252+
"HVM64": "ami-d67ce3ba",
253253
"HVMG2": "NOT_SUPPORTED"
254254
},
255255
"us-east-1": {
256-
"HVM64": "ami-24ffa133",
256+
"HVM64": "ami-8ba48d9c",
257257
"HVMG2": "NOT_SUPPORTED"
258258
},
259259
"us-east-2": {
260-
"HVM64": "ami-d95a00bc",
260+
"HVM64": "ami-12782277",
261261
"HVMG2": "NOT_SUPPORTED"
262-
},
263-
"us-west-1": {
264-
"HVM64": "ami-9ab0fbfa",
262+
},"us-west-1": {
263+
"HVM64": "ami-6b91c40b",
265264
"HVMG2": "NOT_SUPPORTED"
266265
},
267266
"us-west-2": {
268-
"HVM64": "ami-6d22850d",
267+
"HVM64": "ami-7a5efc1a",
269268
"HVMG2": "NOT_SUPPORTED"
270269
}
271270
}
@@ -548,14 +547,22 @@
548547
"echo \"localhost: ", {"Ref": "ExternalLoadBalancer"}, "\" >> /var/lib/docker/swarm/elb.config\n",
549548
"echo \"default: ", {"Ref": "ExternalLoadBalancer"}, "\" >> /var/lib/docker/swarm/elb.config\n",
550549
"export DOCKER_FOR_IAAS_VERSION='", { "Fn::FindInMap" : [ "DockerForAWS", "version", "forAws" ] }, "'\n",
551-
"echo '{\"log-driver\": \"awslogs\",\"log-opts\": {\"awslogs-group\":\"",
550+
"export LOCAL_IP=$(wget -qO- http://169.254.169.254/latest/meta-data/local-ipv4)\n",
551+
"echo '{\"experimental\": true, \"log-driver\": \"awslogs\",\"log-opts\": {\"awslogs-group\":\"",
552552
{ "Fn::Join": [ "-", [ { "Ref": "AWS::StackName"}, "lg" ] ] },
553553
"\" }}' > /etc/docker/daemon.json \n",
554554
"chown -R docker /home/docker/\n",
555555
"chgrp -R docker /home/docker/\n",
556556
"rc-service docker restart\n",
557557
"sleep 5\n",
558558

559+
"docker run --log-driver=json-file --name=meta-aws --restart=always -d -p $LOCAL_IP:9024:8080 ",
560+
"-e AWS_REGION='",{ "Ref" : "AWS::Region" }, "' ",
561+
"-e MANAGER_SECURITY_GROUP_ID='",{ "Ref" : "ManagerVpcSG" }, "' ",
562+
"-e WORKER_SECURITY_GROUP_ID='",{ "Ref" : "NodeVpcSG" }, "' ",
563+
"-v /var/run/docker.sock:/var/run/docker.sock ",
564+
"docker4x/meta-aws:$DOCKER_FOR_IAAS_VERSION metaserver -flavor=aws\n",
565+
559566
"docker run --log-driver=json-file --restart=no -d ",
560567
"-e DYNAMODB_TABLE='", { "Ref" : "SwarmDynDBTable" } , "' ",
561568
"-e NODE_TYPE='manager' ",
@@ -686,7 +693,7 @@
686693
"", [
687694
"#!/bin/sh\n",
688695
"export DOCKER_FOR_IAAS_VERSION='", { "Fn::FindInMap" : [ "DockerForAWS", "version", "forAws" ] }, "'\n",
689-
"echo '{\"log-driver\": \"awslogs\",\"log-opts\": {\"awslogs-group\":\"",
696+
"echo '{\"experimental\": true, \"log-driver\": \"awslogs\",\"log-opts\": {\"awslogs-group\":\"",
690697
{ "Fn::Join": [ "-", [ { "Ref": "AWS::StackName"}, "lg" ] ] },
691698
"\" }}' > /etc/docker/daemon.json \n",
692699
"chown -R docker /home/docker/\n",

aws/cloudformation/docker_for_aws_cloud.json

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"AWSTemplateFormatVersion": "2010-09-09",
33

4-
"Description": "Docker for AWS Beta 10 (docker 1.12.3) Cloud",
4+
"Description": "Docker for AWS 1.13.0-rc1 (alpha11) Cloud",
55

66
"Parameters": {
77
"KeyName": {
@@ -95,8 +95,8 @@
9595

9696
"DockerForAWS" : {
9797
"version" : {
98-
"docker": "1.12.3",
99-
"forAws": "aws-v1.12.3-beta10"
98+
"docker": "1.13.0-rc1",
99+
"forAws": "aws-v1.13.0-rc1-alpha11"
100100
}
101101
},
102102

@@ -245,51 +245,50 @@
245245
},
246246
"AWSRegionArch2AMI": {
247247
"ap-northeast-1": {
248-
"HVM64": "ami-d3d271b2",
248+
"HVM64": "ami-d1b318b0",
249249
"HVMG2": "NOT_SUPPORTED"
250250
},
251251
"ap-northeast-2": {
252-
"HVM64": "ami-5e31e530",
252+
"HVM64": "ami-4f914621",
253253
"HVMG2": "NOT_SUPPORTED"
254254
},
255255
"ap-south-1": {
256-
"HVM64": "ami-d24b3fbd",
256+
"HVM64": "ami-19e79376",
257257
"HVMG2": "NOT_SUPPORTED"
258258
},
259259
"ap-southeast-1": {
260-
"HVM64": "ami-7a60c119",
260+
"HVM64": "ami-0e41e26d",
261261
"HVMG2": "NOT_SUPPORTED"
262262
},
263263
"ap-southeast-2": {
264-
"HVM64": "ami-869aa7e5",
264+
"HVM64": "ami-a2b986c1",
265265
"HVMG2": "NOT_SUPPORTED"
266266
},
267267
"eu-central-1": {
268-
"HVM64": "ami-922ed6fd",
268+
"HVM64": "ami-49995c26",
269269
"HVMG2": "NOT_SUPPORTED"
270270
},
271271
"eu-west-1": {
272-
"HVM64": "ami-6af5bd19",
272+
"HVM64": "ami-029ccc71",
273273
"HVMG2": "NOT_SUPPORTED"
274274
},
275275
"sa-east-1": {
276-
"HVM64": "ami-3cc35f50",
276+
"HVM64": "ami-d67ce3ba",
277277
"HVMG2": "NOT_SUPPORTED"
278278
},
279279
"us-east-1": {
280-
"HVM64": "ami-24ffa133",
280+
"HVM64": "ami-8ba48d9c",
281281
"HVMG2": "NOT_SUPPORTED"
282282
},
283283
"us-east-2": {
284-
"HVM64": "ami-d95a00bc",
284+
"HVM64": "ami-12782277",
285285
"HVMG2": "NOT_SUPPORTED"
286-
},
287-
"us-west-1": {
288-
"HVM64": "ami-9ab0fbfa",
286+
},"us-west-1": {
287+
"HVM64": "ami-6b91c40b",
289288
"HVMG2": "NOT_SUPPORTED"
290289
},
291290
"us-west-2": {
292-
"HVM64": "ami-6d22850d",
291+
"HVM64": "ami-7a5efc1a",
293292
"HVMG2": "NOT_SUPPORTED"
294293
}
295294
}
@@ -573,14 +572,22 @@
573572
"echo \"localhost: ", {"Ref": "ExternalLoadBalancer"}, "\" >> /var/lib/docker/swarm/elb.config\n",
574573
"echo \"default: ", {"Ref": "ExternalLoadBalancer"}, "\" >> /var/lib/docker/swarm/elb.config\n",
575574
"export DOCKER_FOR_IAAS_VERSION='", { "Fn::FindInMap" : [ "DockerForAWS", "version", "forAws" ] }, "'\n",
576-
"echo '{\"log-driver\": \"awslogs\",\"log-opts\": {\"awslogs-group\":\"",
575+
"export LOCAL_IP=$(wget -qO- http://169.254.169.254/latest/meta-data/local-ipv4)\n",
576+
"echo '{\"experimental\": true, \"log-driver\": \"awslogs\",\"log-opts\": {\"awslogs-group\":\"",
577577
{ "Fn::Join": [ "-", [ { "Ref": "AWS::StackName"}, "lg" ] ] },
578578
"\" }}' > /etc/docker/daemon.json \n",
579579
"chown -R docker /home/docker/\n",
580580
"chgrp -R docker /home/docker/\n",
581581
"rc-service docker restart\n",
582582
"sleep 5\n",
583583

584+
"docker run --log-driver=json-file --name=meta-aws --restart=always -d -p $LOCAL_IP:9024:8080 ",
585+
"-e AWS_REGION='",{ "Ref" : "AWS::Region" }, "' ",
586+
"-e MANAGER_SECURITY_GROUP_ID='",{ "Ref" : "ManagerVpcSG" }, "' ",
587+
"-e WORKER_SECURITY_GROUP_ID='",{ "Ref" : "NodeVpcSG" }, "' ",
588+
"-v /var/run/docker.sock:/var/run/docker.sock ",
589+
"docker4x/meta-aws:$DOCKER_FOR_IAAS_VERSION metaserver -flavor=aws\n",
590+
584591
"docker run --log-driver=json-file --restart=no -d ",
585592
"-e DYNAMODB_TABLE='", { "Ref" : "SwarmDynDBTable" } , "' ",
586593
"-e NODE_TYPE='manager' ",
@@ -722,7 +729,7 @@
722729
"", [
723730
"#!/bin/sh\n",
724731
"export DOCKER_FOR_IAAS_VERSION='", { "Fn::FindInMap" : [ "DockerForAWS", "version", "forAws" ] }, "'\n",
725-
"echo '{\"log-driver\": \"awslogs\",\"log-opts\": {\"awslogs-group\":\"",
732+
"echo '{\"experimental\": true, \"log-driver\": \"awslogs\",\"log-opts\": {\"awslogs-group\":\"",
726733
{ "Fn::Join": [ "-", [ { "Ref": "AWS::StackName"}, "lg" ] ] },
727734
"\" }}' > /etc/docker/daemon.json \n",
728735
"chown -R docker /home/docker/\n",

aws/cloudformation/docker_for_aws_ddc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@
574574
"echo \"localhost: ", {"Ref": "ExternalLoadBalancer"}, "\" >> /var/lib/docker/swarm/elb.config\n",
575575
"echo \"default: ", {"Ref": "ExternalLoadBalancer"}, "\" >> /var/lib/docker/swarm/elb.config\n",
576576
"export DOCKER_FOR_IAAS_VERSION='", { "Fn::FindInMap" : [ "DockerForAWS", "version", "forAws" ] }, "'\n",
577+
"export LOCAL_IP=$(wget -qO- http://169.254.169.254/latest/meta-data/local-ipv4)\n",
577578
"echo '{\"log-driver\": \"awslogs\",\"log-opts\": {\"awslogs-group\":\"",
578579
{ "Fn::Join": [ "-", [ { "Ref": "AWS::StackName"}, "lg" ] ] },
579580
"\" }}' > /etc/docker/daemon.json \n",
@@ -582,6 +583,13 @@
582583
"rc-service docker restart\n",
583584
"sleep 5\n",
584585

586+
"docker run --log-driver=json-file --name=meta-aws --restart=always -d -p $LOCAL_IP:9024:8080 ",
587+
"-e AWS_REGION='",{ "Ref" : "AWS::Region" }, "' ",
588+
"-e MANAGER_SECURITY_GROUP_ID='",{ "Ref" : "ManagerVpcSG" }, "' ",
589+
"-e WORKER_SECURITY_GROUP_ID='",{ "Ref" : "NodeVpcSG" }, "' ",
590+
"-v /var/run/docker.sock:/var/run/docker.sock ",
591+
"docker4x/meta-aws:$DOCKER_FOR_IAAS_VERSION metaserver -flavor=aws\n",
592+
585593
"docker run --log-driver=json-file --restart=no -d ",
586594
"-e DYNAMODB_TABLE='", { "Ref" : "SwarmDynDBTable" } , "' ",
587595
"-e NODE_TYPE='manager' ",

aws/dockerfiles/Dockerfile.guide

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ ADD files/guide/crontab.txt /usr/docker/crontab.txt
1818
ADD files/guide/watcher.sh /usr/bin
1919
ADD files/guide/cleanup.sh /usr/bin
2020
ADD files/guide/buoy.sh /usr/bin
21-
ADD files/guide/refresh.sh /usr/bin
2221
ADD files/bin/buoy /usr/bin
2322
COPY files/guide/entry.sh /entry.sh
2423
RUN chmod 755 /usr/bin/watcher.sh /entry.sh /usr/bin/cleanup.sh \
25-
/usr/bin/buoy /usr/bin/buoy.sh /usr/bin/refresh.sh
24+
/usr/bin/buoy /usr/bin/buoy.sh
2625
RUN /usr/bin/crontab /usr/docker/crontab.txt
2726

2827
CMD ["/entry.sh"]

aws/dockerfiles/files/guide/crontab.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
*/1 * * * * /usr/bin/watcher.sh >> /var/log/docker/watcher.log
33
*/5 * * * * /usr/bin/cleanup.sh >> /var/log/docker/cleanup.log
44
24 * * * * /usr/bin/buoy.sh >> /var/log/docker/buoy.log
5-
42 * * * * /usr/bin/refresh.sh >> /var/log/docker/refresh.log

aws/dockerfiles/files/guide/refresh.sh

Lines changed: 0 additions & 39 deletions
This file was deleted.

aws/dockerfiles/files/guide/watcher.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ if [ "$NODE_TYPE" == "manager" ] ; then
8383

8484
MANAGER=$(aws dynamodb get-item --region $REGION --table-name $DYNAMODB_TABLE --key '{"node_type":{"S": "primary_manager"}}')
8585
export CURRENT_MANAGER_IP=$(echo $MANAGER | jq -r '.Item.ip.S')
86-
export MANAGER_TOKEN=$(echo $MANAGER | jq -r '.Item.manager_token.S')
87-
export WORKER_TOKEN=$(echo $MANAGER | jq -r '.Item.worker_token.S')
88-
echo "MANAGER_TOKEN=$MANAGER_TOKEN"
89-
echo "WORKER_TOKEN=$WORKER_TOKEN"
9086

9187
echo "Current manager IP = $CURRENT_MANAGER_IP ; my IP = $MYIP"
9288

@@ -154,7 +150,7 @@ if [ "$NODE_TYPE" == "manager" ] ; then
154150
aws dynamodb put-item \
155151
--table-name $DYNAMODB_TABLE \
156152
--region $REGION \
157-
--item '{"node_type":{"S": "primary_manager"},"ip": {"S":"'"$NEW_MANAGER_IP"'"},"manager_token": {"S":"'"$MANAGER_TOKEN"'"},"worker_token": {"S":"'"$WORKER_TOKEN"'"}}' \
153+
--item '{"node_type":{"S": "primary_manager"},"ip": {"S":"'"$NEW_MANAGER_IP"'"}}' \
158154
--return-consumed-capacity TOTAL
159155
fi
160156
fi

0 commit comments

Comments
 (0)