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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3bcec23995ea382d6ff35cb552d19c2cda0caaf7
4
- data.tar.gz: 403d90d69f4d3c542d4acd65a3ed1793ed1c5605
3
+ metadata.gz: 637c62d07ff46b73c2fb3a6c56dbc6bdde20bb64
4
+ data.tar.gz: 6ade21bcd624fa7a08439fc51a53865e207bcb5c
5
5
  SHA512:
6
- metadata.gz: f3fffc6fa55cf01cf665ef56e9e11c14227a7bf23269c5f74d631cc00a477527bfb99d64496bbe1cdcde2bd9a215a04f5e66ca7f09c7a3b5e91fcc559bb1e7d4
7
- data.tar.gz: 18c4c09e1f574f4cfc9489146fa1fe30da1bd6a6fb811b1434575666d50d522bec3be4cc082a713c7f24561208e0ed19b59678495e27893d9835bcf0e9f00a83
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
- if res.failures.empty?
20
- break
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
 
@@ -1,7 +1,7 @@
1
1
  module Ecs
2
2
  module Easy
3
3
  module Cluster
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
6
6
  end
7
7
  end
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.2
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-23 00:00:00.000000000 Z
11
+ date: 2017-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk