rbbt-util 5.19.17 → 5.19.18

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: 7250e5af7af076517a13c322c1fe43506d9ece3d
4
- data.tar.gz: c9ec9ec07c60be34a6f95c9bde5fd2deae7b3bbd
3
+ metadata.gz: 64ccfc0af909dbc006460786c31cd03ecb5a09d4
4
+ data.tar.gz: 221e3508c946239991fbb3fa8e4f9a4649cc954a
5
5
  SHA512:
6
- metadata.gz: ef2ad33be33fbdef8d78a4461d31efbf25171133c553b0be00b67c4e776c5ca225a90609c1d0c5bae80ee4a827d9da1e073955317fca9a7ae4c736c7fa688f50
7
- data.tar.gz: 8e98021bdafe0d005fea0047826a5068709dc009e84c941feaae4d9d1d48c4feac291c2915faf70c213ed71560ee74296fe02420c9656b325a38f6becbe0a357
6
+ metadata.gz: 585970e6c3d50f7edd9b9188e5e45a7938b821bd0d6ed69b03b08b8fd6ee893cdff167d7804005ea96c7e5f5f3dea68445e4755d6be8724b3a8d5e03e31e94e3
7
+ data.tar.gz: 3f3d63792bdd57aee6b3e7b863c7af2ed65e77706edcc55b1fda8b185dc0207bfd2e193b197d67f91bbf5afc7c8fbf0bc384654f4aeb2c510f5fde11d49e0ce5
data/lib/rbbt/monitor.rb CHANGED
@@ -2,8 +2,10 @@ require 'rbbt'
2
2
 
3
3
  module Rbbt
4
4
 
5
- LOCK_DIRS = Rbbt.share.find_all + Rbbt.var.cache.persistence.find_all + Rbbt.var.jobs.find_all +
6
- Rbbt.tmp.tsv_open_locks.find_all + Rbbt.tmp.persist_locks.find_all + Rbbt.tmp.sensiblewrite_lock_dir.find_all +
5
+ #LOCK_DIRS = Rbbt.share.find_all + Rbbt.var.cache.persistence.find_all + Rbbt.var.jobs.find_all +
6
+ # Rbbt.tmp.tsv_open_locks.find_all + Rbbt.tmp.persist_locks.find_all + Rbbt.tmp.sensiblewrite_lock_dir.find_all +
7
+ # Rbbt.tmp.produce_locks.find_all + Rbbt.tmp.step_info_locks.find_all
8
+ LOCK_DIRS = Rbbt.tmp.tsv_open_locks.find_all + Rbbt.tmp.persist_locks.find_all + Rbbt.tmp.sensiblewrite_lock_dir.find_all +
7
9
  Rbbt.tmp.produce_locks.find_all + Rbbt.tmp.step_info_locks.find_all
8
10
 
9
11
  SENSIBLE_WRITE_DIRS = Misc.sensiblewrite_dir.find_all
@@ -48,7 +50,7 @@ module Rbbt
48
50
  def self.locks(dirs = LOCK_DIRS)
49
51
  dirs.collect do |dir|
50
52
  next unless Open.exists? dir
51
- `find "#{ dir }" -name "*.lock"`.split "\n"
53
+ `find "#{ dir }" -name "*.lock" 2>/dev/null`.split "\n"
52
54
  end.compact.flatten
53
55
  end
54
56
 
@@ -67,7 +69,7 @@ module Rbbt
67
69
  lock_info[f][:ppid] = info[:ppid]
68
70
  end
69
71
  rescue Exception
70
- Log.exception $!
72
+ #Log.exception $!
71
73
  end
72
74
  end
73
75
  lock_info
@@ -78,7 +80,7 @@ module Rbbt
78
80
  def self.sensiblewrites(dirs = SENSIBLE_WRITE_DIRS)
79
81
  dirs.collect do |dir|
80
82
  next unless Open.exists? dir
81
- `find "#{ dir }" -not -name "*.lock" -not -type d`.split "\n"
83
+ `find "#{ dir }" -not -name "*.lock" -not -type d 2>/dev/null`.split "\n"
82
84
  end.compact.flatten
83
85
  end
84
86
 
@@ -100,7 +102,7 @@ module Rbbt
100
102
  def self.persists(dirs = PERSIST_DIRS)
101
103
  dirs.collect do |dir|
102
104
  next unless Open.exists? dir
103
- `find "#{ dir }" -name "*.persist"`.split "\n"
105
+ `find "#{ dir }" -name "*.persist" 2>/dev/null`.split "\n"
104
106
  end.compact.flatten
105
107
  end
106
108
 
@@ -140,7 +142,7 @@ module Rbbt
140
142
  task = File.basename(taskdir)
141
143
  next if tasks and not tasks.include? task
142
144
 
143
- files = `find "#{ taskdir }/" -not -type d -not -path "*/*.files/*"`.split("\n").sort
145
+ files = `find "#{ taskdir }/" -not -type d -not -path "*/*.files/*" 2>/dev/null`.split("\n").sort
144
146
  _files = Set.new files
