ufo 3.5.7 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/Gemfile.lock +16 -10
- data/README.md +12 -13
- data/docs/_config.yml +1 -1
- data/docs/_docs/auto-completion.md +4 -4
- data/docs/_docs/automated-cleanup.md +1 -1
- data/docs/_docs/conventions.md +7 -7
- data/docs/_docs/customize-cloudformation.md +36 -0
- data/docs/_docs/faq.md +9 -7
- data/docs/_docs/fargate.md +102 -0
- data/docs/_docs/helpers.md +3 -3
- data/docs/_docs/load-balancer.md +72 -0
- data/docs/_docs/migrations.md +2 -2
- data/docs/_docs/next-steps.md +2 -2
- data/docs/_docs/params.md +12 -41
- data/docs/_docs/route53-support.md +28 -0
- data/docs/_docs/run-in-pieces.md +2 -2
- data/docs/_docs/security-groups.md +54 -0
- data/docs/_docs/settings-cfn.md +11 -0
- data/docs/_docs/settings-network.md +34 -0
- data/docs/_docs/settings.md +18 -15
- data/docs/_docs/single-task.md +3 -3
- data/docs/_docs/ssl-support.md +42 -0
- data/docs/_docs/structure.md +5 -1
- data/docs/_docs/stuck-cloudformation.md +30 -0
- data/docs/_docs/tutorial-ufo-docker-build.md +19 -31
- data/docs/_docs/tutorial-ufo-init.md +16 -12
- data/docs/_docs/tutorial-ufo-ship.md +50 -54
- data/docs/_docs/tutorial-ufo-ships.md +9 -7
- data/docs/_docs/tutorial-ufo-tasks-build.md +26 -17
- data/docs/_docs/ufo-current.md +50 -0
- data/docs/_docs/ufo-env-extra.md +21 -0
- data/docs/_docs/ufo-env.md +6 -13
- data/docs/_docs/ufo-tasks-register.md +3 -3
- data/docs/_docs/upgrade4.md +49 -0
- data/docs/_docs/variables.md +5 -5
- data/docs/_docs/why-cloudformation.md +22 -0
- data/docs/_includes/about.html +1 -1
- data/docs/_includes/cfn-customize.md +39 -0
- data/docs/_includes/commands.html +6 -6
- data/docs/_includes/css/ufo.css +1 -0
- data/docs/_includes/example.html +13 -13
- data/docs/_includes/reference.md +1 -1
- data/docs/_includes/subnav.html +22 -5
- data/docs/_includes/ufo-ship-options.md +7 -6
- data/docs/_reference/ufo-apps.md +36 -0
- data/docs/_reference/ufo-cancel.md +24 -0
- data/docs/_reference/ufo-completion.md +1 -1
- data/docs/_reference/ufo-completion_script.md +1 -1
- data/docs/_reference/ufo-current.md +93 -0
- data/docs/_reference/ufo-deploy.md +18 -17
- data/docs/_reference/ufo-destroy.md +6 -4
- data/docs/_reference/ufo-docker-base.md +7 -7
- data/docs/_reference/ufo-docker-build.md +9 -9
- data/docs/_reference/ufo-docker-clean.md +8 -8
- data/docs/_reference/ufo-docker-name.md +4 -4
- data/docs/_reference/ufo-docker.md +4 -2
- data/docs/_reference/ufo-init.md +31 -20
- data/docs/_reference/ufo-network-help.md +15 -0
- data/docs/_reference/ufo-network-init.md +38 -0
- data/docs/_reference/ufo-network.md +26 -0
- data/docs/_reference/ufo-ps.md +53 -0
- data/docs/_reference/ufo-releases.md +40 -0
- data/docs/_reference/ufo-resources.md +44 -0
- data/docs/_reference/ufo-rollback.md +59 -0
- data/docs/_reference/ufo-scale.md +23 -3
- data/docs/_reference/ufo-ship.md +54 -27
- data/docs/_reference/ufo-ships.md +17 -26
- data/docs/_reference/ufo-stop.md +31 -0
- data/docs/_reference/ufo-task.md +15 -16
- data/docs/_reference/ufo-tasks-build.md +10 -10
- data/docs/_reference/ufo-tasks-register.md +3 -3
- data/docs/_reference/ufo-tasks.md +1 -1
- data/docs/_reference/ufo-upgrade-help.md +15 -0
- data/docs/_reference/ufo-upgrade-v2to3.md +15 -0
- data/docs/_reference/ufo-upgrade-v3_3to3_4.md +15 -0
- data/docs/_reference/ufo-upgrade-v3to4.md +27 -0
- data/docs/_reference/ufo-upgrade.md +28 -0
- data/docs/_reference/ufo-version.md +1 -1
- data/docs/articles.md +2 -2
- data/docs/docs.md +1 -1
- data/docs/img/docs/cloudformation-resources.png +0 -0
- data/docs/img/tutorials/ecs-console-task-definitions.png +0 -0
- data/docs/img/tutorials/ecs-console-ufo-ship.png +0 -0
- data/docs/img/tutorials/ecs-console-ufo-ships.png +0 -0
- data/docs/quick-start.md +21 -9
- data/docs/reference.md +10 -2
- data/exe/ufo +1 -1
- data/lib/cfn/stack.yml +259 -0
- data/lib/template/.ufo/params.yml.tt +21 -60
- data/lib/template/.ufo/settings.yml.tt +6 -1
- data/lib/template/.ufo/settings/cfn/default.yml.tt +55 -0
- data/lib/template/.ufo/settings/network/default.yml.tt +18 -0
- data/lib/template/.ufo/task_definitions.rb.tt +7 -6
- data/lib/template/.ufo/templates/fargate.json.erb +1 -1
- data/lib/template/.ufo/templates/main.json.erb +1 -0
- data/lib/template/.ufo/variables/base.rb.tt +5 -2
- data/lib/template/Dockerfile +10 -15
- data/lib/template/bin/deploy.tt +2 -2
- data/lib/ufo.rb +29 -20
- data/lib/ufo/apps.rb +49 -0
- data/lib/ufo/apps/cfn_map.rb +70 -0
- data/lib/ufo/apps/service.rb +56 -0
- data/lib/ufo/aws_service.rb +15 -6
- data/lib/ufo/base.rb +32 -0
- data/lib/ufo/cancel.rb +23 -0
- data/lib/ufo/cli.rb +91 -27
- data/lib/ufo/core.rb +35 -3
- data/lib/ufo/current.rb +104 -0
- data/lib/ufo/destroy.rb +10 -41
- data/lib/ufo/docker/builder.rb +5 -4
- data/lib/ufo/docker/cleaner.rb +1 -1
- data/lib/ufo/docker/pusher.rb +2 -2
- data/lib/ufo/ecr/cleaner.rb +1 -1
- data/lib/ufo/help/apps.md +12 -0
- data/lib/ufo/help/balancer.md +3 -0
- data/lib/ufo/help/current.md +65 -0
- data/lib/ufo/help/deploy.md +4 -4
- data/lib/ufo/help/destroy.md +3 -3
- data/lib/ufo/help/docker.md +3 -1
- data/lib/ufo/help/docker/base.md +7 -7
- data/lib/ufo/help/docker/build.md +9 -9
- data/lib/ufo/help/docker/clean.md +8 -8
- data/lib/ufo/help/docker/name.md +4 -4
- data/lib/ufo/help/help.md +5 -0
- data/lib/ufo/help/init.md +24 -16
- data/lib/ufo/help/network/init.md +13 -0
- data/lib/ufo/help/ps.md +27 -0
- data/lib/ufo/help/releases.md +16 -0
- data/lib/ufo/help/resources.md +20 -0
- data/lib/ufo/help/rollback.md +35 -0
- data/lib/ufo/help/scale.md +22 -2
- data/lib/ufo/help/ship.md +40 -14
- data/lib/ufo/help/ships.md +4 -13
- data/lib/ufo/help/stop.md +7 -0
- data/lib/ufo/help/task.md +9 -9
- data/lib/ufo/help/tasks/build.md +10 -10
- data/lib/ufo/help/tasks/register.md +3 -3
- data/lib/ufo/help/upgrade/v3to4.md +3 -0
- data/lib/ufo/info.rb +62 -0
- data/lib/ufo/init.rb +36 -23
- data/lib/ufo/log_group.rb +2 -1
- data/lib/ufo/network.rb +24 -0
- data/lib/ufo/network/fetch.rb +41 -0
- data/lib/ufo/network/helper.rb +23 -0
- data/lib/ufo/network/init.rb +26 -0
- data/lib/ufo/param.rb +5 -5
- data/lib/ufo/ps.rb +102 -0
- data/lib/ufo/ps/task.rb +78 -0
- data/lib/ufo/releases.rb +14 -0
- data/lib/ufo/rollback.rb +53 -0
- data/lib/ufo/scale.rb +6 -12
- data/lib/ufo/sequence.rb +7 -0
- data/lib/ufo/setting.rb +7 -6
- data/lib/ufo/setting/profile.rb +24 -0
- data/lib/ufo/ship.rb +35 -326
- data/lib/ufo/stack.rb +203 -0
- data/lib/ufo/stack/context.rb +242 -0
- data/lib/ufo/stack/helper.rb +28 -0
- data/lib/ufo/stack/status.rb +195 -0
- data/lib/ufo/stop.rb +47 -0
- data/lib/ufo/task.rb +96 -15
- data/lib/ufo/tasks/register.rb +1 -1
- data/lib/ufo/template_scope.rb +81 -7
- data/lib/ufo/upgrade.rb +32 -0
- data/lib/ufo/{upgrade3.rb → upgrade/upgrade3.rb} +1 -1
- data/lib/ufo/{upgrade33_to_34.rb → upgrade/upgrade33to34.rb} +2 -2
- data/lib/ufo/upgrade/upgrade4.rb +161 -0
- data/lib/ufo/util.rb +19 -6
- data/lib/ufo/version.rb +1 -1
- data/spec/fixtures/apps/describe_services.json +96 -0
- data/spec/fixtures/cfn/stack-events-complete.json +1080 -0
- data/spec/fixtures/cfn/stack-events-in-progress.json +1080 -0
- data/spec/fixtures/cfn/stack-events-update-rollback-complete.json +1086 -0
- data/spec/fixtures/deployments.json +50 -0
- data/spec/fixtures/ps/describe_tasks.json +58 -0
- data/spec/fixtures/settings.yml +2 -0
- data/spec/lib/apps_spec.rb +20 -0
- data/spec/lib/cli_spec.rb +4 -4
- data/spec/lib/ps_spec.rb +14 -0
- data/spec/lib/setting_spec.rb +2 -1
- data/spec/lib/ship_spec.rb +6 -30
- data/spec/lib/stack/status_spec.rb +76 -0
- data/spec/lib/stop_spec.rb +13 -0
- data/spec/lib/task_spec.rb +5 -2
- data/spec/spec_helper.rb +1 -1
- data/ufo.gemspec +2 -0
- metadata +120 -6
- data/docs/_reference/ufo-upgrade3.md +0 -23
- data/docs/_reference/ufo-upgrade3_3_to_3_4.md +0 -23
|
@@ -2,36 +2,37 @@
|
|
|
2
2
|
title: Setup Ufo
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
The easiest way to create this ufo folder is by using the `ufo init` command. For this tutorial we'll [tongueroo/
|
|
5
|
+
The easiest way to create this ufo folder is by using the `ufo init` command. For this tutorial we'll [tongueroo/demo-ufo](https://github.com/tongueroo/demo-ufo) which is a small test sinatra app.
|
|
6
6
|
Let's run the command in our newly cloned project.
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
|
-
git clone https://github.com/tongueroo/
|
|
10
|
-
cd
|
|
11
|
-
ufo init --app=
|
|
9
|
+
git clone https://github.com/tongueroo/demo-ufo.git
|
|
10
|
+
cd demo-ufo
|
|
11
|
+
ufo init --app=demo --image=tongueroo/demo-ufo
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
You should see output similiar to this:
|
|
15
15
|
|
|
16
16
|
```sh
|
|
17
|
-
$ ufo init --app=
|
|
17
|
+
$ ufo init --app=demo --image=tongueroo/demo-ufo
|
|
18
18
|
Setting up ufo project...
|
|
19
19
|
create .env
|
|
20
|
+
create .ufo/params.yml
|
|
20
21
|
create .ufo/settings.yml
|
|
22
|
+
create .ufo/settings/cfn/default.yml
|
|
23
|
+
create .ufo/settings/network/default.yml
|
|
21
24
|
create .ufo/task_definitions.rb
|
|
25
|
+
create .ufo/templates/fargate.json.erb
|
|
22
26
|
create .ufo/templates/main.json.erb
|
|
23
27
|
create .ufo/variables/base.rb
|
|
24
28
|
create .ufo/variables/development.rb
|
|
25
29
|
create .ufo/variables/production.rb
|
|
26
|
-
|
|
30
|
+
identical Dockerfile
|
|
27
31
|
create bin/deploy
|
|
28
32
|
append .gitignore
|
|
33
|
+
create .dockerignore
|
|
29
34
|
Starter ufo files created.
|
|
30
|
-
|
|
31
|
-
Building docker image with:
|
|
32
|
-
docker build -t tongueroo/hi:ufo-2017-09-10T15-00-19-c781aaf -f Dockerfile .
|
|
33
|
-
....
|
|
34
|
-
Software shipped!
|
|
35
|
+
Congrats 🎉 You have successfully set up ufo for your project.
|
|
35
36
|
$
|
|
36
37
|
```
|
|
37
38
|
|
|
@@ -59,10 +60,13 @@ Take a look at the `settings.yml` file and notice that it contains some default
|
|
|
59
60
|
```yaml
|
|
60
61
|
# More info: http://ufoships.com/docs/settings/
|
|
61
62
|
base:
|
|
62
|
-
image: tongueroo/
|
|
63
|
+
image: tongueroo/demo-ufo
|
|
63
64
|
# clean_keep: 30 # cleans up docker images on your docker server.
|
|
64
65
|
# ecr_keep: 30 # cleans up images on ECR and keeps this remaining amount. Defaults to keep all.
|
|
65
66
|
# defaults when an new ECS service is created by ufo ship
|
|
67
|
+
network_profile: default # .ufo/settings/network/default.yml file
|
|
68
|
+
cfn_profile: default # .ufo/settings/cfn/default.yml file
|
|
69
|
+
|
|
66
70
|
development:
|
|
67
71
|
# cluster: dev # uncomment if you want the cluster name be other than the default
|
|
68
72
|
# the default is to match UFO_ENV. So UFO_ENV=development means the ECS
|
|
@@ -7,91 +7,87 @@ title: Deploy One App
|
|
|
7
7
|
In this guide we have walked through what ufo does step by step. First ufo builds the Docker image with `ufo docker build`. Then it will build and register the ECS task definitions with the `ufo tasks` commands. Now we'll deploy the code to ECS.
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
ufo ship
|
|
10
|
+
ufo ship demo-web
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
By convention, ufo will ship the docker container to an ECS cluster with the same value as UFO_ENV, which defaults to development. So the command above is the same as:
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
|
-
ufo ship
|
|
17
|
-
UFO_ENV=
|
|
16
|
+
ufo ship demo-web --cluster development
|
|
17
|
+
UFO_ENV=development ufo ship demo-web
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
When you run `ufo ship
|
|
20
|
+
When you run `ufo ship demo-web`:
|
|
21
21
|
|
|
22
22
|
1. It builds the docker image.
|
|
23
23
|
2. Generates a task definition and registers it.
|
|
24
24
|
3. Updates the ECS service to use it.
|
|
25
25
|
|
|
26
|
-
If the ECS service
|
|
26
|
+
If the ECS service demo-web does not yet exist, ufo will create the service for you. Ufo will also automatically create the ECS cluster.
|
|
27
27
|
|
|
28
|
-
NOTE:
|
|
28
|
+
NOTE: Ufo creates the ECS cluster record, but you still need to associate ECS Container Instances to the cluster yourself.
|
|
29
29
|
|
|
30
|
-
By convention, if the service has a container name web,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
ufo ship hi-web --target-group=arn:aws:elasticloadbalancing:us-east-1:12345689:targetgroup/hi-web/12345
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Let's go back to the original command and take a look at the output:
|
|
30
|
+
By convention, if the service has a container name web, ufo will automatically create an Load Balancer. Let's take a look at the example out from the `ufo ship`. Some of the output has been removed for conciseness.
|
|
38
31
|
|
|
39
32
|
```sh
|
|
40
|
-
ufo ship
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
The output should look something like this (some of the output has been removed for conciseness):
|
|
44
|
-
|
|
45
|
-
```sh
|
|
46
|
-
$ ufo ship hi-web
|
|
33
|
+
$ ufo ship demo-web
|
|
47
34
|
Building docker image with:
|
|
48
|
-
docker build -t tongueroo/
|
|
35
|
+
docker build -t tongueroo/demo-ufo:ufo-2018-06-28T16-41-11-7e0af94 -f Dockerfile .
|
|
36
|
+
...
|
|
37
|
+
Deploying demo-web...
|
|
38
|
+
Ensuring log group for demo-web task definition exists
|
|
39
|
+
Log group name: ecs/demo-web
|
|
40
|
+
Creating stack development-demo-web...
|
|
41
|
+
Generated template saved at: /tmp/ufo/development-demo-web/stack.yml
|
|
42
|
+
Generated parameters saved at: /tmp/ufo/development-demo-web/parameters.yml
|
|
43
|
+
04:41:27PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack development-demo-web User Initiated
|
|
44
|
+
04:41:31PM CREATE_IN_PROGRESS AWS::EC2::SecurityGroup ElbSecurityGroup
|
|
45
|
+
04:41:31PM CREATE_IN_PROGRESS AWS::EC2::SecurityGroup EcsSecurityGroup
|
|
46
|
+
04:41:31PM CREATE_IN_PROGRESS AWS::ElasticLoadBalancingV2::TargetGroup TargetGroup
|
|
47
|
+
04:41:31PM CREATE_IN_PROGRESS AWS::EC2::SecurityGroup ElbSecurityGroup Resource creation Initiated
|
|
48
|
+
04:41:32PM CREATE_IN_PROGRESS AWS::EC2::SecurityGroup EcsSecurityGroup Resource creation Initiated
|
|
49
|
+
04:41:32PM CREATE_IN_PROGRESS AWS::ElasticLoadBalancingV2::TargetGroup TargetGroup Resource creation Initiated
|
|
49
50
|
...
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
ufo/output/hi-worker.json
|
|
55
|
-
ufo/output/hi-clock.json
|
|
56
|
-
Task Definitions built in ufo/output.
|
|
57
|
-
hi-web task definition registered.
|
|
58
|
-
Shipping hi-web...
|
|
59
|
-
hi-web service updated on stag cluster with task hi-web
|
|
51
|
+
04:44:46PM CREATE_COMPLETE AWS::ECS::Service Ecs
|
|
52
|
+
04:44:48PM CREATE_COMPLETE AWS::CloudFormation::Stack development-demo-web
|
|
53
|
+
Stack success status: CREATE_COMPLETE
|
|
54
|
+
Time took for stack deployment: 3m 22s.
|
|
60
55
|
Software shipped!
|
|
61
|
-
|
|
62
|
-
Running: docker rmi tongueroo/hi:ufo-2017-06-11T20-32-16-a18aa30 tongueroo/hi:ufo-2017-06-11T20-27-44-bc80e84 tongueroo/hi:ufo-2017-06-11T20-02-18-bc80e84
|
|
56
|
+
$
|
|
63
57
|
```
|
|
64
58
|
|
|
65
59
|
Checking the ECS console you should see something like this:
|
|
66
60
|
|
|
67
61
|
<img src="/img/tutorials/ecs-console-ufo-ship.png" class="doc-photo" />
|
|
68
62
|
|
|
69
|
-
You have successfully
|
|
63
|
+
You have successfully deployed a Docker image to ECS! 🍾🥂
|
|
70
64
|
|
|
71
|
-
##
|
|
65
|
+
## Checking ECS Service
|
|
72
66
|
|
|
73
|
-
|
|
67
|
+
Another way to check that the ECS service is running is with the `ufo ps` command.
|
|
74
68
|
|
|
75
|
-
|
|
69
|
+
$ ufo ps demo-web
|
|
70
|
+
=> Service: demo-web
|
|
71
|
+
Service name: development-demo-web-Ecs-12DRF2703Z3D2
|
|
72
|
+
Status: ACTIVE
|
|
73
|
+
Running count: 1
|
|
74
|
+
Desired count: 1
|
|
75
|
+
Launch type: EC2
|
|
76
|
+
Task definition: demo-web:82
|
|
77
|
+
Elb: develop-Elb-ZY1VARS3KP14-2141687965.us-east-1.elb.amazonaws.com
|
|
78
|
+
+----------+------+-------------+---------------+---------+-------+
|
|
79
|
+
| Id | Name | Release | Started | Status | Notes |
|
|
80
|
+
+----------+------+-------------+---------------+---------+-------+
|
|
81
|
+
| e4426421 | web | demo-web:82 | 5 minutes ago | RUNNING | |
|
|
82
|
+
+----------+------+-------------+---------------+---------+-------+
|
|
76
83
|
|
|
77
|
-
|
|
78
|
-
2. update the ECS service
|
|
84
|
+
## Ufo Current Tip
|
|
79
85
|
|
|
80
|
-
Example:
|
|
81
|
-
|
|
82
|
-
```sh
|
|
83
|
-
ufo deploy hi-web
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
The output should look something like this:
|
|
87
|
-
|
|
88
|
-
```sh
|
|
89
|
-
Shipping hi-web...
|
|
90
|
-
hi-web service updated on stag cluster with task hi-web
|
|
91
|
-
Software shipped!
|
|
92
|
-
```
|
|
86
|
+
We've been typing the `demo-web` service name explicitly. We can set the current service with the `ufo current` command to save us from typing each time. Example:
|
|
93
87
|
|
|
94
|
-
|
|
88
|
+
ufo current --service demo-web
|
|
89
|
+
ufo ship # now same as ufo ship demo-web
|
|
90
|
+
ufo ps # now same as ufo ps demo-web
|
|
95
91
|
|
|
96
92
|
Congratulations 🎊 You have successfully built a Docker image, register it and deployed it to AWS ECS.
|
|
97
93
|
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
title: Deploy Multiple Apps
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
You might have noticed in
|
|
5
|
+
You might have noticed in the tutorial that the generated starter .ufo folder contains 3 task definitions a `web`, `worker` and `clock` role. This is a common pattern. The web process handles web traffic, the worker process handles background job processing that would be too slow and potentially block web requests, and a clock process is typically used to schedule recurring jobs.
|
|
6
6
|
|
|
7
|
-
These processes use the same codebase and same docker image, but have slightly different run time settings. The docker run command for a web process could be [puma](http://puma.io/) and the command for a worker process could be [sidekiq](http://sidekiq.org/). Environment variables are also sometimes different. The important key is that the same docker image is used for all 3 services but the task definition for each service is slightly different.
|
|
7
|
+
These processes typically use the same codebase and same docker image, but have slightly different run time settings. The docker run command for a web process could be [puma](http://puma.io/) and the command for a worker process could be [sidekiq](http://sidekiq.org/). Environment variables are also sometimes different. The important key is that the same docker image is used for all 3 services but the task definition for each service is slightly different.
|
|
8
8
|
|
|
9
9
|
While we can use the `ufo ship` command to deploy to all 3 service roles individually like so:
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
ufo ship
|
|
13
|
-
ufo ship
|
|
14
|
-
ufo ship
|
|
12
|
+
ufo ship demo-web
|
|
13
|
+
ufo ship demo-worker
|
|
14
|
+
ufo ship demo-clock
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
This would build a new Docker image for each process. We actually want have the same docker image running on all of these roles. In this case where we want to use the *same* Docker image for all 3 roles, ufo provides a `ufo ships` command.
|
|
@@ -19,7 +19,7 @@ This would build a new Docker image for each process. We actually want have the
|
|
|
19
19
|
## ufo ships
|
|
20
20
|
|
|
21
21
|
```sh
|
|
22
|
-
ufo ships
|
|
22
|
+
ufo ships demo-web demo-worker demo-clock
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
You can check on the ECS console and should see something similar to this:
|
|
@@ -29,9 +29,11 @@ You can check on the ECS console and should see something similar to this:
|
|
|
29
29
|
You can shorten the command by taking advantage of shell expansion:
|
|
30
30
|
|
|
31
31
|
```sh
|
|
32
|
-
ufo ships
|
|
32
|
+
ufo ships demo-{web,worker,clock}
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
In the case of the `ufo ships` command the `--wait` option defaults to false so that all the specified ECS services update in parallel. You can check on the status of the update on the CloudFormation console.
|
|
36
|
+
|
|
35
37
|
<a id="prev" class="btn btn-basic" href="{% link _docs/tutorial-ufo-ship.md %}">Back</a>
|
|
36
38
|
<a id="next" class="btn btn-primary" href="{% link docs.md %}">Next Step</a>
|
|
37
39
|
<p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
|
|
@@ -39,7 +39,7 @@ The instance variable values are specified in `.ufo/task_definitions.rb` via a D
|
|
|
39
39
|
**.ufo/task_definitions.rb**:
|
|
40
40
|
|
|
41
41
|
```
|
|
42
|
-
task_definition "
|
|
42
|
+
task_definition "demo-web" do
|
|
43
43
|
source "main" # will use ufo/templates/main.json.erb
|
|
44
44
|
variables(
|
|
45
45
|
family: task_definition_name,
|
|
@@ -49,7 +49,7 @@ task_definition "hi-web" do
|
|
|
49
49
|
)
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
-
task_definition "
|
|
52
|
+
task_definition "demo-worker" do
|
|
53
53
|
source "main" # will use ufo/templates/main.json.erb
|
|
54
54
|
variables(
|
|
55
55
|
family: task_definition_name,
|
|
@@ -66,7 +66,7 @@ Ufo has a concept of shared variables, covered in [Shared Variables]({% link _do
|
|
|
66
66
|
**.ufo/variables/base.rb**:
|
|
67
67
|
|
|
68
68
|
```ruby
|
|
69
|
-
@image = helper.full_image_name # includes the git sha tongueroo/
|
|
69
|
+
@image = helper.full_image_name # includes the git sha tongueroo/demo-ufo:ufo-[sha].
|
|
70
70
|
@cpu = 128
|
|
71
71
|
@memory_reservation = 256
|
|
72
72
|
@environment = helper.env_file(".env")
|
|
@@ -99,27 +99,28 @@ You should see output similar to below:
|
|
|
99
99
|
$ ufo tasks build
|
|
100
100
|
Building Task Definitions...
|
|
101
101
|
Generating Task Definitions:
|
|
102
|
-
.ufo/output/
|
|
103
|
-
.ufo/output/
|
|
104
|
-
.ufo/output/
|
|
102
|
+
.ufo/output/demo-web.json
|
|
103
|
+
.ufo/output/demo-worker.json
|
|
104
|
+
.ufo/output/demo-clock.json
|
|
105
105
|
Task Definitions built in .ufo/output
|
|
106
106
|
$
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
Let's take a look at one of the generated files: `.ufo/output/
|
|
109
|
+
Let's take a look at one of the generated files: `.ufo/output/demo-web.json`.
|
|
110
110
|
|
|
111
111
|
```json
|
|
112
112
|
{
|
|
113
|
-
"family": "
|
|
113
|
+
"family": "demo-web",
|
|
114
114
|
"containerDefinitions": [
|
|
115
115
|
{
|
|
116
116
|
"name": "web",
|
|
117
|
-
"image": "tongueroo/
|
|
118
|
-
"cpu":
|
|
119
|
-
"
|
|
117
|
+
"image": "tongueroo/demo-ufo:ufo-2018-06-29T23-20-47-20b3a10",
|
|
118
|
+
"cpu": 256,
|
|
119
|
+
"memory": 512,
|
|
120
|
+
"memoryReservation": 512,
|
|
120
121
|
"portMappings": [
|
|
121
122
|
{
|
|
122
|
-
"containerPort":
|
|
123
|
+
"containerPort": 4567,
|
|
123
124
|
"protocol": "tcp"
|
|
124
125
|
}
|
|
125
126
|
],
|
|
@@ -137,9 +138,9 @@ Let's take a look at one of the generated files: `.ufo/output/hi-web.json`.
|
|
|
137
138
|
"logConfiguration": {
|
|
138
139
|
"logDriver": "awslogs",
|
|
139
140
|
"options": {
|
|
140
|
-
"awslogs-group": "ecs/
|
|
141
|
+
"awslogs-group": "ecs/demo-web",
|
|
141
142
|
"awslogs-region": "us-east-1",
|
|
142
|
-
"awslogs-stream-prefix": "
|
|
143
|
+
"awslogs-stream-prefix": "demo"
|
|
143
144
|
}
|
|
144
145
|
},
|
|
145
146
|
"essential": true
|
|
@@ -159,9 +160,17 @@ ufo tasks register
|
|
|
159
160
|
You should see something similar to this:
|
|
160
161
|
|
|
161
162
|
```sh
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
$ ufo tasks register
|
|
164
|
+
Equivalent aws cli command:
|
|
165
|
+
aws ecs register-task-definition --cli-input-json file://.ufo/output/demo-web.json
|
|
166
|
+
demo-web task definition registered.
|
|
167
|
+
Equivalent aws cli command:
|
|
168
|
+
aws ecs register-task-definition --cli-input-json file://.ufo/output/demo-clock.json
|
|
169
|
+
demo-clock task definition registered.
|
|
170
|
+
Equivalent aws cli command:
|
|
171
|
+
aws ecs register-task-definition --cli-input-json file://.ufo/output/demo-worker.json
|
|
172
|
+
demo-worker task definition registered.
|
|
173
|
+
$
|
|
165
174
|
```
|
|
166
175
|
|
|
167
176
|
<a id="prev" class="btn btn-basic" href="{% link _docs/tutorial-ufo-docker-build.md %}">Back</a>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Ufo Current
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## service
|
|
6
|
+
|
|
7
|
+
There's a handy way to shorten ufo commands by setting the current service. Example:
|
|
8
|
+
|
|
9
|
+
ufo ship demo-web # normal usage
|
|
10
|
+
ufo current --service demo-web
|
|
11
|
+
ufo ship # no longer have to type: demo-web
|
|
12
|
+
|
|
13
|
+
To view the current settings run `ufo current` with no options.
|
|
14
|
+
|
|
15
|
+
$ ufo current
|
|
16
|
+
Current env_extra: 1
|
|
17
|
+
Current service: demo-web
|
|
18
|
+
|
|
19
|
+
Setting the current service helps shorten other commands also:
|
|
20
|
+
|
|
21
|
+
ufo cancel
|
|
22
|
+
ufo deploy
|
|
23
|
+
ufo destroy
|
|
24
|
+
ufo ps
|
|
25
|
+
ufo releases
|
|
26
|
+
ufo resources
|
|
27
|
+
ufo rollback VERSION
|
|
28
|
+
ufo scale COUNT
|
|
29
|
+
ufo ship
|
|
30
|
+
|
|
31
|
+
## UFO_ENV_EXTRA
|
|
32
|
+
|
|
33
|
+
The UFO_ENV_EXTRA env variable allows you create multiple environments with of the same services quickly. More info about is is detailed at [ufo-env-extra]({% link _docs/ufo-env-extra.md %}). You can also set a current UFO_ENV_EXTRA with the `--env-extra` option.
|
|
34
|
+
|
|
35
|
+
ufo current --env-extra 1
|
|
36
|
+
|
|
37
|
+
## services
|
|
38
|
+
|
|
39
|
+
The `ufo ships` commands builds one Docker image and deploys them to multiple ECS services, so it usually takes a list of services like so:
|
|
40
|
+
|
|
41
|
+
ufo ships demo-web demo-worker demo-clock
|
|
42
|
+
|
|
43
|
+
This can be shorten with with current also.
|
|
44
|
+
|
|
45
|
+
ufo current --services demo-web demo-worker demo-clock
|
|
46
|
+
ufo ships
|
|
47
|
+
|
|
48
|
+
<a id="prev" class="btn btn-basic" href="{% link _docs/ufo-env-extra.md %}">Back</a>
|
|
49
|
+
<a id="next" class="btn btn-primary" href="{% link _docs/load-balancer.md %}">Next Step</a>
|
|
50
|
+
<p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: UFO_ENV_EXTRA
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Ufo has an concept of extra environments. This is controlled by the `UFO_ENV_EXTRA` variable. By setting `UFO_ENV_EXTRA` you can create additional identical ECS services or environments.
|
|
6
|
+
|
|
7
|
+
ufo ship demo-web # creates a demo-web ecs service
|
|
8
|
+
UFO_ENV_EXTRA=2 ufo ship demo-web # creates a demo-web-2 ecs service
|
|
9
|
+
|
|
10
|
+
The `UFO_ENV_EXTRA` can also be set with `ufo current` so you do not have to type it over.
|
|
11
|
+
|
|
12
|
+
ufo current --env-extra 1
|
|
13
|
+
|
|
14
|
+
The precedence:
|
|
15
|
+
|
|
16
|
+
1. UFO_ENV_EXTRA - takes highest precedence
|
|
17
|
+
2. `.ufo/current` env-extra setting - takes lower precedence
|
|
18
|
+
|
|
19
|
+
<a id="prev" class="btn btn-basic" href="{% link _docs/ufo-env.md %}">Back</a>
|
|
20
|
+
<a id="next" class="btn btn-primary" href="{% link _docs/ufo-current.md %}">Next Step</a>
|
|
21
|
+
<p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
|
data/docs/_docs/ufo-env.md
CHANGED
|
@@ -8,24 +8,17 @@ Ufo's behavior is controlled by the `UFO_ENV` environment variable. For example
|
|
|
8
8
|
|
|
9
9
|
The `UFO_ENV` can be set in several ways:
|
|
10
10
|
|
|
11
|
-
1.
|
|
12
|
-
2.
|
|
13
|
-
3. From the `aws_profiles` setting in your `settings.yml` file - This takes the lowest precedence.
|
|
14
|
-
|
|
15
|
-
## At the CLI Command
|
|
16
|
-
|
|
17
|
-
```sh
|
|
18
|
-
ufo ship hi-web --cluster production
|
|
19
|
-
```
|
|
11
|
+
1. Exported as an environment variable to your shell - This takes the second highest precedence.
|
|
12
|
+
2. From the `aws_profiles` setting in your `settings.yml` file - This takes the lowest precedence.
|
|
20
13
|
|
|
21
14
|
## As an environment variable
|
|
22
15
|
|
|
23
16
|
```sh
|
|
24
17
|
export UFO_ENV=production
|
|
25
|
-
ufo ship
|
|
18
|
+
ufo ship demo-web
|
|
26
19
|
```
|
|
27
20
|
|
|
28
|
-
|
|
21
|
+
You can set `UFO_ENV` in your `~/.profile`.
|
|
29
22
|
|
|
30
23
|
## In .ufo/settings.yml
|
|
31
24
|
|
|
@@ -51,6 +44,6 @@ AWS_PROFILE=whatever => UFO_ENV=development # since there are no profiles that m
|
|
|
51
44
|
|
|
52
45
|
Notice how `AWS_PROFILE=whatever` results in `UFO_ENV=development`. This is because there are no matching aws_profiles in the `settings.yml`. More info on settings is available at [settings]({% link _docs/settings.md %}).
|
|
53
46
|
|
|
54
|
-
<a id="prev" class="btn btn-basic" href="{% link _docs/
|
|
55
|
-
<a id="next" class="btn btn-primary" href="{% link _docs/
|
|
47
|
+
<a id="prev" class="btn btn-basic" href="{% link _docs/fargate.md %}">Back</a>
|
|
48
|
+
<a id="next" class="btn btn-primary" href="{% link _docs/ufo-env-extra.md %}">Next Step</a>
|
|
56
49
|
<p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
|