ufo 3.5.7 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (191) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/Gemfile.lock +16 -10
  4. data/README.md +12 -13
  5. data/docs/_config.yml +1 -1
  6. data/docs/_docs/auto-completion.md +4 -4
  7. data/docs/_docs/automated-cleanup.md +1 -1
  8. data/docs/_docs/conventions.md +7 -7
  9. data/docs/_docs/customize-cloudformation.md +36 -0
  10. data/docs/_docs/faq.md +9 -7
  11. data/docs/_docs/fargate.md +102 -0
  12. data/docs/_docs/helpers.md +3 -3
  13. data/docs/_docs/load-balancer.md +72 -0
  14. data/docs/_docs/migrations.md +2 -2
  15. data/docs/_docs/next-steps.md +2 -2
  16. data/docs/_docs/params.md +12 -41
  17. data/docs/_docs/route53-support.md +28 -0
  18. data/docs/_docs/run-in-pieces.md +2 -2
  19. data/docs/_docs/security-groups.md +54 -0
  20. data/docs/_docs/settings-cfn.md +11 -0
  21. data/docs/_docs/settings-network.md +34 -0
  22. data/docs/_docs/settings.md +18 -15
  23. data/docs/_docs/single-task.md +3 -3
  24. data/docs/_docs/ssl-support.md +42 -0
  25. data/docs/_docs/structure.md +5 -1
  26. data/docs/_docs/stuck-cloudformation.md +30 -0
  27. data/docs/_docs/tutorial-ufo-docker-build.md +19 -31
  28. data/docs/_docs/tutorial-ufo-init.md +16 -12
  29. data/docs/_docs/tutorial-ufo-ship.md +50 -54
  30. data/docs/_docs/tutorial-ufo-ships.md +9 -7
  31. data/docs/_docs/tutorial-ufo-tasks-build.md +26 -17
  32. data/docs/_docs/ufo-current.md +50 -0
  33. data/docs/_docs/ufo-env-extra.md +21 -0
  34. data/docs/_docs/ufo-env.md +6 -13
  35. data/docs/_docs/ufo-tasks-register.md +3 -3
  36. data/docs/_docs/upgrade4.md +49 -0
  37. data/docs/_docs/variables.md +5 -5
  38. data/docs/_docs/why-cloudformation.md +22 -0
  39. data/docs/_includes/about.html +1 -1
  40. data/docs/_includes/cfn-customize.md +39 -0
  41. data/docs/_includes/commands.html +6 -6
  42. data/docs/_includes/css/ufo.css +1 -0
  43. data/docs/_includes/example.html +13 -13
  44. data/docs/_includes/reference.md +1 -1
  45. data/docs/_includes/subnav.html +22 -5
  46. data/docs/_includes/ufo-ship-options.md +7 -6
  47. data/docs/_reference/ufo-apps.md +36 -0
  48. data/docs/_reference/ufo-cancel.md +24 -0
  49. data/docs/_reference/ufo-completion.md +1 -1
  50. data/docs/_reference/ufo-completion_script.md +1 -1
  51. data/docs/_reference/ufo-current.md +93 -0
  52. data/docs/_reference/ufo-deploy.md +18 -17
  53. data/docs/_reference/ufo-destroy.md +6 -4
  54. data/docs/_reference/ufo-docker-base.md +7 -7
  55. data/docs/_reference/ufo-docker-build.md +9 -9
  56. data/docs/_reference/ufo-docker-clean.md +8 -8
  57. data/docs/_reference/ufo-docker-name.md +4 -4
  58. data/docs/_reference/ufo-docker.md +4 -2
  59. data/docs/_reference/ufo-init.md +31 -20
  60. data/docs/_reference/ufo-network-help.md +15 -0
  61. data/docs/_reference/ufo-network-init.md +38 -0
  62. data/docs/_reference/ufo-network.md +26 -0
  63. data/docs/_reference/ufo-ps.md +53 -0
  64. data/docs/_reference/ufo-releases.md +40 -0
  65. data/docs/_reference/ufo-resources.md +44 -0
  66. data/docs/_reference/ufo-rollback.md +59 -0
  67. data/docs/_reference/ufo-scale.md +23 -3
  68. data/docs/_reference/ufo-ship.md +54 -27
  69. data/docs/_reference/ufo-ships.md +17 -26
  70. data/docs/_reference/ufo-stop.md +31 -0
  71. data/docs/_reference/ufo-task.md +15 -16
  72. data/docs/_reference/ufo-tasks-build.md +10 -10
  73. data/docs/_reference/ufo-tasks-register.md +3 -3
  74. data/docs/_reference/ufo-tasks.md +1 -1
  75. data/docs/_reference/ufo-upgrade-help.md +15 -0
  76. data/docs/_reference/ufo-upgrade-v2to3.md +15 -0
  77. data/docs/_reference/ufo-upgrade-v3_3to3_4.md +15 -0
  78. data/docs/_reference/ufo-upgrade-v3to4.md +27 -0
  79. data/docs/_reference/ufo-upgrade.md +28 -0
  80. data/docs/_reference/ufo-version.md +1 -1
  81. data/docs/articles.md +2 -2
  82. data/docs/docs.md +1 -1
  83. data/docs/img/docs/cloudformation-resources.png +0 -0
  84. data/docs/img/tutorials/ecs-console-task-definitions.png +0 -0
  85. data/docs/img/tutorials/ecs-console-ufo-ship.png +0 -0
  86. data/docs/img/tutorials/ecs-console-ufo-ships.png +0 -0
  87. data/docs/quick-start.md +21 -9
  88. data/docs/reference.md +10 -2
  89. data/exe/ufo +1 -1
  90. data/lib/cfn/stack.yml +259 -0
  91. data/lib/template/.ufo/params.yml.tt +21 -60
  92. data/lib/template/.ufo/settings.yml.tt +6 -1
  93. data/lib/template/.ufo/settings/cfn/default.yml.tt +55 -0
  94. data/lib/template/.ufo/settings/network/default.yml.tt +18 -0
  95. data/lib/template/.ufo/task_definitions.rb.tt +7 -6
  96. data/lib/template/.ufo/templates/fargate.json.erb +1 -1
  97. data/lib/template/.ufo/templates/main.json.erb +1 -0
  98. data/lib/template/.ufo/variables/base.rb.tt +5 -2
  99. data/lib/template/Dockerfile +10 -15
  100. data/lib/template/bin/deploy.tt +2 -2
  101. data/lib/ufo.rb +29 -20
  102. data/lib/ufo/apps.rb +49 -0
  103. data/lib/ufo/apps/cfn_map.rb +70 -0
  104. data/lib/ufo/apps/service.rb +56 -0
  105. data/lib/ufo/aws_service.rb +15 -6
  106. data/lib/ufo/base.rb +32 -0
  107. data/lib/ufo/cancel.rb +23 -0
  108. data/lib/ufo/cli.rb +91 -27
  109. data/lib/ufo/core.rb +35 -3
  110. data/lib/ufo/current.rb +104 -0
  111. data/lib/ufo/destroy.rb +10 -41
  112. data/lib/ufo/docker/builder.rb +5 -4
  113. data/lib/ufo/docker/cleaner.rb +1 -1
  114. data/lib/ufo/docker/pusher.rb +2 -2
  115. data/lib/ufo/ecr/cleaner.rb +1 -1
  116. data/lib/ufo/help/apps.md +12 -0
  117. data/lib/ufo/help/balancer.md +3 -0
  118. data/lib/ufo/help/current.md +65 -0
  119. data/lib/ufo/help/deploy.md +4 -4
  120. data/lib/ufo/help/destroy.md +3 -3
  121. data/lib/ufo/help/docker.md +3 -1
  122. data/lib/ufo/help/docker/base.md +7 -7
  123. data/lib/ufo/help/docker/build.md +9 -9
  124. data/lib/ufo/help/docker/clean.md +8 -8
  125. data/lib/ufo/help/docker/name.md +4 -4
  126. data/lib/ufo/help/help.md +5 -0
  127. data/lib/ufo/help/init.md +24 -16
  128. data/lib/ufo/help/network/init.md +13 -0
  129. data/lib/ufo/help/ps.md +27 -0
  130. data/lib/ufo/help/releases.md +16 -0
  131. data/lib/ufo/help/resources.md +20 -0
  132. data/lib/ufo/help/rollback.md +35 -0
  133. data/lib/ufo/help/scale.md +22 -2
  134. data/lib/ufo/help/ship.md +40 -14
  135. data/lib/ufo/help/ships.md +4 -13
  136. data/lib/ufo/help/stop.md +7 -0
  137. data/lib/ufo/help/task.md +9 -9
  138. data/lib/ufo/help/tasks/build.md +10 -10
  139. data/lib/ufo/help/tasks/register.md +3 -3
  140. data/lib/ufo/help/upgrade/v3to4.md +3 -0
  141. data/lib/ufo/info.rb +62 -0
  142. data/lib/ufo/init.rb +36 -23
  143. data/lib/ufo/log_group.rb +2 -1
  144. data/lib/ufo/network.rb +24 -0
  145. data/lib/ufo/network/fetch.rb +41 -0
  146. data/lib/ufo/network/helper.rb +23 -0
  147. data/lib/ufo/network/init.rb +26 -0
  148. data/lib/ufo/param.rb +5 -5
  149. data/lib/ufo/ps.rb +102 -0
  150. data/lib/ufo/ps/task.rb +78 -0
  151. data/lib/ufo/releases.rb +14 -0
  152. data/lib/ufo/rollback.rb +53 -0
  153. data/lib/ufo/scale.rb +6 -12
  154. data/lib/ufo/sequence.rb +7 -0
  155. data/lib/ufo/setting.rb +7 -6
  156. data/lib/ufo/setting/profile.rb +24 -0
  157. data/lib/ufo/ship.rb +35 -326
  158. data/lib/ufo/stack.rb +203 -0
  159. data/lib/ufo/stack/context.rb +242 -0
  160. data/lib/ufo/stack/helper.rb +28 -0
  161. data/lib/ufo/stack/status.rb +195 -0
  162. data/lib/ufo/stop.rb +47 -0
  163. data/lib/ufo/task.rb +96 -15
  164. data/lib/ufo/tasks/register.rb +1 -1
  165. data/lib/ufo/template_scope.rb +81 -7
  166. data/lib/ufo/upgrade.rb +32 -0
  167. data/lib/ufo/{upgrade3.rb → upgrade/upgrade3.rb} +1 -1
  168. data/lib/ufo/{upgrade33_to_34.rb → upgrade/upgrade33to34.rb} +2 -2
  169. data/lib/ufo/upgrade/upgrade4.rb +161 -0
  170. data/lib/ufo/util.rb +19 -6
  171. data/lib/ufo/version.rb +1 -1
  172. data/spec/fixtures/apps/describe_services.json +96 -0
  173. data/spec/fixtures/cfn/stack-events-complete.json +1080 -0
  174. data/spec/fixtures/cfn/stack-events-in-progress.json +1080 -0
  175. data/spec/fixtures/cfn/stack-events-update-rollback-complete.json +1086 -0
  176. data/spec/fixtures/deployments.json +50 -0
  177. data/spec/fixtures/ps/describe_tasks.json +58 -0
  178. data/spec/fixtures/settings.yml +2 -0
  179. data/spec/lib/apps_spec.rb +20 -0
  180. data/spec/lib/cli_spec.rb +4 -4
  181. data/spec/lib/ps_spec.rb +14 -0
  182. data/spec/lib/setting_spec.rb +2 -1
  183. data/spec/lib/ship_spec.rb +6 -30
  184. data/spec/lib/stack/status_spec.rb +76 -0
  185. data/spec/lib/stop_spec.rb +13 -0
  186. data/spec/lib/task_spec.rb +5 -2
  187. data/spec/spec_helper.rb +1 -1
  188. data/ufo.gemspec +2 -0
  189. metadata +120 -6
  190. data/docs/_reference/ufo-upgrade3.md +0 -23
  191. data/docs/_reference/ufo-upgrade3_3_to_3_4.md +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a92a1e685c66f63854b015ea62abb3be7f54c3af1b2cf68ca9505b414fe8978c
