ripe 0.2.1 → 0.2.2

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: 28ae834d0a84d2072400169910c39825c1c37aa3
4
- data.tar.gz: 2b1be6510c88ad3679dc69e4b198eea81d050734
3
+ metadata.gz: 13032eb238736b94168961b94cfd79896ad89ffd
4
+ data.tar.gz: 6951a4e3da93749f18e44618f7ddc617edafad44
5
5
  SHA512:
6
- metadata.gz: cac0941044a07fe4b97a8fda9f68e52881bc6be0943efafb6d104e0fa6e0c45e4f219ad25431b6099aa30e6fac3847fa79cc28d472b13f3cce59f852fe52fb60
7
- data.tar.gz: c43fcd8a697350737a8b02fef384d40bcc6666954f0ce2e8204efb1a88f9a4661099c4c2598cbe654d1ca86dcc9e89d8c28ab456b1ea34c4a4dd5b59e8780603
6
+ metadata.gz: b3538313e05b7189027942f553b8886993ff361b49b99b61c8ca91af91baf319e95f51d511bb32556501ca3b7caa5d499d7acda98bf4e7318265596c2ece29c8
7
+ data.tar.gz: 733a2265845c4c8049756d9e06f23337a034714a97d19d232db3c7052610eb322d23f5b79a55273ba95f9f40e95ba9fd5217ce50f9b4cd2552c498d1fa73696d
@@ -0,0 +1,9 @@
1
+ v0.2.2
2
+ ------
3
+
4
+ This release mostly contains console-related bugfixes.
5
+
6
+ - Fix bugs related to displaying workers in tabular format in the console.
7
+ - Fix bug causing ripe to crash when no blocks are prepared for a sample.
8
+
9
+ <!-- vim: set syntax=markdown: -->
@@ -21,6 +21,8 @@ module Ripe
21
21
  attr_accessor :vars
22
22
 
23
23
  ##
24
+ # Create a new, empty {Block}.
25
+ #
24
26
  # @param id [String] a mandatory, but optionally unique identifier
25
27
  # for the block
26
28
  # @param blocks [Array<Block>] list of children blocks
@@ -14,6 +14,8 @@ module Ripe
14
14
  class LiquidBlock < WorkingBlock
15
15
 
16
16
  ##
17
+ # Create a new, empty {LiquidBlock}.
18
+ #
17
19
  # @param filename [String] filename of the template file
18
20
  # @param vars [Hash<Symbol, String>] key-value pairs
19
21
 
@@ -17,6 +17,8 @@ module Ripe
17
17
  class MultiBlock < Block
18
18
 
19
19
  ##
20
+ # Create a new, empty {MultiBlock}.
21
+ #
20
22
  # @param id [String] a mandatory, but optionally unique identifier
21
23
  # for the block
22
24
  # @param blocks [Array<Block>] list of children blocks
@@ -9,6 +9,8 @@ module Ripe
9
9
  class ParallelBlock < MultiBlock
10
10
 
11
11
  ##
12
+ # Create a new, empty {ParallelBlock}.
13
+ #
12
14
  # @param blocks [Array<Block>] list of children blocks
13
15
 
14
16
  def initialize(*blocks)
@@ -9,6 +9,8 @@ module Ripe
9
9
  class SerialBlock < MultiBlock
10
10
 
11
11
  ##
12
+ # Create a new, empty {SerialBlock}.
13
+ #
12
14
  # @param blocks [Array<Block>] list of children blocks
13
15
 
14
16
  def initialize(*blocks)
@@ -12,6 +12,8 @@ module Ripe
12
12
  class WorkingBlock < Block
13
13
 
14
14
  ##
15
+ # Create a new, empty {WorkingBlock}.
16
+ #
15
17
  # @param filename [String] filename of the template file
16
18
  # @param vars [Hash<Symbol, String>] key-value pairs
17
19
 
@@ -87,7 +87,7 @@ module Ripe
87
87
  repo.attach
88
88
 
89
89
  unless repo.has_repository?
