hako 1.4.0 → 1.5.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/.rubocop.yml +3 -3
- data/CHANGELOG.md +4 -0
- data/examples/hello-lb-v2.yml +4 -0
- data/lib/hako/schedulers/ecs.rb +8 -0
- data/lib/hako/schedulers/ecs_elb_v2.rb +15 -1
- data/lib/hako/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa7641f4bc5a2a92d28a326367a5a0138b93e21b
|
4
|
+
data.tar.gz: 01c8ac47831b5e3b2126e426346323de9de79f6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bffcb73040eef086bf53fbed295d1579d7a1b74601547f18377db49a1b4bd3d6b2790557ec7b44ddb1b5c98551e63800458ae408e51d52a915338c1fa32dcc1b
|
7
|
+
data.tar.gz: 2488c2f9e7893676f9cbb5397789ab2a2887a9dd1cec82e33abb25b188ee95ac4d7211616df598697432c44c1b788affe358d8080202ee6be6280e665f797e66
|
data/.rubocop.yml
CHANGED
@@ -4,12 +4,12 @@ AllCops:
|
|
4
4
|
DisplayCopNames: true
|
5
5
|
TargetRubyVersion: 2.3
|
6
6
|
|
7
|
+
Layout/FirstParameterIndentation:
|
8
|
+
Enabled: false
|
9
|
+
|
7
10
|
Style/Alias:
|
8
11
|
EnforcedStyle: prefer_alias_method
|
9
12
|
|
10
|
-
Style/FirstParameterIndentation:
|
11
|
-
Enabled: false
|
12
|
-
|
13
13
|
Style/GuardClause:
|
14
14
|
Enabled: false
|
15
15
|
|
data/CHANGELOG.md
CHANGED
data/examples/hello-lb-v2.yml
CHANGED
@@ -22,6 +22,10 @@ scheduler:
|
|
22
22
|
- subnet-YYYYYYYY
|
23
23
|
security_groups:
|
24
24
|
- sg-ZZZZZZZZ
|
25
|
+
load_balancer_attributes:
|
26
|
+
access_logs.s3.enabled: 'true'
|
27
|
+
access_logs.s3.bucket: hako-access-logs
|
28
|
+
access_logs.s3.prefix: hako-hello-lb-v2
|
25
29
|
app:
|
26
30
|
image: ryotarai/hello-sinatra
|
27
31
|
memory: 128
|
data/lib/hako/schedulers/ecs.rb
CHANGED
@@ -67,6 +67,7 @@ module Hako
|
|
67
67
|
if @autoscaling
|
68
68
|
@autoscaling.apply(Aws::ECS::Types::Service.new(cluster_arn: @cluster, service_name: @app_id))
|
69
69
|
end
|
70
|
+
ecs_elb_client.modify_attributes
|
70
71
|
else
|
71
72
|
current_service = describe_service
|
72
73
|
task_definition_changed, task_definition = register_task_definition(definitions)
|
@@ -84,11 +85,13 @@ module Hako
|
|
84
85
|
if @autoscaling
|
85
86
|
@autoscaling.apply(current_service)
|
86
87
|
end
|
88
|
+
ecs_elb_client.modify_attributes
|
87
89
|
else
|
88
90
|
Hako.logger.info "Updated service: #{service.service_arn}"
|
89
91
|
if @autoscaling
|
90
92
|
@autoscaling.apply(service)
|
91
93
|
end
|
94
|
+
ecs_elb_client.modify_attributes
|
92
95
|
unless wait_for_ready(service)
|
93
96
|
if task_definition_changed
|
94
97
|
Hako.logger.error("Rolling back to #{current_service.task_definition}")
|
@@ -635,6 +638,11 @@ module Hako
|
|
635
638
|
Hako.logger.debug(" s3://#{uri.host}/#{started_key} doesn't exist")
|
636
639
|
else
|
637
640
|
json = JSON.parse(object.body.read)
|
641
|
+
arn = json['detail']['containerInstanceArn']
|
642
|
+
if @container_instance_arn != arn
|
643
|
+
@container_instance_arn = arn
|
644
|
+
report_container_instance(@container_instance_arn)
|
645
|
+
end
|
638
646
|
@started_at = Time.parse(json['detail']['startedAt'])
|
639
647
|
if @started_at
|
640
648
|
Hako.logger.info "Started at #{@started_at}"
|
@@ -98,7 +98,21 @@ module Hako
|
|
98
98
|
|
99
99
|
# @return [nil]
|
100
100
|
def modify_attributes
|
101
|
-
|
101
|
+
unless @elb_v2_config
|
102
|
+
return nil
|
103
|
+
end
|
104
|
+
|
105
|
+
if @elb_v2_config.key?('load_balancer_attributes')
|
106
|
+
load_balancer = describe_load_balancer
|
107
|
+
attributes = @elb_v2_config.fetch('load_balancer_attributes').map { |key, value| { key: key, value: value } }
|
108
|
+
if @dry_run
|
109
|
+
Hako.logger.info("elb_client.modify_load_balancer_attributes(load_balancer_arn: #{load_balancer.load_balancer_arn}, attributes: #{attributes.inspect}) (dry-run)")
|
110
|
+
else
|
111
|
+
Hako.logger.info("Updating ELBv2 attributes to #{attributes.inspect}")
|
112
|
+
elb_client.modify_load_balancer_attributes(load_balancer_arn: load_balancer.load_balancer_arn, attributes: attributes)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
nil
|
102
116
|
end
|
103
117
|
|
104
118
|
# @return [nil]
|
data/lib/hako/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hako
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kohei Suzuki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05
|
11
|
+
date: 2017-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|