145
147
  TSV.traverse files, :type => :array, :into => jobs do |file|
146
148
  if m = file.match(/(.*).info$/)
@@ -78,7 +78,7 @@ module TSV
78
78
  else
79
79
  fields = fields.compact.flatten
80
80
  end
81
- options = options.merge(input_options.first)
81
+ options = options.merge(input_options.first || {})
82
82
  options[:type] = :list if options[:type] == :single
83
83
  options[:type] = :double if fix_flat
84
84
 
@@ -37,7 +37,7 @@ module Misc
37
37
  ":" << obj.to_s
38
38
  when String
39
39
  if obj.length > 100
40
- "'" << obj.slice(0,30) << "<...#{obj.length}...>" << obj.slice(-10,30) << " " << "'"
40
+ "'" << obj.slice(0,30) << "<...#{obj.length}...>" << obj.slice(-10,30)<< "'"
41
41
  else
42
42
  "'" << obj << "'"
43
43
  end
@@ -256,7 +256,9 @@ module Misc
256
256
  end
257
257
 
258
258
  begin
259
- Open.mv tmp_path, path, lock_options
259
+ Misc.insist do
260
+ Open.mv tmp_path, path, lock_options
261
+ end
260
262
  rescue Exception
261
263
  raise $! unless File.exists? path
262
264
  end
@@ -273,7 +275,7 @@ module Misc
273
275
  content.abort if content.respond_to? :abort
274
276
  Open.rm path if File.exists? path
275
277
  rescue Exception
276
- Log.medium "Exception in sensiblewrite: #{$!.message} -- #{ Log.color :blue, path }"
278
+ Log.medium "Exception in sensiblewrite: [#{Process.pid}] #{$!.message} -- #{ Log.color :blue, path }"
277
279
  Log.exception $!
278
280
  content.abort if content.respond_to? :abort
279
281
  Open.rm path if File.exists? path
@@ -84,7 +84,7 @@ class Step
84
84
  begin
85
85
  Misc.insist do
86
86
  begin
87
- return @info_cache if @info_cache and File.ctime(info_file) < @info_cache_time
87
+ return @info_cache if @info_cache and @info_cache_time and File.ctime(info_file) < @info_cache_time
88
88
  rescue Exception
89
89
  raise $!
90
90
  end
@@ -94,8 +94,13 @@ class Step
94
94
  Misc.insist(2, 1, info_file) do
95
95
  Misc.insist(3, 0.2, info_file) do
96
96
  raise TryAgain, "Info locked" if check_lock and info_lock.locked?
97
- Open.open(info_file) do |file|
98
- INFO_SERIALIAZER.load(file) #|| {}
97
+ info_lock.lock if check_lock and false
98
+ begin
99
+ Open.open(info_file) do |file|
100
+ INFO_SERIALIAZER.load(file) #|| {}
101
+ end
102
+ ensure
103
+ info_lock.unlock if check_lock and false
99
104
  end
100
105
  end
101
106
  end
@@ -164,7 +164,7 @@ class Step
164
164
  end
165
165
  else
166
166
  Log.info "#{Log.color :cyan, "dependency"} #{Log.color :yellow, task.name.to_s || ""} => #{Log.color :yellow, dependency.task_name.to_s || ""} starting -- #{Log.color :blue, dependency.path}"
167
- dependency.run(true)
167
+ dependency.run(true).grace
168
168
  end
169
169
  else
170
170
  Log.info "#{Log.color :cyan, "dependency"} #{Log.color :yellow, task.name.to_s || ""} => #{Log.color :yellow, dependency.task_name.to_s || ""} done -- #{Log.color :blue, dependency.path}"
@@ -215,7 +215,6 @@ class Step
215
215
  raise $!
216
216
  end
217
217
 
218
-
219
218
  set_info :inputs, Misc.remove_long_items(Misc.zip2hash(task.inputs, @inputs)) unless task.inputs.nil?
220
219
 
221
220
  set_info :started, (start_time = Time.now)
@@ -13,7 +13,7 @@ Clean orphaned files
13
13
 
14
14
  $ rbbt system clean <workflow> <task>
15
15
 
16
- -a--all Print all jobs, not only uncompleted
16
+ -a--all Apply to all jobs, not only uncompleted
17
17
  -f--force Remove regardless of been active
18
18
  -h--help Print this help
19
19
  EOF
@@ -29,7 +29,7 @@ if field =~ /^\d+$/
29
29
  else
30
30
  parser = TSV.parse_header(file, options)
31
31
  field_pos = parser.all_fields.index(field) + 1
32
- saved_line = parser.line
32
+ saved_line = parser.first_line
33
33
  end
34
34
 
35
35
  rest = ARGV.inject("-t\"\t\" -g -k#{field_pos}"){|acc,e| acc << " '#{e}'" }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.19.17
4
+ version: 5.19.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-22 00:00:00.000000000 Z
11
+ date: 2016-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake