ecs-easy-cluster 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ecs/easy/cluster/mem_scale.rb +20 -18
- data/lib/ecs/easy/cluster/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: 637c62d07ff46b73c2fb3a6c56dbc6bdde20bb64
|
4
|
+
data.tar.gz: 6ade21bcd624fa7a08439fc51a53865e207bcb5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5951dd1af32d8c4aea7bf55911080eb120d0622e36d30061f4cd0823fe1417605a113752aee29ecfab5e079699704980325e3649f46ed55f541717dd6e4f598a
|
7
|
+
data.tar.gz: 9f053297c904201d384541c22e72cb694f781d81d4eefbceaccdb2afeb6fab1ac4431a78dbab0e4f3fe594c5edfc4727cb95b73ec8997a753571743794280432
|
@@ -15,26 +15,28 @@ module Ecs::Easy::Cluster
|
|
15
15
|
3.times do
|
16
16
|
wait_until_ready
|
17
17
|
res = run_task!( task_definition, overrides )
|
18
|
+
break if res.failures.empty?
|
19
|
+
puts "Failed to run the task. Try again."
|
20
|
+
sleep 5
|
21
|
+
end
|
22
|
+
|
23
|
+
# Failure because some reasons
|
24
|
+
unless res.failures.empty?
|
25
|
+
puts res.failures
|
26
|
+
case fail_reason(res.failures)
|
27
|
+
when "RESOURCE:MEMORY"
|
28
|
+
puts "No enough memory on current container instances to execute this task. Add another container instance automatically."
|
18
29
|
|
19
|
-
|
20
|
-
|
21
|
-
else # Failure because some reasons
|
22
|
-
puts res.failures
|
23
|
-
case fail_reason(res.failures)
|
24
|
-
when "RESOURCE:MEMORY"
|
25
|
-
puts "No enough memory on current container instances to execute this task. Add another container instance automatically."
|
26
|
-
|
27
|
-
if num_instances >= max_instances
|
28
|
-
raise "Could\'t scale more instances because it reaches maximum instances. You should upgrade the maximum number of instance to execute multiple tasks at the same time."
|
29
|
-
end
|
30
|
-
unless acceptable_task?( task_definition )
|
31
|
-
raise "Could\'t accept this task because of the lack of memory. You should upgrade ec2 instance type."
|
32
|
-
end
|
33
|
-
|
34
|
-
scale!
|
35
|
-
else
|
36
|
-
raise "Unknown reason: #{res.failures}"
|
30
|
+
if num_instances >= max_instances
|
31
|
+
raise "Could\'t scale more instances because it reaches maximum instances. You should upgrade the maximum number of instance to execute multiple tasks at the same time."
|
37
32
|
end
|
33
|
+
unless acceptable_task?( task_definition )
|
34
|
+
raise "Could\'t accept this task because of the lack of memory. You should upgrade ec2 instance type."
|
35
|
+
end
|
36
|
+
|
37
|
+
scale!
|
38
|
+
else
|
39
|
+
raise "Unknown reason: #{res.failures}"
|
38
40
|
end
|
39
41
|
end
|
40
42
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecs-easy-cluster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- metheglin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|