ufo 3.4.0 → 3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +2 -2
- data/docs/_docs/faq.md +65 -0
- data/docs/_docs/next-steps.md +1 -1
- data/docs/_docs/params.md +7 -3
- data/docs/_includes/subnav.html +1 -0
- data/docs/articles.md +1 -1
- data/lib/ufo/tasks/register.rb +5 -3
- data/lib/ufo/version.rb +1 -1
- data/spec/lib/register_spec.rb +49 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52f0ef8e22102e9fc1ae63ae8074d39678bc575a457a94d04ffd0ec07e6c6938
|
4
|
+
data.tar.gz: aa281a52edbafa042a7005e8b7dd8ae687126c201197f7dbee220c30b239af88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09506b8a70f79e4cb98292d5783ea875220eb02efb15098148b81a080a67820acf65926d1fe96ae50c9c1f41637a10fa4d4c20bb563af5948624f3a9f52378d2'
|
7
|
+
data.tar.gz: 370f8cf93cfa5010d90ef92bb5fd2a2b43828ee31e4bd211ccf14221ba34b90cc51f46eaf2f58b31b28a7f7df37793b8d9e1fdf94429331bc31dd61e3e3138f2
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,11 @@
|
|
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
|
+
## [3.4.1]
|
7
|
+
- Merge pull request #32 from tongueroo/fix-log-configuration
|
8
|
+
- fix log configuration dasherization
|
9
|
+
- Fixes issue #30 how can use syslog as driver for logging?
|
10
|
+
|
6
11
|
## [3.4.0]
|
7
12
|
- Merge pull request #31 fargate support
|
8
13
|
- ufo upgrade3_3_to_3_4 command
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ufo (3.
|
4
|
+
ufo (3.4.1)
|
5
5
|
aws-sdk-cloudwatchlogs
|
6
6
|
aws-sdk-ec2
|
7
7
|
aws-sdk-ecr
|
@@ -52,7 +52,7 @@ GEM
|
|
52
52
|
deep_merge (1.2.1)
|
53
53
|
diff-lcs (1.3)
|
54
54
|
docile (1.1.5)
|
55
|
-
i18n (1.0.
|
55
|
+
i18n (1.0.1)
|
56
56
|
concurrent-ruby (~> 1.0)
|
57
57
|
jmespath (1.4.0)
|
58
58
|
json (2.1.0)
|
data/docs/_docs/faq.md
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
---
|
2
|
+
title: FAQ
|
3
|
+
---
|
4
|
+
|
5
|
+
**Q: Is AWS ECS Fargate supported?**
|
6
|
+
|
7
|
+
Yes, Fargate is supported. To use ufo with Fargate, the you should adjust the the template in `.ufo/templates` to use the Fargate structure. If it's a brand new project. You can use `ufo init` with the `--launch_type fargate` option and it will generate a json file that has the right Fargate structure. Notable, it requires requiresCompatibilities, networkMode and executionRoleArn to be set.
|
8
|
+
|
9
|
+
---
|
10
|
+
|
11
|
+
**Q: What's the difference between ufo vs ecs-deploy?**
|
12
|
+
|
13
|
+
Some differences:
|
14
|
+
|
15
|
+
* ecs-deploy is implemented in bash
|
16
|
+
* ufo is implemented in ruby
|
17
|
+
* ecs-deploy is a simpler, which could work better for you. It’s nice that it’s one bash script.
|
18
|
+
|
19
|
+
ufo does 3 things:
|
20
|
+
|
21
|
+
1. Builds and pushes the Docker image
|
22
|
+
2. Builds and registers the task definition with ECS
|
23
|
+
3. Deploys by either creating or updating the ECS service
|
24
|
+
|
25
|
+
Ecs-deploy does step 2 and 3 but not step 1. For step 3, doesn’t look like ecs-deploy creates a service if it doesn’t exist. It’s more designed to update existing an ECS service.
|
26
|
+
|
27
|
+
The main difference is that ecs-deploy downloads current ECS task definition and replaces the image attribute. ufo regenerates the task definition from code each deploy. If you’re making adjustments to the task definition with the ECS console as your flow, the ecs-deploy makes more sense. If you want to keep your task definition codified than ufo makes more sense.
|
28
|
+
|
29
|
+
Some more differences:
|
30
|
+
|
31
|
+
* ufo creates the CloudWatch log group if doesn’t exist. Small thing but it’s easy to forget.
|
32
|
+
* ufo has a concept of variables that get layered. This is how it handles multi environments with very similar task definitions with just a few differences.
|
33
|
+
|
34
|
+
Generally, ufo does more in scope so we’re sort of comparing apples to oranges here. Hope that helps.
|
35
|
+
|
36
|
+
---
|
37
|
+
|
38
|
+
**Q: Is it somehow possible to change the templates for the files, that the ufo init-command generates? Most of my services follow the same overall structure, which means I'll have to perform the same changes every time I initialize a new UFO setup.**
|
39
|
+
|
40
|
+
Yes, this is achieved with the `--template` and `--template-mode` options when calling the `ufo init` command. The documentation for it is in the [ufo init reference docs](http://ufoships.com/reference/ufo-init/).
|
41
|
+
|
42
|
+
---
|
43
|
+
|
44
|
+
**Q: How can I used syslog instead of awslogs for logging?**
|
45
|
+
|
46
|
+
Open up `.ufo/templates/main.json.erb` - this gets created as part of the [ufo init](http://ufoships.com/reference/ufo-init/) command. Then you can adjust the ecs template definition to something like this:
|
47
|
+
|
48
|
+
```json
|
49
|
+
"logConfiguration": {
|
50
|
+
"logDriver": "syslog"
|
51
|
+
},
|
52
|
+
```
|
53
|
+
|
54
|
+
Here's the specific aws docs section [Specifying a Log Configuration in your Task Definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html#specify-log-config)
|
55
|
+
|
56
|
+
Also, you might have to enable the log driver by added it the ECS_AVAILABLE_LOGGING_DRIVERS variable to your `/etc/ecs/ecs.config`. Relevant docs:
|
57
|
+
|
58
|
+
* [Using AWS Logs](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html#enable_awslogs)
|
59
|
+
* [ECS Agent Install](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-install.html)
|
60
|
+
|
61
|
+
Hope that helps.
|
62
|
+
|
63
|
+
<a id="prev" class="btn btn-basic" href="{% link _docs/next-steps.md %}">Back</a>
|
64
|
+
<a id="next" class="btn btn-primary" href="{% link articles.md %}">Next Step</a>
|
65
|
+
<p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
|
data/docs/_docs/next-steps.md
CHANGED
@@ -13,6 +13,6 @@ From here, there are a few resources that can help you continue along:
|
|
13
13
|
Everyone can contribute to make ufo better, including the documentation. These docs are of the same ufo repo in the [docs folder](https://github.com/tongueroo/ufo/tree/master/docs). Please fork the project and open a pull request! We love your pull requests. Contributions are encouraged and welcomed!
|
14
14
|
|
15
15
|
<a id="prev" class="btn btn-basic" href="{% link _docs/automated-cleanup.md %}">Back</a>
|
16
|
-
<a id="next" class="btn btn-primary" href="{% link
|
16
|
+
<a id="next" class="btn btn-primary" href="{% link _docs/faq.md %}">Next Step</a>
|
17
17
|
<p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
|
18
18
|
|
data/docs/_docs/params.md
CHANGED
@@ -19,6 +19,7 @@ A starter project `.ufo/params.yml` file is generated as part of the `ufo init`
|
|
19
19
|
# Uncomment launch_type and network_configuration sections to enable fargate.
|
20
20
|
#
|
21
21
|
|
22
|
+
# ufo ship calls create_service when service doesnt exist
|
22
23
|
create_service:
|
23
24
|
deployment_configuration:
|
24
25
|
maximum_percent: 200
|
@@ -31,6 +32,8 @@ create_service:
|
|
31
32
|
# security_groups: <%= @security_groups.inspect %>
|
32
33
|
# assign_public_ip: "ENABLED" # accepts ENABLED, DISABLED
|
33
34
|
|
35
|
+
|
36
|
+
# ufo ship calls update_service when service already exists
|
34
37
|
# update service is provide as an example below. Though it is probably better
|
35
38
|
# to not add any options to update_service if you are using the ECS console
|
36
39
|
# to update these settings often.
|
@@ -47,6 +50,7 @@ update_service:
|
|
47
50
|
# security_groups: ["sg-0815f009d64fc4b2d"]
|
48
51
|
# assign_public_ip: "ENABLED" # accepts ENABLED, DISABLED
|
49
52
|
|
53
|
+
# ufo task calls run_tasks
|
50
54
|
run_task:
|
51
55
|
# launch_type: "FARGATE"
|
52
56
|
# network_configuration:
|
@@ -56,10 +60,10 @@ run_task:
|
|
56
60
|
# assign_public_ip: "ENABLED" # accepts ENABLED, DISABLED
|
57
61
|
```
|
58
62
|
|
59
|
-
Ufo provides 1st class citizen
|
63
|
+
Ufo provides 1st class citizen access to adjust the params sent to the aws-sdk calls:
|
60
64
|
|
61
|
-
* create_service - `ufo ship`
|
62
|
-
* update_service - `ufo ship`
|
65
|
+
* create_service - `ufo ship` calls this when the ECS service does not yet exist.
|
66
|
+
* update_service - `ufo ship` calls this when the ECS service already exists.
|
63
67
|
* run_task - `ufo task` calls this.
|
64
68
|
|
65
69
|
The parameters from this `params.yml` file gets merged with params ufo generates internally. Here's an example of where the merging happens in the source code for the run task command [task.rb](https://github.com/tongueroo/ufo/blob/90f12df035843528770122deb328d150249a25e2/lib/ufo/task.rb#L20) Also, here's the starter [params.yml source code](https://github.com/tongueroo/ufo/blob/master/lib/template/.ufo/params.yml) for reference.
|
data/docs/_includes/subnav.html
CHANGED
@@ -26,6 +26,7 @@
|
|
26
26
|
<li><a href="{% link _docs/migrations.md %}">Database Migrations</a></li>
|
27
27
|
<li><a href="{% link _docs/automated-cleanup.md %}">Automated Cleanup</a></li>
|
28
28
|
<li><a href="{% link _docs/next-steps.md %}">Next Steps</a></li>
|
29
|
+
<li><a href="{% link _docs/faq.md %}">FAQ</a></li>
|
29
30
|
<li><a href="{% link articles.md %}">Articles</a></li>
|
30
31
|
<li><a href="{% link reference.md %}">Reference</a></li>
|
31
32
|
</ul>
|
data/docs/articles.md
CHANGED
@@ -5,6 +5,6 @@ title: Articles
|
|
5
5
|
* This blog post provides an introduction to the tool: [Ufo - Build Docker Containers and Ship Them to AWS ECS](https://medium.com/@tongueroo/ufo-easily-build-docker-containers-and-ship-them-to-aws-ecs-15556a2b39f#.qqu8o4wal)
|
6
6
|
* This presentation covers ufo also: [Ufo Ship on AWS ECS](http://www.slideshare.net/tongueroo/ufo-ship-for-aws-ecs-70885296)
|
7
7
|
|
8
|
-
<a id="prev" class="btn btn-basic" href="{% link _docs/
|
8
|
+
<a id="prev" class="btn btn-basic" href="{% link _docs/faq.md %}">Back</a>
|
9
9
|
<a id="next" class="btn btn-primary" href="{% link reference.md %}">Next Step</a>
|
10
10
|
<p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
|
data/lib/ufo/tasks/register.rb
CHANGED
@@ -24,8 +24,8 @@ module Ufo
|
|
24
24
|
def register
|
25
25
|
data = JSON.parse(IO.read(@template_definition_path), symbolize_names: true)
|
26
26
|
data = data.to_snake_keys
|
27
|
-
data =
|
28
|
-
|
27
|
+
data = dasherize_log_configuation_option(data)
|
28
|
+
message = "#{data[:family]} task definition registered."
|
29
29
|
if @options[:noop]
|
30
30
|
message = "NOOP: #{message}"
|
31
31
|
else
|
@@ -55,11 +55,13 @@ module Ufo
|
|
55
55
|
|
56
56
|
# LogConfiguration requires a string with dashes as the keys
|
57
57
|
# https://docs.aws.amazon.com/sdkforruby/api/Aws/ECS/Client.html
|
58
|
-
def
|
58
|
+
def dasherize_log_configuation_option(data)
|
59
59
|
definitions = data[:container_definitions]
|
60
60
|
definitions.each do |definition|
|
61
61
|
next unless definition[:log_configuration]
|
62
62
|
options = definition[:log_configuration][:options]
|
63
|
+
next unless options
|
64
|
+
|
63
65
|
options["awslogs-group"] = options.delete(:awslogs_group)
|
64
66
|
options["awslogs-region"] = options.delete(:awslogs_region)
|
65
67
|
options["awslogs-stream-prefix"] = options.delete(:awslogs_stream_prefix)
|
data/lib/ufo/version.rb
CHANGED
@@ -0,0 +1,49 @@
|
|
1
|
+
describe Ufo::Tasks::Register do
|
2
|
+
before(:all) do
|
3
|
+
create_ufo_project
|
4
|
+
end
|
5
|
+
|
6
|
+
let(:register) { Ufo::Tasks::Register.new("fake_task_definition_path") }
|
7
|
+
|
8
|
+
context "syslog" do
|
9
|
+
let(:data) do
|
10
|
+
{
|
11
|
+
"container_definitions": [{
|
12
|
+
"logConfiguration": {
|
13
|
+
"logDriver": "syslog"
|
14
|
+
}
|
15
|
+
}]
|
16
|
+
}.to_snake_keys.deep_symbolize_keys
|
17
|
+
end
|
18
|
+
|
19
|
+
it "dasherizes log configuration option" do
|
20
|
+
result = register.dasherize_log_configuation_option(data)
|
21
|
+
driver = result[:container_definitions][0][:log_configuration][:log_driver]
|
22
|
+
expect(driver).to eq "syslog"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context "awslogs" do
|
27
|
+
let(:data) do
|
28
|
+
{
|
29
|
+
"container_definitions": [{
|
30
|
+
"logConfiguration": {
|
31
|
+
"logDriver": "awslogs",
|
32
|
+
"options": {
|
33
|
+
"awslogs-group": "mygroup",
|
34
|
+
"awslogs-region": "us-east-1",
|
35
|
+
"awslogs-stream-prefix": "mystream"
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}]
|
39
|
+
}.to_snake_keys.deep_symbolize_keys
|
40
|
+
end
|
41
|
+
|
42
|
+
it "dasherizes log configuration option" do
|
43
|
+
result = register.dasherize_log_configuation_option(data)
|
44
|
+
log_configuration = result[:container_definitions][0][:log_configuration]
|
45
|
+
expect(log_configuration[:log_driver]).to eq "awslogs"
|
46
|
+
expect(log_configuration[:options].keys).to include("awslogs-group")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ufo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-cloudwatchlogs
|
@@ -264,6 +264,7 @@ files:
|
|
264
264
|
- docs/_docs/auto-completion.md
|
265
265
|
- docs/_docs/automated-cleanup.md
|
266
266
|
- docs/_docs/conventions.md
|
267
|
+
- docs/_docs/faq.md
|
267
268
|
- docs/_docs/helpers.md
|
268
269
|
- docs/_docs/install.md
|
269
270
|
- docs/_docs/migrations.md
|
@@ -455,6 +456,7 @@ files:
|
|
455
456
|
- spec/lib/core_spec.rb
|
456
457
|
- spec/lib/ecr_auth_spec.rb
|
457
458
|
- spec/lib/ecr_cleaner_spec.rb
|
459
|
+
- spec/lib/register_spec.rb
|
458
460
|
- spec/lib/setting_spec.rb
|
459
461
|
- spec/lib/ship_spec.rb
|
460
462
|
- spec/lib/task_spec.rb
|
@@ -493,6 +495,7 @@ test_files:
|
|
493
495
|
- spec/lib/core_spec.rb
|
494
496
|
- spec/lib/ecr_auth_spec.rb
|
495
497
|
- spec/lib/ecr_cleaner_spec.rb
|
498
|
+
- spec/lib/register_spec.rb
|
496
499
|
- spec/lib/setting_spec.rb
|
497
500
|
- spec/lib/ship_spec.rb
|
498
501
|
- spec/lib/task_spec.rb
|