rbbt-util 5.17.5 → 5.17.6
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 +4 -4
- data/lib/rbbt/persist.rb +4 -3
- data/lib/rbbt/util/misc/inspect.rb +2 -0
- data/lib/rbbt/workflow/accessor.rb +26 -24
- data/lib/rbbt/workflow/step/run.rb +21 -13
- data/share/rbbt_commands/workflow/prov +7 -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: a76837c4ad8ddaad67f76ad427b0228526f8ced5
|
4
|
+
data.tar.gz: 74defa1d2bdae0f8d3c096025d1ab2ce3796c9f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0e388e93422121f8e66f3e6570761f803da4a69bcbe2192de3098f602e60edf5c6ed7c043d911d9838d2499a2a9ac0b9f108d45f60f5a5ad7d6083e9fda5fc7
|
7
|
+
data.tar.gz: c8acbf531e4703da11cbd7c28dcf5bfb1220536c2fef0bf411ae7d9abc73014cb1e296f9a7aa3a5ea4d1b3917dcc9d985b6b868fef5148fe6bd7a8686d555a23
|
data/lib/rbbt/persist.rb
CHANGED
@@ -27,7 +27,7 @@ module Persist
|
|
27
27
|
|
28
28
|
def self.newer?(path, file)
|
29
29
|
return true if not Open.exists? file
|
30
|
-
return
|
30
|
+
return File.mtime(path) - File.mtime(file) if File.mtime(path) < File.mtime(file)
|
31
31
|
return false
|
32
32
|
end
|
33
33
|
|
@@ -38,8 +38,9 @@ module Persist
|
|
38
38
|
check = persist_options[:check]
|
39
39
|
if not check.nil?
|
40
40
|
if Array === check
|
41
|
-
|
42
|
-
|
41
|
+
newer = check.select{|file| newer? path, file}
|
42
|
+
if newer.any?
|
43
|
+
Log.medium "Persistence check for #{path} failed in: #{ newer * ", "}"
|
43
44
|
return false
|
44
45
|
end
|
45
46
|
else
|
@@ -144,10 +144,12 @@ module Misc
|
|
144
144
|
when Symbol === v
|
145
145
|
str << k.to_s << "=>" << v.to_s
|
146
146
|
when (String === v and v.length > HASH2MD5_MAX_STRING_LENGTH)
|
147
|
+
#str << k.to_s << "=>" << v[0..HASH2MD5_MAX_STRING_LENGTH] << v[v.length-3..v.length+3] << v[-3..-1] << "; #{ v.length }"
|
147
148
|
str << k.to_s << "=>" << v[0..HASH2MD5_MAX_STRING_LENGTH] << "; #{ v.length }"
|
148
149
|
when String === v
|
149
150
|
str << k.to_s << "=>" << v
|
150
151
|
when (Array === v and v.length > HASH2MD5_MAX_ARRAY_LENGTH)
|
152
|
+
#str << k.to_s << "=>[" << (v[0..HASH2MD5_MAX_ARRAY_LENGTH] + v[v.length-3..v.length+3] + v[-3..-1]) * "," << "; #{ v.length }]"
|
151
153
|
str << k.to_s << "=>[" << v[0..HASH2MD5_MAX_ARRAY_LENGTH] * "," << "; #{ v.length }]"
|
152
154
|
when TSV::Parser === v
|
153
155
|
str << remove_long_items(v)
|
@@ -272,7 +272,7 @@ class Step
|
|
272
272
|
end
|
273
273
|
|
274
274
|
def streaming?
|
275
|
-
IO === @result or status == :streaming
|
275
|
+
IO === @result or @saved_stream or status == :streaming
|
276
276
|
end
|
277
277
|
|
278
278
|
def running?
|
@@ -430,29 +430,31 @@ module Workflow
|
|
430
430
|
end
|
431
431
|
|
432
432
|
def rec_dependencies(taskname)
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
433
|
+
@rec_dependencies ||= begin
|
434
|
+
if task_dependencies.include? taskname
|
435
|
+
deps = task_dependencies[taskname]
|
436
|
+
all_deps = deps.select{|dep| String === dep or Symbol === dep or Array === dep}
|
437
|
+
deps.each do |dep|
|
438
|
+
case dep
|
439
|
+
when Array
|
440
|
+
dep.first.rec_dependencies(dep.last).each do |d|
|
441
|
+
if Array === d
|
442
|
+
all_deps << d
|
443
|
+
else
|
444
|
+
all_deps << [dep.first, d]
|
445
|
+
end
|
446
|
+
end
|
447
|
+
when String, Symbol
|
448
|
+
all_deps.concat rec_dependencies(dep.to_sym)
|
449
|
+
when DependencyBlock
|
450
|
+
all_deps << dep.dependency
|
451
|
+
end
|
452
|
+
end
|
453
|
+
all_deps.uniq
|
454
|
+
else
|
455
|
+
[]
|
456
|
+
end
|
457
|
+
end
|
456
458
|
end
|
457
459
|
|
458
460
|
def task_from_dep(dep)
|
@@ -98,6 +98,10 @@ class Step
|
|
98
98
|
def checks
|
99
99
|
rec_dependencies.collect{|dependency| dependency.path }.uniq
|
100
100
|
end
|
101
|
+
|
102
|
+
def dirty?
|
103
|
+
rec_dependencies.collect{|dependency| dependency.path }.uniq.reject{|path| path.exists?}.any?
|
104
|
+
end
|
101
105
|
|
102
106
|
def kill_children
|
103
107
|
begin
|
@@ -128,30 +132,32 @@ class Step
|
|
128
132
|
@seen.uniq!
|
129
133
|
end
|
130
134
|
|
135
|
+
return if @seen.empty?
|
136
|
+
|
137
|
+
@seen.each do |dependency|
|
138
|
+
next if dependency == self
|
139
|
+
if dependency.streaming? and not dependency.running?
|
140
|
+
dependency.clean
|
141
|
+
else
|
142
|
+
dependency.clean if dependency.error? or dependency.aborted? or dependency.status.nil? or
|
143
|
+
(dependency.done? and dependency.dirty?) or
|
144
|
+
not (dependency.done? or dependency.running?)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
131
148
|
@seen.each do |dependency|
|
132
149
|
next if dependency == self
|
133
150
|
next unless dependencies.include? dependency
|
134
151
|
dependency.dup_inputs
|
135
152
|
end
|
136
153
|
|
137
|
-
return if @seen.empty?
|
138
|
-
|
139
154
|
log :dependencies, "#{Log.color :magenta, "Dependencies"} #{Log.color :yellow, task.name.to_s || ""}"
|
140
155
|
@seen.each do |dependency|
|
141
156
|
next if dependency == self
|
142
157
|
next unless dependencies.include? dependency
|
143
158
|
Log.info "#{Log.color :cyan, "dependency"} #{Log.color :yellow, task.name.to_s || ""} => #{Log.color :yellow, dependency.task_name.to_s || ""} -- #{Log.color :blue, dependency.path}"
|
144
159
|
begin
|
145
|
-
|
146
|
-
next if dependency.running?
|
147
|
-
dependency.clean
|
148
|
-
else
|
149
|
-
dependency.clean if (dependency.error? or dependency.aborted? or dependency.status.nil? or not (dependency.done? or dependency.running?))
|
150
|
-
end
|
151
|
-
|
152
|
-
unless dependency.started?
|
153
|
-
dependency.run(true)
|
154
|
-
end
|
160
|
+
dependency.run(true) unless dependency.started?
|
155
161
|
rescue Aborted
|
156
162
|
Log.error "Aborted dep. #{Log.color :red, dependency.task.name.to_s}"
|
157
163
|
raise $!
|
@@ -439,7 +445,9 @@ class Step
|
|
439
445
|
|
440
446
|
grace
|
441
447
|
|
442
|
-
|
448
|
+
if streaming?
|
449
|
+
join_stream
|
450
|
+
end
|
443
451
|
|
444
452
|
return self if not Open.exists? info_file
|
445
453
|
|
@@ -53,7 +53,11 @@ def report_msg(status, name, path)
|
|
53
53
|
task = Log.color(:yellow, parts.pop)
|
54
54
|
workflow = Log.color(:magenta, parts.pop)
|
55
55
|
|
56
|
-
|
56
|
+
if $main_mtime and ($main_mtime - File.mtime(path)) < 0
|
57
|
+
status_msg(status) << " " << [workflow, task, path] * " " << " (#{Log.color(:red, "Mtime out of sync") })\n"
|
58
|
+
else
|
59
|
+
status_msg(status) << " " << [workflow, task, path] * " " << "\n"
|
60
|
+
end
|
57
61
|
end
|
58
62
|
|
59
63
|
def report(step, offset = 0)
|
@@ -61,6 +65,7 @@ def report(step, offset = 0)
|
|
61
65
|
path = step.path
|
62
66
|
status = info[:status] || :missing
|
63
67
|
name = info[:name] || File.basename(path)
|
68
|
+
status = :unsync if status == :done and not File.exists? path
|
64
69
|
str = " " * offset
|
65
70
|
str << report_msg(status, name, path)
|
66
71
|
info[:dependencies].each do |task,name,path|
|
@@ -76,5 +81,6 @@ def report(step, offset = 0)
|
|
76
81
|
end
|
77
82
|
|
78
83
|
step = get_step file
|
84
|
+
$main_mtime = File.exists?(step.path) ? File.mtime(step.path) : nil
|
79
85
|
|
80
86
|
puts report(step).strip
|
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.17.
|
4
|
+
version: 5.17.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|