4
- data.tar.gz: 125983ffbc6084d126f05a684763b1ceeab38730eb2ea8cb778e662dbe9db7b7
3
+ metadata.gz: 46e9fa39991b473e75366ff36d1242c58f1047235b104adf162391cc474e62ed
4
+ data.tar.gz: b25f887523643b7a3d0989c252c5d2aa6331ecc115d4ca40867b152c146d278e
5
5
  SHA512:
6
- metadata.gz: 912de3bf9af0666505868a5d7d3f12b42834a1a6116cf5175e37f6d169d9e67a2a2a264f42aebee194680522f76737f286751412d693e4825a9c53b50ffd1e23
7
- data.tar.gz: 14118ce031dccaf4488c4762b582f53ad7d6cf8c304ddff81b1f2305e3bce88f83ba4c55085306e1366c9cef5e21b3d982d2a9dad969269b0f01695aae456b98
6
+ metadata.gz: 6073c2fe4317cde44b9e79591d40d4146ecf1c647d5e6510b6ba05a63edf0c1b73add68c7210df8820fdb6ccabf33fa4bf17ffc20ec818d0a47bc10d2b38cf41
7
+ data.tar.gz: db44342f65e164817149609fac6316d8e9262e79a7f3d80c4152c322ebb03dd2b1818dce3deef059aa6b1045c23efcf6965a53860043f3a142a76faa3eaecf37
@@ -3,6 +3,30 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [4.0.0-prelease]
7
+ - Major architecture changes
8
+ - Fuller CLI Toolkit Commands
9
+ - Load Balancer Support
10
+ - Updated Tutorial Guide
11
+ - Security Groups
12
+ - Improved Fargate Support
13
+ - Extra Env Support
14
+ - CloudFormation Implementation
15
+ - Upgrade Guide
16
+ - ECS service created by CloudFormation now
17
+ - ELB support: both application and network ELBs
18
+ - Route53 support: associates ELB with DNS record
19
+ - UFO_ENV_EXTRA concept introduced
20
+ - Many additional CLI commands:
21
+ - ufo apps
22
+ - ufo cancel
23
+ - ufo current
24
+ - ufo network
25
+ - ufo ps
26
+ - ufo releases
27
+ - ufo resources
28
+ - ufo rollback
29
+
6
30
  ## [3.5.7]