90
- abort 'Cannot launch console: ripe repo not initialized'
90
+ abort 'Cannot prepare samples: ripe repo not initialized'
91
91
  end
92
92
 
93
93
  abort 'No samples specified.' if samples.length == 0
@@ -1,2 +1,11 @@
1
+ module Ripe
2
+
3
+ # This module contains `domain-specific language` syntactic sugar for
4
+ # defining workflows and tasks.
5
+
6
+ module DSL; end
7
+
8
+ end
9
+
1
10
  require_relative 'dsl/task_dsl'
2
11
  require_relative 'dsl/workflow_dsl'
@@ -1,3 +1,3 @@
1
1
  module Ripe
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -34,7 +34,10 @@ module Ripe
34
34
 
35
35
  def distribute(workers, &block)
36
36
  workers = [workers] if workers.is_a? DB::Worker
37
- workers.map { |w| block.call(w) }
37
+ workers.map do |w|
38
+ block.call(w)
39
+ w
40
+ end
38
41
  end
39
42
 
40
43
  ##
@@ -36,10 +36,14 @@ module Ripe
36
36
  # Apply the workflow to each sample
37
37
  sample_blocks = prepare_sample_blocks(samples, callback, params)
38
38
 
39
- # Split samples into groups of +:group_num+ samples and produce a
40
- # worker from each of these groups.
41
- @workers = sample_blocks.each_slice(params[:group_num].to_i).map do |worker_blocks|
42
- prepare_worker(worker_blocks, params)
39
+ if sample_blocks
40
+ # Split samples into groups of +:group_num+ samples and produce a
41
+ # worker from each of these groups.
42
+ @workers = sample_blocks.each_slice(params[:group_num].to_i).map do |worker_blocks|
43
+ prepare_worker(worker_blocks, params)
44
+ end
45
+ else
46
+ []
43
47
  end
44
48
  end
45
49
 
@@ -80,8 +84,14 @@ module Ripe
80
84
 
81
85
  def prepare_sample_blocks(samples, callback, params)
82
86
  sample_blocks = samples.map do |sample|
83
- block = callback.call(sample, params).prune(params[:mode].to_sym == :force,
84
- params[:mode].to_sym == :depend)
87
+ block = callback.call(sample, params)
88
+
89
+ if block
90
+ # No need to prune if callback returns nil
91
+ block = block.prune(params[:mode].to_sym == :force,
92
+ params[:mode].to_sym == :depend)
93
+ end
94
+
85
95
  if block != nil
86
96
  puts "Preparing sample #{sample}"
87
97
  {sample => block}
@@ -56,7 +56,7 @@ module Ripe
56
56
  # @return [void]
57
57
 
58
58
  def update_running_workers
59
- @workers += @running_jobs.map do |job|
59
+ workers = @running_jobs.map do |job|
60
60
  worker = DB::Worker.find_by(moab_id: job[:moab_id])
61
61
  if worker
62
62
  worker.update(time: job[:time])
@@ -69,8 +69,10 @@ module Ripe
69
69
  })
70
70
  end
71
71
  end
72
- worker
72
+ worker # This is +nil+ if worker is not found (other running jobs
73
+ # that are independent from the current ripe repo).
73
74
  end
75
+ @workers += workers.compact
74
76
  end
75
77
 
76
78
  ##
@@ -108,6 +110,7 @@ module Ripe
108
110
  time: stdout[/Resources:.*,walltime=([0-9]{1,2}(\:[0-9]{2})+)$/, 1],
109
111
  status: :completed,
110
112
  })
113
+ worker
111
114
  end
112
115
  end
113
116
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas De Jay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-22 00:00:00.000000000 Z
11
+ date: 2015-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -217,6 +217,7 @@ files:
217
217
  - ".gitignore"
218
218
  - ".ruby-version"
219
219
  - ".travis.yml"
220
+ - CHANGELOG.md
220
221
  - Gemfile
221
222
  - Guardfile
222
223
  - LICENSE.txt