mamiya 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8fa28dadde7c00c1165fb66de3fceee10b564577
4
- data.tar.gz: 614971d0864612144dab18e4db4aee2c3c7a1126
3
+ metadata.gz: 5d26f86a476093f14e8d738041bae5acd60d9ad0
4
+ data.tar.gz: 09dd771694cec321f0b8c50a414671de465291e4
5
5
  SHA512:
6
- metadata.gz: 494a8f6d5d1e171ec5f2a154a81c534780eb464e6bc30adff4df5e9393788a43eb57a6f2ffaea7e11ce0208c34b9f5a64547fed531149da478a083380ec18a96
7
- data.tar.gz: 3cc97e2941f5a10f5ce67552ec1066431f08c1b6ffe4748a2563fa1f085229bc68074e702649529fa3492a682f36f516795b6b963c4f2dbebcf81136be52fd86
6
+ metadata.gz: ae5b6693750dfbff6a45d149b6ea16b1e79acae51a0c98e70b89a0217db3061eff318242a8d9637a7420eaefa4ddd41673e19d2fe6855a07a7cc2c9879610e75
7
+ data.tar.gz: 9d41bc38c61954f5c65609ae5e79fa6b87c402b50c88d71ad6d2577adfe7bdc6de49aac6acf49b842c17296e1a203455ef4e84fca3a376cceba674c70712d059
@@ -185,7 +185,7 @@ not distributed: #{dist['not_distributed_count']} agents
185
185
  @deploy_exception = nil
186
186
  # TODO: move this run on master node side
187
187
  puts "=> Deploying #{application}/#{package}"
188
- puts " * with labels: #{options[:labels].inspect}" if options[:labels] && !options[:labels].empty?
188
+ puts " * onto agents which labeled: #{options[:labels].inspect}" if options[:labels] && !options[:labels].empty?
189
189
 
190
190
  show_package(package)
191
191
 
@@ -215,7 +215,7 @@ not distributed: #{dist['not_distributed_count']} agents
215
215
 
216
216
  s = pkg_status(package, :short)
217
217
  puts ""
218
- break if 0 < s['participants_count'] && s['participants_count'] == s['prepare']['done'].size
218
+ break if 0 < s['participants_count'] && s['non_participants'].empty? && s['participants_count'] == s['prepare']['done'].size
219
219
  sleep 2
220
220
  end
221
221
 
@@ -382,18 +382,26 @@ not distributed: #{dist['not_distributed_count']} agents
382
382
  puts <<-EOF
383
383
  at: #{Time.now.inspect}
384
384
  application: #{application}
385
+ agents: #{status['agents_count']} agents
385
386
  participants: #{status['participants_count']} agents
386
387
 
387
388
  major_current: #{status['major_current']}
388
389
  currents:
389
390
  #{status['currents'].sort_by { |pkg, as| -(as.size) }.flat_map { |pkg, as|
390
- [" - #{pkg} (#{as.size} agents)"] + (pkg == status['major_current'] ? [" + (omitted)"] : as.map{ |_| " * #{_['name']}" })
391
+ [" - #{pkg} (#{as.size} agents)"] + (pkg == status['major_current'] ? [] : as.map{ |_| " * #{_}" })
391
392
  }.join("\n")}
392
393
 
393
394
  common_previous_release: #{status['common_previous_release']}
394
395
  common_releases:
395
396
  #{status['common_releases'].map { |_| _.prepend(' - ') }.join("\n")}
396
397
  EOF
398
+
399
+ if status['non_participants'] && !status['non_participants'].empty?
400
+ puts "\nnon_participants:"
401
+ status['non_participants'].each do |agent|
402
+ puts " * #{agent}"
403
+ end
404
+ end
397
405
  end
398
406
 
399
407
  def pkg_status(package, short=false)
@@ -426,6 +434,13 @@ status: #{status['status'].join(',')}
426
434
  participants: #{total} agents
427
435
 
428
436
  EOF
437
+
438
+ if status['non_participants'] && !status['non_participants'].empty?
439
+ status['non_participants'].each do |agent|
440
+ puts " * #{agent}"
441
+ end
442
+ puts
443
+ end
429
444
  end
430
445
 
431
446
  %w(fetch prepare switch).each do |key|
@@ -18,6 +18,8 @@ module Mamiya
18
18
  application: application,
19
19
  labels: labels,
20
20
  participants_count: participants.size,
21
+ agents_count: agents.size,
22
+ non_participants: non_participants,
21
23
 
22
24
  major_current: major_current,
23
25
  currents: currents,
@@ -39,7 +41,11 @@ module Mamiya
39
41
  (q['queue'] && q['queue'].any? { |t| t['app'] == application })
40
42
  }
41
43
  end]
42
- end
44
+ end
45
+
46
+ def non_participants
47
+ agents.keys - participants.keys
48
+ end
43
49
 
44
50
  def currents
45
51
  @currents ||= Hash[participants.group_by do |name, status|
@@ -1,3 +1,3 @@
1
1
  module Mamiya
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/mamiya.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_runtime_dependency "thor", ">= 0.18.1"
22
- spec.add_runtime_dependency "aws-sdk-core", "2.0.0.rc15"
22
+ spec.add_runtime_dependency "aws-sdk-core", ">= 2.0.0"
23
23
  spec.add_runtime_dependency "term-ansicolor", ">= 1.3.0"
24
24
  unless ENV["MAMIYA_VILLEIN_PATH"]
25
25
  spec.add_runtime_dependency "villein", ">= 0.5.0"
@@ -86,6 +86,36 @@ describe Mamiya::Master::ApplicationStatus do
86
86
  end
87
87
  end
88
88
 
89
+ describe "#non_participants" do
90
+ subject { status.non_participants }
91
+
92
+ let(:agent_statuses) do
93
+ {
94
+ 'agent1' => {
95
+ 'packages' => {'myapp' => [
96
+ ]},
97
+ 'queues' => {'fetch' => {
98
+ 'working' => nil,
99
+ 'queue' => [
100
+ ]
101
+ }}
102
+ },
103
+ 'agent2' => {
104
+ 'queues' => {'fetch' => {
105
+ 'working' => nil,
106
+ 'queue' => [
107
+ {'app' => 'notmyapp'},
108
+ ]
109
+ }}
110
+ },
111
+ }
112
+ end
113
+
114
+ it "returns non participants" do
115
+ expect(subject.sort).to eq %w(agent2)
116
+ end
117
+ end
118
+
89
119
  describe "#currents" do
90
120
  subject { status.currents }
91
121
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mamiya
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shota Fukumori (sora_h)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-24 00:00:00.000000000 Z
11
+ date: 2014-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: aws-sdk-core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 2.0.0.rc15
33
+ version: 2.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 2.0.0.rc15
40
+ version: 2.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: term-ansicolor
43
43
  requirement: !ruby/object:Gem::Requirement