7
31
  - display aws ecs run-task command
8
32
  - fix ufo init in help menu
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ufo (3.5.5)
4
+ ufo (4.0.0)
5
+ aws-sdk-cloudformation
5
6
  aws-sdk-cloudwatchlogs
6
7
  aws-sdk-ec2
7
8
  aws-sdk-ecr
@@ -12,6 +13,7 @@ PATH
12
13
  memoist
13
14
  plissken
14
15
  render_me_pretty
16
+ text-table
15
17
  thor
16
18
 
17
19
  GEM
@@ -22,29 +24,32 @@ GEM
22
24
  i18n (>= 0.7, < 2)
23
25
  minitest (~> 5.1)
24
26
  tzinfo (~> 1.1)
25
- aws-eventstream (1.0.0)
26
- aws-partitions (1.87.0)
27
- aws-sdk-cloudwatchlogs (1.3.0)
27
+ aws-eventstream (1.0.1)
28
+ aws-partitions (1.95.0)
29
+ aws-sdk-cloudformation (1.6.0)
28
30
  aws-sdk-core (~> 3)
29
31
  aws-sigv4 (~> 1.0)
30
- aws-sdk-core (3.21.2)
32
+ aws-sdk-cloudwatchlogs (1.4.0)
33
+ aws-sdk-core (~> 3)
34
+ aws-sigv4 (~> 1.0)
35
+ aws-sdk-core (3.22.1)
31
36
  aws-eventstream (~> 1.0)
32
37
  aws-partitions (~> 1.0)
33
38
  aws-sigv4 (~> 1.0)
34
39
  jmespath (~> 1.0)
35
- aws-sdk-ec2 (1.34.0)
40
+ aws-sdk-ec2 (1.37.0)
36
41
  aws-sdk-core (~> 3)
37
42
  aws-sigv4 (~> 1.0)
38
- aws-sdk-ecr (1.3.0)
43
+ aws-sdk-ecr (1.4.0)
39
44
  aws-sdk-core (~> 3)
40
45
  aws-sigv4 (~> 1.0)
41
- aws-sdk-ecs (1.13.0)
46
+ aws-sdk-ecs (1.15.0)
42
47
  aws-sdk-core (~> 3)
43
48
  aws-sigv4 (~> 1.0)
44
- aws-sdk-elasticloadbalancingv2 (1.9.0)
49
+ aws-sdk-elasticloadbalancingv2 (1.11.0)
45
50
  aws-sdk-core (~> 3)
46
51
  aws-sigv4 (~> 1.0)
47
- aws-sigv4 (1.0.2)
52
+ aws-sigv4 (1.0.3)
48
53
  byebug (10.0.2)
49
54
  cli_markdown (0.1.0)
50
55
  codeclimate-test-reporter (1.0.8)
@@ -84,6 +89,7 @@ GEM
84
89
  json (>= 1.8, < 3)
85
90
  simplecov-html (~> 0.10.0)
86
91
  simplecov-html (0.10.2)
92
+ text-table (1.2.4)
87
93
  thor (0.20.0)
88
94
  thread_safe (0.3.6)
89
95
  tilt (2.0.8)
