ufo 3.5.3 → 3.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/Gemfile.lock +6 -4
- data/docs/_docs/faq.md +34 -1
- data/docs/_docs/params.md +0 -11
- data/docs/_reference/ufo-docker-build.md +10 -0
- data/docs/_reference/ufo-init.md +1 -1
- data/docs/_reference/ufo-task.md +8 -0
- data/lib/ufo/docker/builder.rb +7 -1
- data/lib/ufo/help/docker/build.md +9 -0
- data/lib/ufo/help/init.md +1 -1
- data/lib/ufo/help/task.md +7 -0
- data/lib/ufo/task.rb +6 -1
- data/lib/ufo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a7fa29c3df7ba9a608f0e2c82fd27231fa6f083136ba3a08b987067518de477
|
4
|
+
data.tar.gz: 94c3f8f4e5fc4b2cc9cf8fcac9ef49e42d876a137cfd414a10d62c915da7c96d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eac7a33bea59ff2420a63ece5779c874a7b9bb03d6a5856417cb87d330a657a3fdb35888ee971545703b00bfa5e9887490efc0657cf0c4ccaeb6f717e9f29387
|
7
|
+
data.tar.gz: b0b8e6d712982eea6a6f58c4eefbb172da9bfef85ae4e5a2d23e69c30fa47059238175bbb1c0902cade9f9af3a16d2bdfd8c66b072906076c6fd3017d1303209
|
data/CHANGELOG.md
CHANGED
@@ -3,7 +3,12 @@
|
|
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.5.
|
6
|
+
## [3.5.4]
|
7
|
+
- Merge pull request #38 from tongueroo/docker-build-options
|
8
|
+
- add ability to specify custom docker build options with env UFO_DOCKER_BUILD_OPTIONS variable
|
9
|
+
- update faq
|
10
|
+
|
11
|
+
## [3.5.3]
|
7
12
|
- Merge pull request #36 from tongueroo/fix-shared-variables-in-task-definitions
|
8
13
|
- allow usage of shared variables in task_definition blocks again
|
9
14
|
- dont warn of instance variable collision for template scope variables
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ufo (3.5.
|
4
|
+
ufo (3.5.4)
|
5
5
|
aws-sdk-cloudwatchlogs
|
6
6
|
aws-sdk-ec2
|
7
7
|
aws-sdk-ecr
|
@@ -22,15 +22,17 @@ GEM
|
|
22
22
|
i18n (>= 0.7, < 2)
|
23
23
|
minitest (~> 5.1)
|
24
24
|
tzinfo (~> 1.1)
|
25
|
-
aws-
|
25
|
+
aws-eventstream (1.0.0)
|
26
|
+
aws-partitions (1.87.0)
|
26
27
|
aws-sdk-cloudwatchlogs (1.3.0)
|
27
28
|
aws-sdk-core (~> 3)
|
28
29
|
aws-sigv4 (~> 1.0)
|
29
|
-
aws-sdk-core (3.
|
30
|
+
aws-sdk-core (3.21.1)
|
31
|
+
aws-eventstream (~> 1.0)
|
30
32
|
aws-partitions (~> 1.0)
|
31
33
|
aws-sigv4 (~> 1.0)
|
32
34
|
jmespath (~> 1.0)
|
33
|
-
aws-sdk-ec2 (1.
|
35
|
+
aws-sdk-ec2 (1.34.0)
|
34
36
|
aws-sdk-core (~> 3)
|
35
37
|
aws-sigv4 (~> 1.0)
|
36
38
|
aws-sdk-ecr (1.3.0)
|
data/docs/_docs/faq.md
CHANGED
@@ -4,7 +4,40 @@ title: FAQ
|
|
4
4
|
|
5
5
|
**Q: Is AWS ECS Fargate supported?**
|
6
6
|
|
7
|
-
Yes, Fargate is supported. To use ufo with Fargate,
|
7
|
+
Yes, Fargate is supported. To use ufo with Fargate, you will need to adjust the template in `.ufo/templates` to use a structure support by Fargate. If it's a brand new project. You can use `ufo init` with the `--launch-type fargate` option and it will generate a starter JSON file that has the right Fargate structure. Notably, it has the requiresCompatibilities, networkMode, and executionRoleArn attributes.
|
8
|
+
|
9
|
+
The neat thing about Fargate is that can be an extremely cost-effective way to run one-off tasks. This blog post [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) provides a relative comparison of costs.
|
10
|
+
|
11
|
+
---
|
12
|
+
|
13
|
+
**Q: Can I tell ufo to use specific docker build options?**
|
14
|
+
|
15
|
+
Yes, you can do this with the environment variable `UFO_DOCKER_BUILD_OPTIONS`. Example:
|
16
|
+
|
17
|
+
```
|
18
|
+
$ UFO_DOCKER_BUILD_OPTIONS="--build-arg RAILS_ENV=production" ufo docker build
|
19
|
+
Building docker image with:
|
20
|
+
docker build --build-arg RAILS_ENV=production -t tongueroo/hi:ufo-2018-05-19T11-52-16-6714713 -f Dockerfile .
|
21
|
+
...
|
22
|
+
Docker image tongueroo/hi:ufo-2018-05-19T11-52-16-6714713 built. Took 2s.
|
23
|
+
```
|
24
|
+
|
25
|
+
---
|
26
|
+
|
27
|
+
**Q: Can you tell ufo to use a custom user-defined Docker tag name?**
|
28
|
+
|
29
|
+
In short, no. There's some image cleanup logic that relies on the specific naming convention. However, you can re-tag the build docker image with another tag after ufo is done building the image. The key is using the `ufo docker name` command to get the last docker image name that was built by ufo. Example:
|
30
|
+
|
31
|
+
```
|
32
|
+
$ ufo docker build
|
33
|
+
$ ufo docker name
|
34
|
+
tongueroo/hi:ufo-2018-05-19T11-41-06-6714713
|
35
|
+
$ docker tag $(ufo docker name) hi:mytag
|
36
|
+
$ docker images | grep hi
|
37
|
+
hi mytag 5b01e38bd060 3 minutes ago 955MB
|
38
|
+
tongueroo/hi ufo-2018-05-19T11-41-06-6714713 5b01e38bd060 3 minutes ago 955MB
|
39
|
+
$ docker push hi:mytag
|
40
|
+
```
|
8
41
|
|
9
42
|
---
|
10
43
|
|
data/docs/_docs/params.md
CHANGED
@@ -38,17 +38,6 @@ create_service:
|
|
38
38
|
# to not add any options to update_service if you are using the ECS console
|
39
39
|
# to update these settings often.
|
40
40
|
update_service:
|
41
|
-
# force_new_deployment: true
|
42
|
-
# deployment_configuration:
|
43
|
-
# maximum_percent: 200
|
44
|
-
# minimum_healthy_percent: 100
|
45
|
-
# desired_count: 1
|
46
|
-
# launch_type: "FARGATE"
|
47
|
-
# network_configuration:
|
48
|
-
# awsvpc_configuration:
|
49
|
-
# subnets: ["subnet-0ea22ddeb59d13ecc","subnet-0215e12250b7404e7"] # required
|
50
|
-
# security_groups: ["sg-0815f009d64fc4b2d"]
|
51
|
-
# assign_public_ip: "ENABLED" # accepts ENABLED, DISABLED
|
52
41
|
|
53
42
|
# ufo task calls run_tasks
|
54
43
|
run_task:
|
@@ -72,6 +72,16 @@ You should see it being pushed at the end:
|
|
72
72
|
|
73
73
|
Note in order to push the image to a registry you will need to login into the registry. If you are using DockerHub use the `docker login` command. If you are using AWS ECR then you can use the `aws ecr get-login` command.
|
74
74
|
|
75
|
+
## Docker Build Options
|
76
|
+
|
77
|
+
You can specify docker build options with the `UFO_DOCKER_BUILD_OPTIONS` environment variable. Example:
|
78
|
+
|
79
|
+
$ UFO_DOCKER_BUILD_OPTIONS="--build-arg RAILS_ENV=production" ufo docker build
|
80
|
+
Building docker image with:
|
81
|
+
docker build --build-arg RAILS_ENV=production -t tongueroo/hi:ufo-2018-05-19T11-52-16-6714713 -f Dockerfile .
|
82
|
+
...
|
83
|
+
Docker image tongueroo/hi:ufo-2018-05-19T11-52-16-6714713 built. Took 2s.
|
84
|
+
|
75
85
|
|
76
86
|
## Options
|
77
87
|
|
data/docs/_reference/ufo-init.md
CHANGED
@@ -71,7 +71,7 @@ For ECS Fargate, the ECS task definition structure is a bit different. To initi
|
|
71
71
|
|
72
72
|
ufo init --image tongueroo/hi --app hi --force --launch-type fargate
|
73
73
|
|
74
|
-
You can also generate the init ufo files and bypass the prompt by providing the
|
74
|
+
You can also generate the init ufo files and bypass the prompt by providing the `--execution-role-arn` option upfront.
|
75
75
|
|
76
76
|
ufo init --image tongueroo/hi --app hi --force --launch-type fargate --execution-role-arn arn:aws:iam::536766270177:role/ecsTaskExecutionRole
|
77
77
|
|
data/docs/_reference/ufo-task.md
CHANGED
@@ -21,6 +21,14 @@ You can use the `--command` or `-c` option to override the Docker container comm
|
|
21
21
|
ufo task hi-web -c uptime
|
22
22
|
ufo task hi-web -c pwd
|
23
23
|
|
24
|
+
## Skipping Docker
|
25
|
+
|
26
|
+
The `--no-docker` option is useful. By default, the `ufo task` command will build the docker image. The docker build process usually is the part that takes the most time. You can skip the docker build process after building it at least once. This is a faster way to run a bunch of commands with thesame Docker image. Example:
|
27
|
+
|
28
|
+
ufo task hi-web -c uptime # build at least once
|
29
|
+
ufo task hi-web --no-docker -c ls # skip docker for speed
|
30
|
+
ufo task hi-web --no-docker -c pwd # skip docker for speed
|
31
|
+
|
24
32
|
|
25
33
|
## Options
|
26
34
|
|
data/lib/ufo/docker/builder.rb
CHANGED
@@ -25,7 +25,7 @@ class Ufo::Docker
|
|
25
25
|
|
26
26
|
update_auth_token
|
27
27
|
|
28
|
-
command = "docker build -t #{full_image_name} -f #{@dockerfile} ."
|
28
|
+
command = "docker build #{build_options}-t #{full_image_name} -f #{@dockerfile} ."
|
29
29
|
say "Building docker image with:".green
|
30
30
|
say " #{command}".green
|
31
31
|
check_dockerfile_exists
|
@@ -44,6 +44,12 @@ class Ufo::Docker
|
|
44
44
|
say "Docker image #{full_image_name} built. " + "Took #{pretty_time(took)}.".green
|
45
45
|
end
|
46
46
|
|
47
|
+
def build_options
|
48
|
+
options = ENV['UFO_DOCKER_BUILD_OPTIONS']
|
49
|
+
options += " " if options
|
50
|
+
options
|
51
|
+
end
|
52
|
+
|
47
53
|
# Parse Dockerfile for FROM instruction. If the starting image is from an ECR
|
48
54
|
# repository, it's likely an private image so we authorize ECR for pulling.
|
49
55
|
def update_auth_token
|
@@ -59,3 +59,12 @@ You should see it being pushed at the end:
|
|
59
59
|
|
60
60
|
Note in order to push the image to a registry you will need to login into the registry. If you are using DockerHub use the `docker login` command. If you are using AWS ECR then you can use the `aws ecr get-login` command.
|
61
61
|
|
62
|
+
## Docker Build Options
|
63
|
+
|
64
|
+
You can specify docker build options with the `UFO_DOCKER_BUILD_OPTIONS` environment variable. Example:
|
65
|
+
|
66
|
+
$ UFO_DOCKER_BUILD_OPTIONS="--build-arg RAILS_ENV=production" ufo docker build
|
67
|
+
Building docker image with:
|
68
|
+
docker build --build-arg RAILS_ENV=production -t tongueroo/hi:ufo-2018-05-19T11-52-16-6714713 -f Dockerfile .
|
69
|
+
...
|
70
|
+
Docker image tongueroo/hi:ufo-2018-05-19T11-52-16-6714713 built. Took 2s.
|
data/lib/ufo/help/init.md
CHANGED
@@ -58,7 +58,7 @@ For ECS Fargate, the ECS task definition structure is a bit different. To initi
|
|
58
58
|
|
59
59
|
ufo init --image tongueroo/hi --app hi --force --launch-type fargate
|
60
60
|
|
61
|
-
You can also generate the init ufo files and bypass the prompt by providing the
|
61
|
+
You can also generate the init ufo files and bypass the prompt by providing the `--execution-role-arn` option upfront.
|
62
62
|
|
63
63
|
ufo init --image tongueroo/hi --app hi --force --launch-type fargate --execution-role-arn arn:aws:iam::536766270177:role/ecsTaskExecutionRole
|
64
64
|
|
data/lib/ufo/help/task.md
CHANGED
@@ -8,3 +8,10 @@ You can use the `--command` or `-c` option to override the Docker container comm
|
|
8
8
|
ufo task hi-web -c uptime
|
9
9
|
ufo task hi-web -c pwd
|
10
10
|
|
11
|
+
## Skipping Docker
|
12
|
+
|
13
|
+
The `--no-docker` option is useful. By default, the `ufo task` command will build the docker image. The docker build process usually is the part that takes the most time. You can skip the docker build process after building it at least once. This is a faster way to run a bunch of commands with thesame Docker image. Example:
|
14
|
+
|
15
|
+
ufo task hi-web -c uptime # build at least once
|
16
|
+
ufo task hi-web --no-docker -c ls # skip docker for speed
|
17
|
+
ufo task hi-web --no-docker -c pwd # skip docker for speed
|
data/lib/ufo/task.rb
CHANGED
@@ -30,7 +30,12 @@ module Ufo
|
|
30
30
|
display_params(task_options)
|
31
31
|
end
|
32
32
|
resp = ecs.run_task(task_options)
|
33
|
-
|
33
|
+
unless @options[:mute]
|
34
|
+
task_arn = resp.tasks[0].task_arn
|
35
|
+
puts "Task ARN: #{task_arn}"
|
36
|
+
puts " aws ecs describe-tasks --tasks #{task_arn} --cluster #{@cluster}"
|
37
|
+
# todo: maybe add cw comand here also
|
38
|
+
end
|
34
39
|
end
|
35
40
|
|
36
41
|
private
|
data/lib/ufo/version.rb
CHANGED
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.5.
|
4
|
+
version: 3.5.4
|
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-05-
|
11
|
+
date: 2018-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-cloudwatchlogs
|