data/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
  [![Join the chat at https://gitter.im/tongueroo/ufo](https://badges.gitter.im/tongueroo/ufo.svg)](https://gitter.im/tongueroo/ufo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
9
9
  [![Support](https://img.shields.io/badge/get-support-blue.svg)](https://boltops.com?utm_source=badge&utm_medium=badge&utm_campaign=ufo)
10
10
 
11
- Ufo is an tool that eases the building and deployment of docker images to [AWS ECS](https://aws.amazon.com/ecs/). The main command is `ufo ship`. Here's summary of what it does:
11
+ Ufo is a tool that eases the building and deployment of Docker images to [AWS ECS](https://aws.amazon.com/ecs/). The main command is `ufo ship`. Here's summary of what it does:
12
12
 
13
13
  1. Builds a docker image. 
14
14
  2. Generates and registers the ECS template definition. 
@@ -20,30 +20,29 @@ See [ufoships.com](http://ufoships.com) for full documentation.
20
20
 
21
21
  ## Important
22
22
 
23
- If you are on version 2, you can run `ufo upgrade3` within your project to upgrade it to version 3. Refer to the [CHANGELOG](CHANGELOG.md).
23
+ If you are on version 3, you can run `ufo upgrade v3to4` within your project to upgrade it to version 4. Refer to the [CHANGELOG](CHANGELOG.md).
24
24
 
25
25
  ## Installation
26
26
 
27
- ```sh
28
- gem install ufo
29
- ```
27
+ gem install ufo
30
28
 
31
29
  Full installation instructions are at [Install Ufo](http://ufoships.com/docs/install/).
32
30
 
33
31
  ## Quick Start
34
32
 
35
- To quickly demonstrate how simple it is to use ufo we will use an example app from [tongueroo/hi](https://github.com/tongueroo/ufo). The app is a barebones sinatra app. Here are the steps:
33
+ To quickly demonstrate how simple it is to use ufo we will use an example app from [tongueroo/demo-ufo](https://github.com/tongueroo/demo-ufo). The app is a barebones sinatra app. Here are the steps:
36
34
 
37
- ```sh
38
- gem install ufo
39
- git clone https:///github.com/tongueroo/hi.git
40
- cd hi
41
- ufo init --app=hi --image=tongueroo/hi
42
- ufo ship hi-web
43
- ```
35
+ gem install ufo
36
+ git clone https:///github.com/tongueroo/demo-ufo.git demo
37
+ cd demo
38
+ ufo init --app=demo --image=tongueroo/demo-ufo
39
+ ufo ship demo-web
44
40
 
45
41
  Congratulations, you have successfully used ufo to deploy to an ECS service.
46
42
 
43
+ ## Load Balancer Support
44
+
45
+ Ufo can also create a load balancer as part of creating the ECS service if you wish. Underneath the hood, ufo uses CloudFormation to create the load balancer. More information can be found at the [load balancer support docs](http://ufoships.com/docs/load-balancer/).
47
46
 
48
47
  ## Articles
49
48
 
@@ -2,7 +2,7 @@
2
2
  title: Ufo
3
3
  email: tongueroo@gmail.com
4
4
  url: http://ufoships.com
5
- description: "Easy Way to Build and Ship Docker Images to AWS ECS"
5
+ description: "AWS ECS Deployment Tool"
6
6
  keywords: "AWS EC2 Container Service, AWS ECS, UFO, Deploy to ECS, ufo ship"
7
7
  skills: ""
8
8
  meta_author: Tung Nguyen
@@ -15,8 +15,8 @@ Auto Completion examples:
15
15
  ```
16
16
  ufo [TAB]
17
17
  ufo ship [TAB]
18
- ufo ship hi-web [TAB]
19
- ufo ship hi-web --[TAB]
18
+ ufo ship demo-web [TAB]
19
+ ufo ship demo-web --[TAB]
20
20
  ufo ship --[TAB]
21
21
  ufo docker [TAB]
22
22
  ufo docker build [TAB]
@@ -24,6 +24,6 @@ ufo tasks [TAB]
24
24
  ufo tasks build [TAB]
25
25
  ```
26
26
 
27
- <a id="prev" class="btn btn-basic" href="{% link _docs/conventions.md %}">Back</a>
28
- <a id="next" class="btn btn-primary" href="{% link _docs/run-in-pieces.md %}">Next Step</a>
27
+ <a id="prev" class="btn btn-basic" href="{% link _docs/automated-cleanup.md %}">Back</a>
28
+ <a id="next" class="btn btn-primary" href="{% link articles.md %}">Next Step</a>
29
29
  <p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
@@ -11,5 +11,5 @@ ecr_keep: 30
11
11
  Automated Docker images clean up only works if you are using ECR registry.
12
12
 
13
13
  <a id="prev" class="btn btn-basic" href="{% link _docs/migrations.md %}">Back</a>
14
- <a id="next" class="btn btn-primary" href="{% link _docs/next-steps.md %}">Next Step</a>
14
+ <a id="next" class="btn btn-primary" href="{% link _docs/auto-completion.md %}">Next Step</a>
15
15
  <p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
@@ -13,7 +13,7 @@ By default, the ECS cluster value is the same as UFO_ENV's value. So if `UFO_EN
13
13
  Ufo assumes a convention that service\_name and the task\_name are the same. If you would like to override this convention, then you can specify the task name.
14
14
 
15
15
  ```
16
- ufo ship hi-web --task my-task
16
+ ufo ship demo-web --task my-task
17
17
  ```
18
18
 
19
19
  This means that in the task_definition.rb you will also define it with `my-task`. For example:
@@ -29,20 +29,20 @@ end
29
29
 
30
30
  ```
31
31
 
32
- ## Web Role Convention
32
+ ## Web Service Load Balancer Convention
33
33
 
34
- By convention, if the service has a container named "web", you'll get prompted to create an ELB and specify a target group ARN. If you would like to name a service with the word "web" in it without having to use an ELB target group then you can use the `--no-target-group-prompt`. Example:
34
+ By convention, if the service has a container named "web", ufo will automatically create an ELB. If you would like to name a service with the word "web" without an ELB, specify `--elb false`. Example:
35
35
 
36
36
  ```sh
37
- ufo ship hi-web --no-target-group-prompt
37
+ ufo ship demo-web --elb false
38
38
  ```
39
39
 
40
- You can also bypass the prompt by specifying the target group ARN as part of the command upfront. The ELB and target group must already exist. The ELB target group only gets associated when the service gets created for the first time. If the service already exists then the `--target-group` parameter just gets ignored and the ECS task simply gets updated. Example:
40
+ You can also use an existing ELB by specifying the target group arn as the value of the `--elb` option. Example:
41
41
 
42
42
  ```bash
43
- ufo ship hi-web --target-group=arn:aws:elasticloadbalancing:us-east-1:12345689:targetgroup/hi-web/12345
43
+ ufo ship demo-web --elb arn:aws:elasticloadbalancing:us-east-1:12345689:targetgroup/demo-web/12345
44
44
  ```
45
45
 
46
46
  <a id="prev" class="btn btn-basic" href="{% link _docs/helpers.md %}">Back</a>
47
- <a id="next" class="btn btn-primary" href="{% link _docs/auto-completion.md %}">Next Step</a>
47
+ <a id="next" class="btn btn-primary" href="{% link _docs/fargate.md %}">Next Step</a>
48
48
  <p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: Customize CloudFormation
3
+ ---
4
+
5
+ Under the hood, ufo creates most of the required resources with a CloudFormation stack. This includes the ELB, Target Group, Listener, Security Groups, ECS Service, and Route 53 records. You might need to customize these resources. Here are the ways to customize the resources that ufo creates.
6
+
7
+ 1. Settings - This is done with the `.ufo/settings/cfn/default.yml` file. This is the main and recommended way to customize.
8
+ 2. Override cfn template - You can specify your own template to use. You save this template at `.ufo/settings/cfn/stack.yml`. Use this approach as a last resort only when necessary.
9
+
10
+ ## Settings
11
+
12
+ The recommended approach to customize the CloudFormation resources is by adding properties to `.ufo/settings/cfn/default.yml`.
13
+
14
+ {% include cfn-customize.md %}
15
+
16
+ ## Override Cfn Template
17
+
18
+ You can override the source template that ufo uses by creating your own and saving it at `.ufo/settings/cfn/stack.yml` in your project. It is recommended that you copy the source code and work from there [cfn/stack.yml](https://github.com/tongueroo/ufo/blob/master/lib/cfn/stack.yml). Use this approach as a last resort only when absolutely necessary as it'll likely break with a future version of ufo.
19
+
20
+ ## CloudFormation Stack Name
21
+
22
+ The CloudFormation stack name is based on the cluster, service name and UFO_ENV_EXTRA. A few examples help demonstrate:
23
+
24
+ Command | Stack Name
25
+ --- | ---
26
+ ufo ship demo-web | development-demo-web
27
+ ufo ship demo-web -\-cluster dev | dev-demo-web
28
+ UFO_ENV_EXTRA=2 ufo ship demo-web -\-cluster dev | development-demo-web-2
29
+
30
+ ## CloudFormation Stack Source Code
31
+
32
+ The CloudFormation stack is currently generated from a template. The source code for this template is located at [cfn/stack.yml](https://github.com/tongueroo/ufo/blob/master/lib/cfn/stack.yml). This implementation might change in the future.
33
+
34
+ <a id="prev" class="btn btn-basic" href="{% link _docs/why-cloudformation.md %}">Back</a>
35
+ <a id="next" class="btn btn-primary" href="{% link _docs/stuck-cloudformation.md %}">Next Step</a>
36
+ <p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
@@ -7,10 +7,12 @@ title: FAQ
7
7
  Yes, Fargate is supported. To use ufo with Fargate, you will need to adjust the template in `.ufo/templates` to a structure supported by Fargate. There are 2 key items to adjust:
8
8
 
9
9
  1. The task definition JSON. Notably, the JSON structure has the `requiresCompatibilities`, `networkMode`, and `executionRoleArn` attributes. The `cpu` and `memory` attributes also move outside of the `containerDefinitions` level to the top-level attributes. For details on how to adjust the task definition refer to [Task Definitions]({% link _docs/tutorial-ufo-tasks-build.md %}).
10
- 2. The params that get sent to the `create_service` or `run_task` API methods. For details on how to adjust the params refer to [Params]({% link _docs/params.md %})
10
+ 2. The params that get sent to the `run_task` API methods. For details on how to adjust the params refer to [Params]({% link _docs/params.md %})
11
11
 
12
12
  If it's a brand new project, you can use `ufo init` with the `--launch-type fargate` option and it will generate a starter task definition JSON file that has the right Fargate structure. More info is available at [ufo init reference](/reference/ufo-init/#fargate-support).
13
13
 
14
+ A quick and easy way to test fargate is to follow the [Fargate Docs]({% link _docs/fargate.md %}) which provides a demo example.
15
+
14
16
  **Q: Can I tell ufo to use specific docker build options?**
15
17
 
16
18
  Yes, you can do this with the environment variable `UFO_DOCKER_BUILD_OPTIONS`. Example:
@@ -18,9 +20,9 @@ Yes, you can do this with the environment variable `UFO_DOCKER_BUILD_OPTIONS`.
18
20
  ```
19
21
  $ UFO_DOCKER_BUILD_OPTIONS="--build-arg RAILS_ENV=production" ufo docker build
20
22
  Building docker image with:
21
- docker build --build-arg RAILS_ENV=production -t tongueroo/hi:ufo-2018-05-19T11-52-16-6714713 -f Dockerfile .
23
+ docker build --build-arg RAILS_ENV=production -t tongueroo/demo-ufo:ufo-2018-05-19T11-52-16-6714713 -f Dockerfile .
22
24
  ...
23
- Docker image tongueroo/hi:ufo-2018-05-19T11-52-16-6714713 built. Took 2s.
25
+ Docker image tongueroo/demo-ufo:ufo-2018-05-19T11-52-16-6714713 built. Took 2s.
24
26
  ```
25
27
 
26
28
  ---
@@ -32,11 +34,11 @@ In short, no. There's some image cleanup logic that relies on the specific namin
32
34
  ```
33
35
  $ ufo docker build
34
36
  $ ufo docker name
35
- tongueroo/hi:ufo-2018-05-19T11-41-06-6714713
37
+ tongueroo/demo-ufo:ufo-2018-05-19T11-41-06-6714713
36
38
  $ docker tag $(ufo docker name) hi:mytag
37
39
  $ docker images | grep hi
38
40
  hi mytag 5b01e38bd060 3 minutes ago 955MB
39
- tongueroo/hi ufo-2018-05-19T11-41-06-6714713 5b01e38bd060 3 minutes ago 955MB
41
+ tongueroo/demo-ufo ufo-2018-05-19T11-41-06-6714713 5b01e38bd060 3 minutes ago 955MB
40
42
  $ docker push hi:mytag
41
43
  ```
42
44
 
@@ -94,6 +96,6 @@ Also, you might have to enable the log driver by adding the ECS_AVAILABLE_LOGGIN
94
96
 
95
97
  Hope that helps.
96
98
 
97
- <a id="prev" class="btn btn-basic" href="{% link _docs/next-steps.md %}">Back</a>
98
- <a id="next" class="btn btn-primary" href="{% link articles.md %}">Next Step</a>
99
+ <a id="prev" class="btn btn-basic" href="{% link _docs/route53-support.md %}">Back</a>
100
+ <a id="next" class="btn btn-primary" href="{% link _docs/why-cloudformation.md %}">Next Step</a>
99
101
  <p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
@@ -0,0 +1,102 @@
1
+ ---
2
+ title: Fargate
3
+ ---
4
+
5
+ Ufo supports Fargate. AWS Fargate is a technology for Amazon ECS that allows you to run containers without having to manage servers or clusters. This provides an interesting "serverless" option for running Docker containers on AWS.
6
+
7
+ ## Fargate Example
8
+
9
+ Here's an example of creating web service with Fargate.
10
+
11
+ git clone https://github.com/tongueroo/demo-ufo
12
+ cd demo-ufo
13
+ ufo init --image tongueroo/demo-ufo --app demo --force --launch-type fargate --execution-role-arn arn:aws:iam::123456789012:role/ecsTaskExecutionRole
14
+ ufo current --service demo-web
15
+ ufo ship
16
+
17
+ Replace the `--execution-role-arn` with the ecsTaskExecutionRole associated with your account. If you do not have an ecsTaskExecutionRole yet, create one by following [Amazon ECS Task Execution IAM Role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html) guide.
18
+
19
+ You should see output similiar to this. Some output has been removed for conciseness.
20
+
21
+ $ ufo ship
22
+ Building docker image with:
23
+ docker build -t tongueroo/demo-ufo:ufo-2018-06-29T22-54-07-20b3a10 -f Dockerfile .
24
+ ...
25
+ 10:58:38PM CREATE_COMPLETE AWS::ECS::Service Ecs
26
+ 10:58:40PM CREATE_COMPLETE AWS::CloudFormation::Stack development-demo-web
27
+ Stack success status: CREATE_COMPLETE
28
+ Time took for stack deployment: 4m 24s.
29
+ Software shipped!
30
+ $
31
+
32
+ ### Verification ufo commands
33
+
34
+ You can verify that service with these ufo commands.
35
+
36
+ $ ufo ps
37
+ => Service: demo-web
38
+ Service name: development-demo-web-Ecs-1LMRH98Y352F7
39
+ Status: ACTIVE
40
+ Running count: 1
41
+ Desired count: 1
42
+ Launch type: FARGATE
43
+ Task definition: demo-web:84
44
+ Elb: develop-Elb-BNIP29PG593M-771779085.us-east-1.elb.amazonaws.com
45
+ +----------+------+-------------+---------------+---------+-------+
46
+ | Id | Name | Release | Started | Status | Notes |
47
+ +----------+------+-------------+---------------+---------+-------+
48
+ | 78e02265 | web | demo-web:84 | 2 minutes ago | RUNNING | |
49
+ +----------+------+-------------+---------------+---------+-------+
50
+ $ ufo scale 2
51
+ Scale demo-web service in development cluster to 2
52
+ $ ufo ps --no-summary
53
+ +----------+------+-------------+---------------+---------+-------+
54
+ | Id | Name | Release | Started | Status | Notes |
55
+ +----------+------+-------------+---------------+---------+-------+
56
+ | 78e02265 | web | demo-web:84 | 2 minutes ago | RUNNING | |
57
+ +----------+------+-------------+---------------+---------+-------+
58
+ $ ufo ps --no-summary
59
+ +----------+------+-------------+---------------+---------+-------+
60
+ | Id | Name | Release | Started | Status | Notes |
61
+ +----------+------+-------------+---------------+---------+-------+
62
+ | 02b78575 | web | demo-web:84 | PENDING | PENDING | |
63
+ | 78e02265 | web | demo-web:84 | 2 minutes ago | RUNNING | |
64
+ +----------+------+-------------+---------------+---------+-------+
65
+ $ ufo ps --no-summary
66
+ +----------+------+-------------+----------------+---------+-------+
67
+ | Id | Name | Release | Started | Status | Notes |
68
+ +----------+------+-------------+----------------+---------+-------+
69
+ | 02b78575 | web | demo-web:84 | 12 seconds ago | RUNNING | |
70
+ | 78e02265 | web | demo-web:84 | 3 minutes ago | RUNNING | |
71
+ +----------+------+-------------+----------------+---------+-------+
72
+ $
73
+
74
+ ### Verification curl
75
+
76
+ You can verify that the app is up and running curling the ELB DNS.
77
+
78
+ $ curl develop-Elb-BNIP29PG593M-771779085.us-east-1.elb.amazonaws.com ; echo
79
+ 42
80
+ $
81
+
82
+ Congratulations 🎉 You have successfully deployed an docker web service to "serverless" Fargate.
83
+
84
+ ## Clean up
85
+
86
+ Remove the service to save costs.
87
+
88
+ $ ufo destroy
89
+ You are about to destroy demo-web service on the development cluster.
90
+ Are you sure you want to do this? (y/n) y
91
+ Deleting CloudFormation stack with ECS resources: development-demo-web.
92
+ 11:05:40PM DELETE_IN_PROGRESS AWS::CloudFormation::Stack development-demo-web User
93
+ ...
94
+ 11:07:51PM DELETE_COMPLETE AWS::EC2::SecurityGroup EcsSecurityGroup
95
+ Stack development-demo-web deleted.
96
+ $
97
+
98
+ Here's an article that compares the cost of ECS Fargate: [Heroku vs ECS Fargate vs EC2 On-Demand vs EC2 Spot Pricing Comparison](https://blog.boltops.com/2018/04/22/heroku-vs-ecs-fargate-vs-ec2-on-demand-vs-ec2-spot-pricing-comparison)
99
+
100
+ <a id="prev" class="btn btn-basic" href="{% link _docs/conventions.md %}">Back</a>
101
+ <a id="next" class="btn btn-primary" href="{% link _docs/ufo-env.md %}">Next Step</a>
102
+ <p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
@@ -4,13 +4,13 @@ title: Helpers
4
4
 
5
5
  The `task_definitions.rb` file has access to helper methods. These helper methods provide useful contextual information about the project.
6
6
 
7
- For example, one of the helper methods provides the exposed port in the Dockerfile of the project. This is useful if someone changes the exported port in the Dockerfile, he will likely forget to also update the ufo variable. You can reference the port via the helper to prevent this from happening. Here is a list of the helpers:
7
+ For example, one of the helper methods provides the exposed port in the Dockerfile of the project. This is useful if someone changes the exported port in the Dockerfile, he will likely forget also to update the ufo variable. You can reference the port via the helper to prevent this from happening. Here is a list of the helpers:
8
8
 
9
9
  Helper | Description
10
10
  ------------- | -------------
11
- full\_image\_name | The full docker image name that ufo builds. The "base" portion of the docker image name is defined in `settings.yml`. For example, the base portion is `tongueroo/hi` and the full image name is `tongueroo/hi:ufo-[timestamp]-[sha]`. The base name does not include the generated Docker tag, which contains a timestamp and git sha of the Dockerfile that is used.
11
+ full\_image\_name | The full docker image name that ufo builds. The "base" portion of the docker image name is defined in `settings.yml`. For example, the base portion is `tongueroo/demo-ufo` and the full image name is `tongueroo/demo-ufo:ufo-[timestamp]-[sha]`. The base name does not include the generated Docker tag, which contains a timestamp and git sha of the project.
12
12
  dockerfile\_port | Exposed port extracted from the Dockerfile of the project. 
13
- env_vars(text) | This method takes a block of text that contains the env values in `key=value` format and converts that block of text to the proper task definition json format.
13
+ env_vars(text) | This method takes a block of text that contains the env values in `key=value` format and converts that block of text to the proper task definition JSON format.
14
14
  env_file(path) | This method takes a `.env` file which contains a simple key-value list of environment variables and converts the list to the proper task definition JSON format.
15
15
  task_definition_name | The name of the task_definition. So if the code looks like this `task_definition "demo-web" do`, the task_definition_name is "demo-web".
16
16
 
@@ -0,0 +1,72 @@
1
+ ---
2
+ title: Load Balancer Support
3
+ ---
4
+
5
+ Ufo can automatically create a load balancer and associate it with an ECS service. The options:
6
+
7
+ 1. Create an ELB.
8
+ 2. Use existing ELB by providing a target group arn.
9
+ 3. Do not create an ELB.
10
+
11
+ ## Examples
12
+
13
+ Here are examples of each of them:
14
+
15
+ # Create an ELB
16
+ ufo ship demo-web --elb=true
17
+
18
+ # Use existing target group from pre-created ELB
19
+ ufo ship demo-web --elb=arn:aws:elasticloadbalancing:us-east-1:123456789:targetgroup/target-name/2378947392743
20
+
21
+ # Disable creating ELB
22
+ ufo ship demo-web --elb=false
23
+
24
+ ## ELB Retained
25
+
26
+ Ufo retains the ELB setting. So future `ufo ship` commands will not suddenly remove the load balancer. If you need to change the elb setting, then you need to explicitly set a new `--elb` value.
27
+
28
+ Important: Adding and removing load balancers will change the ELB DNS. Please take pre-caution using the elb options. This risk is mitigated if you have configured [Route53 support]({% link _docs/route53-support.md %}).
29
+
30
+ ## Web Service Convention
31
+
32
+ By convention, if the container name is 'web' in the task definition. Deployments of new services will automatically create a load balancer. The behavior can be disabled with `--elb=false` for web containers.
33
+
34
+ ufo ship demo-web --elb=false
35
+
36
+ For non-web container the `--elb` option must be explicitly set to `--elb=true` if you want a load balancer to be created.
37
+
38
+ ## ELB Types: Application and Network
39
+
40
+ Ufo supports application and network load balancer types. To specify the type use `--elb-type`. Examples:
41
+
42
+ ufo ship demo-web --elb-type network
43
+ ufo ship demo-web --elb-type application # default
44
+
45
+ ## ELB Static IP addresses for Network Load Balancers
46
+
47
+ Network load balancers support static EIP address. You can create a network load balancer using pre-allocated EIP addresses with the the `--elb-eip-ids` option. Example:
48
+
49
+ ufo deploy demo-web --elb-eip-ids eipalloc-a8de9ca1 eipalloc-a8de9ca2
50
+
51
+ If you use the `--elb-eip-ids` option, ufo assumes you want an `--elb-type=network` since only network load balancers support EIPs.
52
+
53
+ When specifying the `--elb-eip-ids` option, the list length must be the same as the number of subnets configured in your `.ufo/settings/network/default.yml` profile. The `--elb-eip-ids` setting is optional. If you do not specify it, a network load balancer will still be created.
54
+
55
+ If you need to change the EIPs for existing services, you might get a "TargetGroup cannot be associated with more than one load balancer" error. To work around this you can set the env variable `UFO_FORCE_TARGET_GROUP=1` which will force a re-creation of the target group.
56
+
57
+ UFO_FORCE_TARGET_GROUP=1 ufo deploy demo-web --elb-eip-ids eipalloc-ac226fa4 eipalloc-b5206dbd
58
+
59
+ To remove the EIPs but still keep the network load balancer, you can specify either:
60
+
61
+ UFO_FORCE_TARGET_GROUP=1 ufo deploy demo-web --elb-eip-ids ' ' --elb-type network
62
+ UFO_FORCE_TARGET_GROUP=1 ufo deploy demo-web --elb-eip-ids 'empty' --elb-type network
63
+
64
+ ## Load Balancer Implementation
65
+
66
+ Under the hood, ufo implements load balancer support with CloudFormation. You can see these resources by visiting the CloudFormation console and clicking on the corresponding stack. Here's an example:
67
+
68
+ <img src="/img/docs/cloudformation-resources.png" class="doc-photo" />
69
+
70
+ <a id="prev" class="btn btn-basic" href="{% link _docs/ufo-current.md %}">Back</a>
71
+ <a id="next" class="btn btn-primary" href="{% link _docs/security-groups.md %}">Next Step</a>
72
+ <p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>