scout-gear 7.1.0 → 7.2.0
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/.vimproject +29 -0
- data/VERSION +1 -1
- data/bin/scout +5 -1
- data/lib/rbbt-scout.rb +5 -0
- data/lib/scout/concurrent_stream.rb +6 -2
- data/lib/scout/config.rb +168 -0
- data/lib/scout/exceptions.rb +4 -3
- data/lib/scout/indiferent_hash/options.rb +1 -0
- data/lib/scout/indiferent_hash.rb +4 -2
- data/lib/scout/log/color.rb +3 -1
- data/lib/scout/log/progress/report.rb +1 -0
- data/lib/scout/log/progress/util.rb +1 -1
- data/lib/scout/log/progress.rb +5 -3
- data/lib/scout/log.rb +3 -2
- data/lib/scout/misc/monitor.rb +3 -0
- data/lib/scout/misc/system.rb +15 -0
- data/lib/scout/misc.rb +1 -0
- data/lib/scout/named_array.rb +68 -0
- data/lib/scout/open/stream.rb +38 -7
- data/lib/scout/path/find.rb +27 -3
- data/lib/scout/path/util.rb +7 -4
- data/lib/scout/persist/serialize.rb +7 -14
- data/lib/scout/persist.rb +21 -1
- data/lib/scout/resource/produce.rb +7 -94
- data/lib/scout/resource/software.rb +176 -0
- data/lib/scout/tsv/dumper.rb +107 -0
- data/lib/scout/tsv/index.rb +49 -0
- data/lib/scout/tsv/parser.rb +203 -30
- data/lib/scout/tsv/path.rb +13 -0
- data/lib/scout/tsv/persist/adapter.rb +348 -0
- data/lib/scout/tsv/persist/tokyocabinet.rb +113 -0
- data/lib/scout/tsv/persist.rb +15 -0
- data/lib/scout/tsv/traverse.rb +48 -0
- data/lib/scout/tsv/util.rb +24 -0
- data/lib/scout/tsv.rb +16 -3
- data/lib/scout/work_queue/worker.rb +3 -3
- data/lib/scout/work_queue.rb +22 -7
- data/lib/scout/workflow/definition.rb +93 -4
- data/lib/scout/workflow/step/config.rb +18 -0
- data/lib/scout/workflow/step/dependencies.rb +40 -0
- data/lib/scout/workflow/step/file.rb +15 -0
- data/lib/scout/workflow/step/info.rb +31 -4
- data/lib/scout/workflow/step/provenance.rb +148 -0
- data/lib/scout/workflow/step.rb +68 -19
- data/lib/scout/workflow/task.rb +3 -2
- data/lib/scout/workflow/usage.rb +1 -1
- data/lib/scout/workflow.rb +11 -3
- data/lib/scout-gear.rb +1 -0
- data/lib/scout.rb +1 -0
- data/scout-gear.gemspec +34 -3
- data/scout_commands/find +1 -1
- data/scout_commands/workflow/task +16 -10
- data/share/software/install_helpers +523 -0
- data/test/scout/log/test_progress.rb +0 -2
- data/test/scout/misc/test_system.rb +21 -0
- data/test/scout/open/test_stream.rb +159 -0
- data/test/scout/path/test_find.rb +14 -7
- data/test/scout/resource/test_software.rb +24 -0
- data/test/scout/test_config.rb +66 -0
- data/test/scout/test_meta_extension.rb +10 -0
- data/test/scout/test_named_array.rb +19 -0
- data/test/scout/test_persist.rb +35 -0
- data/test/scout/test_tmpfile.rb +2 -2
- data/test/scout/test_tsv.rb +41 -1
- data/test/scout/test_work_queue.rb +40 -13
- data/test/scout/tsv/persist/test_adapter.rb +34 -0
- data/test/scout/tsv/persist/test_tokyocabinet.rb +92 -0
- data/test/scout/tsv/test_dumper.rb +44 -0
- data/test/scout/tsv/test_index.rb +64 -0
- data/test/scout/tsv/test_parser.rb +86 -0
- data/test/scout/tsv/test_persist.rb +36 -0
- data/test/scout/tsv/test_traverse.rb +9 -0
- data/test/scout/tsv/test_util.rb +0 -0
- data/test/scout/work_queue/test_worker.rb +3 -3
- data/test/scout/workflow/step/test_dependencies.rb +25 -0
- data/test/scout/workflow/step/test_info.rb +15 -17
- data/test/scout/workflow/step/test_load.rb +16 -18
- data/test/scout/workflow/step/test_provenance.rb +25 -0
- data/test/scout/workflow/test_step.rb +206 -10
- data/test/scout/workflow/test_task.rb +0 -3
- data/test/test_helper.rb +6 -0
- metadata +33 -2
@@ -0,0 +1,148 @@
|
|
1
|
+
class Step
|
2
|
+
def self.job_path?(path)
|
3
|
+
path.split("/")[-4] == "jobs"
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.status_color(status)
|
7
|
+
case status.to_sym
|
8
|
+
when :error, :aborted, :missing, :dead, :unsync
|
9
|
+
:red
|
10
|
+
when :streaming, :started
|
11
|
+
:cyan
|
12
|
+
when :done, :noinfo
|
13
|
+
:green
|
14
|
+
when :dependencies, :waiting, :setup
|
15
|
+
:yellow
|
16
|
+
when :notfound, :cleaned
|
17
|
+
:blue
|
18
|
+
else
|
19
|
+
if status.to_s.index ">"
|
20
|
+
:cyan
|
21
|
+
else
|
22
|
+
:cyan
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.prov_status_msg(status)
|
28
|
+
color = status_color(status)
|
29
|
+
Log.color(color, status.to_s)
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.prov_report_msg(status, name, path, info, input = nil)
|
33
|
+
parts = path.sub(/\{.*/,'').split "/"
|
34
|
+
|
35
|
+
parts.pop
|
36
|
+
|
37
|
+
task = Log.color(:yellow, parts.pop)
|
38
|
+
workflow = Log.color(:magenta, parts.pop)
|
39
|
+
|
40
|
+
if ! Step.job_path?(path)
|
41
|
+
task, status, workflow = Log.color(:yellow, info[:task_name]), Log.color(:green, "file"), Log.color(:magenta, "-")
|
42
|
+
end
|
43
|
+
|
44
|
+
path_mtime = begin
|
45
|
+
Open.mtime(path)
|
46
|
+
rescue Exception
|
47
|
+
nil
|
48
|
+
end
|
49
|
+
|
50
|
+
if input.nil? || input.empty?
|
51
|
+
input_str = nil
|
52
|
+
else
|
53
|
+
input = input.reject{|dep,name| (input & dep.dependencies.collect{|d| [d,name]}).any? }
|
54
|
+
input = input.reject{|dep,name| (input & dep.input_dependencies.collect{|d| [d,name]}).any? }
|
55
|
+
input_str = Log.color(:magenta, "-> ") + input.collect{|dep,name| Log.color(:yellow, dep.task_name.to_s) + ":" + Log.color(:yellow, name) }.uniq * " "
|
56
|
+
end
|
57
|
+
|
58
|
+
str = if ! (Open.remote?(path) || Open.ssh?(path)) && (Open.exists?(path) && $main_mtime && path_mtime && ($main_mtime - path_mtime) < -2)
|
59
|
+
prov_status_msg(status.to_s) << " " << [workflow, task, path, input_str].compact * " " << " (#{Log.color(:red, "Mtime out of sync") })"
|
60
|
+
else
|
61
|
+
prov_status_msg(status.to_s) << " " << [workflow, task, path, input_str].compact * " "
|
62
|
+
end
|
63
|
+
|
64
|
+
if $inputs and $inputs.any?
|
65
|
+
job_inputs = Workflow.load_step(path).recursive_inputs.to_hash
|
66
|
+
IndiferentHash.setup(job_inputs)
|
67
|
+
|
68
|
+
$inputs.each do |input|
|
69
|
+
value = job_inputs[input]
|
70
|
+
next if value.nil?
|
71
|
+
value_str = Misc.fingerprint(value)
|
72
|
+
str << "\t#{Log.color :magenta, input}=#{value_str}"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
if $info_fields and $info_fields.any?
|
77
|
+
$info_fields.each do |field|
|
78
|
+
IndiferentHash.setup(info)
|
79
|
+
value = info[field]
|
80
|
+
next if value.nil?
|
81
|
+
value_str = Misc.fingerprint(value)
|
82
|
+
str << "\t#{Log.color :magenta, field}=#{value_str}"
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
str << "\n"
|
87
|
+
end
|
88
|
+
|
89
|
+
def self.prov_report(step, offset = 0, task = nil, seen = [], expand_repeats = false, input = nil)
|
90
|
+
info = step.info || {}
|
91
|
+
info[:task_name] = task
|
92
|
+
path = step.path
|
93
|
+
status = info[:status] || :missing
|
94
|
+
status = "remote" if Open.remote?(path) || Open.ssh?(path)
|
95
|
+
name = info[:name] || File.basename(path)
|
96
|
+
status = :unsync if status == :done and not Open.exist?(path)
|
97
|
+
status = :notfound if status == :noinfo and not Open.exist?(path)
|
98
|
+
|
99
|
+
|
100
|
+
this_step_msg = prov_report_msg(status, name, path, info, input)
|
101
|
+
|
102
|
+
input_dependencies = {}
|
103
|
+
step.dependencies.each do |dep|
|
104
|
+
if dep.input_dependencies.any?
|
105
|
+
dep.input_dependencies.each do |id|
|
106
|
+
input_name, _dep = dep.recursive_inputs.fields.zip(dep.recursive_inputs).select{|f,d|
|
107
|
+
d == id || (String === d && d.start_with?(id.files_dir)) || (Array === d && d.include?(id))
|
108
|
+
}.last
|
109
|
+
if input_name
|
110
|
+
input_dependencies[id] ||= []
|
111
|
+
input_dependencies[id] << [dep, input_name]
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end if step.dependencies
|
116
|
+
|
117
|
+
str = ""
|
118
|
+
str = " " * offset + this_step_msg if ENV["RBBT_ORIGINAL_STACK"] == 'true'
|
119
|
+
|
120
|
+
step.dependencies.dup.tap{|l|
|
121
|
+
l.reverse! if ENV["RBBT_ORIGINAL_STACK"] == 'true'
|
122
|
+
}.each do |dep|
|
123
|
+
path = dep.path
|
124
|
+
new = ! seen.include?(path)
|
125
|
+
if new
|
126
|
+
seen << path
|
127
|
+
str << prov_report(dep, offset + 1, task, seen, expand_repeats, input_dependencies[dep])
|
128
|
+
else
|
129
|
+
if expand_repeats
|
130
|
+
str << Log.color(Step.status_color(dep.status), Log.uncolor(prov_report(dep, offset+1, task)))
|
131
|
+
else
|
132
|
+
info = dep.info || {}
|
133
|
+
status = info[:status] || :missing
|
134
|
+
status = "remote" if Open.remote?(path) || Open.ssh?(path)
|
135
|
+
name = info[:name] || File.basename(path)
|
136
|
+
status = :unsync if status == :done and not Open.exist?(path)
|
137
|
+
status = :notfound if status == :noinfo and not Open.exist?(path)
|
138
|
+
|
139
|
+
str << Log.color(Step.status_color(status), " " * (offset + 1) + Log.uncolor(prov_report_msg(status, name, path, info, input_dependencies[dep])))
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end if step.dependencies
|
143
|
+
|
144
|
+
str += (" " * offset) + this_step_msg unless ENV["RBBT_ORIGINAL_STACK"] == 'true'
|
145
|
+
|
146
|
+
str
|
147
|
+
end
|
148
|
+
end
|
data/lib/scout/workflow/step.rb
CHANGED
@@ -2,15 +2,25 @@ require_relative '../path'
|
|
2
2
|
require_relative '../persist'
|
3
3
|
require_relative 'step/info'
|
4
4
|
require_relative 'step/load'
|
5
|
+
require_relative 'step/file'
|
6
|
+
require_relative 'step/dependencies'
|
7
|
+
require_relative 'step/provenance'
|
8
|
+
require_relative 'step/config'
|
5
9
|
|
6
10
|
class Step
|
7
11
|
|
8
|
-
attr_accessor :path, :inputs, :dependencies, :task
|
12
|
+
attr_accessor :path, :inputs, :dependencies, :task, :tee_copies
|
9
13
|
def initialize(path, inputs = nil, dependencies = nil, &task)
|
10
14
|
@path = path
|
11
15
|
@inputs = inputs
|
12
16
|
@dependencies = dependencies
|
13
17
|
@task = task
|
18
|
+
@mutex = Mutex.new
|
19
|
+
@tee_copies = 1
|
20
|
+
end
|
21
|
+
|
22
|
+
def synchronize(&block)
|
23
|
+
@mutex.synchronize(&block)
|
14
24
|
end
|
15
25
|
|
16
26
|
def inputs
|
@@ -48,30 +58,49 @@ class Step
|
|
48
58
|
@task_name ||= @task.name if @task.respond_to?(:name)
|
49
59
|
end
|
50
60
|
|
61
|
+
def workflow
|
62
|
+
@task.workflow if @task
|
63
|
+
end
|
64
|
+
|
51
65
|
def exec
|
52
|
-
self.instance_exec(*inputs, &task)
|
66
|
+
@result = self.instance_exec(*inputs, &task)
|
53
67
|
end
|
54
68
|
|
55
69
|
attr_reader :result
|
56
70
|
def run
|
57
71
|
return @result || self.load if done?
|
58
|
-
|
59
|
-
|
72
|
+
prepare_dependencies
|
73
|
+
run_dependencies
|
74
|
+
@result = Persist.persist(name, type, :path => path, :tee_copies => tee_copies) do
|
60
75
|
begin
|
61
76
|
merge_info :status => :start, :start => Time.now,
|
62
77
|
:pid => Process.pid, :pid_hostname => ENV["HOSTNAME"],
|
63
78
|
:inputs => inputs, :type => type,
|
64
79
|
:dependencies => dependencies.collect{|d| d.path }
|
65
80
|
|
66
|
-
|
81
|
+
exec
|
82
|
+
rescue Exception => e
|
83
|
+
merge_info :status => :error, :exception => e
|
84
|
+
raise e
|
67
85
|
ensure
|
68
|
-
if
|
69
|
-
|
86
|
+
if ! (error? || aborted?)
|
87
|
+
if streaming?
|
88
|
+
ConcurrentStream.setup(@result) do
|
89
|
+
merge_info :status => :done, :end => Time.now
|
90
|
+
end
|
91
|
+
|
92
|
+
@result.abort_callback = proc do |exception|
|
93
|
+
if Aborted === exception || Interrupt === exception
|
94
|
+
merge_info :status => :aborted, :end => Time.now
|
95
|
+
else
|
96
|
+
merge_info :status => :error, :exception => exception, :end => Time.now
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
log :streaming
|
101
|
+
else
|
70
102
|
merge_info :status => :done, :end => Time.now
|
71
103
|
end
|
72
|
-
log :streaming
|
73
|
-
else
|
74
|
-
merge_info :status => :done, :end => Time.now
|
75
104
|
end
|
76
105
|
end
|
77
106
|
end
|
@@ -82,19 +111,34 @@ class Step
|
|
82
111
|
end
|
83
112
|
|
84
113
|
def streaming?
|
85
|
-
IO === @result || StringIO === @result
|
114
|
+
@take_stream || IO === @result || StringIO === @result
|
86
115
|
end
|
87
116
|
|
88
|
-
def
|
89
|
-
|
90
|
-
|
117
|
+
def get_stream
|
118
|
+
synchronize do
|
119
|
+
if streaming? && ! @result.nil?
|
120
|
+
if @result.next
|
121
|
+
Log.debug "Taking result #{Log.fingerprint @result} next #{Log.fingerprint @result.next}"
|
122
|
+
else
|
123
|
+
Log.debug "Taking result #{Log.fingerprint @result}"
|
124
|
+
end
|
125
|
+
@take_stream, @result = @result, @result.next
|
126
|
+
@take_stream
|
127
|
+
elsif done?
|
128
|
+
Open.open(self.path)
|
129
|
+
else
|
130
|
+
if running?
|
131
|
+
nil
|
132
|
+
else
|
133
|
+
exec
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
91
137
|
end
|
92
138
|
|
93
139
|
def join
|
94
|
-
if streaming?
|
95
|
-
|
96
|
-
@result = nil
|
97
|
-
end
|
140
|
+
stream = get_stream if streaming?
|
141
|
+
Open.consume_stream(stream, false) if stream
|
98
142
|
end
|
99
143
|
|
100
144
|
def produce
|
@@ -109,8 +153,13 @@ class Step
|
|
109
153
|
end
|
110
154
|
|
111
155
|
def clean
|
156
|
+
@take_stream = nil
|
157
|
+
@result = nil
|
158
|
+
@info = nil
|
159
|
+
@info_load_time = nil
|
112
160
|
Open.rm path if Open.exist?(path)
|
113
161
|
Open.rm info_file if Open.exist?(info_file)
|
162
|
+
Open.rm_rf files_dir if Open.exist?(files_dir)
|
114
163
|
end
|
115
164
|
|
116
165
|
def recursive_clean
|
@@ -128,6 +177,6 @@ class Step
|
|
128
177
|
end
|
129
178
|
|
130
179
|
def digest_str
|
131
|
-
path
|
180
|
+
path.dup
|
132
181
|
end
|
133
182
|
end
|
data/lib/scout/workflow/task.rb
CHANGED
@@ -4,7 +4,7 @@ require_relative 'task/inputs'
|
|
4
4
|
|
5
5
|
module Task
|
6
6
|
extend MetaExtension
|
7
|
-
extension_attr :name, :type, :inputs, :deps, :directory, :description
|
7
|
+
extension_attr :name, :type, :inputs, :deps, :directory, :description, :returns, :extension, :workflow
|
8
8
|
|
9
9
|
DEFAULT_NAME = "Default"
|
10
10
|
|
@@ -54,7 +54,7 @@ module Task
|
|
54
54
|
resolved_inputs = {}
|
55
55
|
inputs.each do |k,v|
|
56
56
|
if Symbol === v
|
57
|
-
input_dep = dependencies.select{|d| d.task_name == v}.first
|
57
|
+
input_dep = dependencies.select{|d| d.task_name == v }.first
|
58
58
|
resolved_inputs[k] = input_dep || inputs[v] || k
|
59
59
|
else
|
60
60
|
resolved_inputs[k] = v
|
@@ -150,6 +150,7 @@ module Task
|
|
150
150
|
|
151
151
|
path = directory[id]
|
152
152
|
|
153
|
+
NamedArray.setup(inputs, @inputs.collect{|i| i[0] }) if @inputs
|
153
154
|
Step.new path.find, inputs, dependencies, &self
|
154
155
|
end
|
155
156
|
end
|
data/lib/scout/workflow/usage.rb
CHANGED
@@ -34,7 +34,6 @@ module Task
|
|
34
34
|
str.puts Log.color :yellow, dep + ":"
|
35
35
|
str.puts
|
36
36
|
str.puts SOPT.input_array_doc(inputs)
|
37
|
-
str.puts
|
38
37
|
end
|
39
38
|
|
40
39
|
#task_inputs = dep_inputs deps, workflow
|
@@ -72,6 +71,7 @@ module Task
|
|
72
71
|
str.puts
|
73
72
|
end
|
74
73
|
|
74
|
+
str.puts
|
75
75
|
str.puts Log.color(:magenta, "Returns: ") << Log.color(:blue, type.to_s) << "\n"
|
76
76
|
str.puts
|
77
77
|
|
data/lib/scout/workflow.rb
CHANGED
@@ -24,17 +24,25 @@ module Workflow
|
|
24
24
|
base.libdir = Path.setup(libdir).tap{|p| p.resource = base}
|
25
25
|
end
|
26
26
|
|
27
|
-
def self.require_workflow(
|
28
|
-
workflow =
|
27
|
+
def self.require_workflow(workflow_name)
|
28
|
+
workflow = workflow_name
|
29
|
+
workflow = Path.setup('workflows')[workflow_name]["workflow.rb"] unless Open.exists?(workflow)
|
30
|
+
workflow = Path.setup('workflows')[Misc.snake_case(workflow_name)]["workflow.rb"] unless Open.exists?(workflow)
|
31
|
+
workflow = Path.setup('workflows')[Misc.camel_case(workflow_name)]["workflow.rb"] unless Open.exists?(workflow)
|
29
32
|
if Open.exists?(workflow)
|
30
33
|
workflow = workflow.find if Path === workflow
|
34
|
+
$LOAD_PATH.unshift(File.join(File.dirname(workflow), 'lib'))
|
31
35
|
load workflow
|
36
|
+
else
|
37
|
+
raise "Workflow #{workflow_name} not found"
|
32
38
|
end
|
33
39
|
workflows.last
|
34
40
|
end
|
35
41
|
|
36
42
|
def job(name, *args)
|
37
43
|
task = tasks[name]
|
38
|
-
task.job(*args)
|
44
|
+
step = task.job(*args)
|
45
|
+
step.extend step_module
|
46
|
+
step
|
39
47
|
end
|
40
48
|
end
|
data/lib/scout-gear.rb
CHANGED
data/lib/scout.rb
CHANGED
data/scout-gear.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: scout-gear 7.
|
5
|
+
# stub: scout-gear 7.2.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "scout-gear".freeze
|
9
|
-
s.version = "7.
|
9
|
+
s.version = "7.2.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Miguel Vazquez".freeze]
|
14
|
-
s.date = "2023-05-
|
14
|
+
s.date = "2023-05-09"
|
15
15
|
s.description = "Temporary files, logs, etc.".freeze
|
16
16
|
s.email = "mikisvaz@gmail.com".freeze
|
17
17
|
s.executables = ["scout".freeze]
|
@@ -28,10 +28,12 @@ Gem::Specification.new do |s|
|
|
28
28
|
"Rakefile",
|
29
29
|
"VERSION",
|
30
30
|
"bin/scout",
|
31
|
+
"lib/rbbt-scout.rb",
|
31
32
|
"lib/scout-gear.rb",
|
32
33
|
"lib/scout.rb",
|
33
34
|
"lib/scout/cmd.rb",
|
34
35
|
"lib/scout/concurrent_stream.rb",
|
36
|
+
"lib/scout/config.rb",
|
35
37
|
"lib/scout/exceptions.rb",
|
36
38
|
"lib/scout/indiferent_hash.rb",
|
37
39
|
"lib/scout/indiferent_hash/case_insensitive.rb",
|
@@ -50,6 +52,8 @@ Gem::Specification.new do |s|
|
|
50
52
|
"lib/scout/misc/format.rb",
|
51
53
|
"lib/scout/misc/insist.rb",
|
52
54
|
"lib/scout/misc/monitor.rb",
|
55
|
+
"lib/scout/misc/system.rb",
|
56
|
+
"lib/scout/named_array.rb",
|
53
57
|
"lib/scout/open.rb",
|
54
58
|
"lib/scout/open/lock.rb",
|
55
59
|
"lib/scout/open/remote.rb",
|
@@ -68,6 +72,7 @@ Gem::Specification.new do |s|
|
|
68
72
|
"lib/scout/resource/produce.rb",
|
69
73
|
"lib/scout/resource/produce/rake.rb",
|
70
74
|
"lib/scout/resource/scout.rb",
|
75
|
+
"lib/scout/resource/software.rb",
|
71
76
|
"lib/scout/resource/util.rb",
|
72
77
|
"lib/scout/semaphore.rb",
|
73
78
|
"lib/scout/simple_opt.rb",
|
@@ -78,7 +83,15 @@ Gem::Specification.new do |s|
|
|
78
83
|
"lib/scout/simple_opt/setup.rb",
|
79
84
|
"lib/scout/tmpfile.rb",
|
80
85
|
"lib/scout/tsv.rb",
|
86
|
+
"lib/scout/tsv/dumper.rb",
|
87
|
+
"lib/scout/tsv/index.rb",
|
81
88
|
"lib/scout/tsv/parser.rb",
|
89
|
+
"lib/scout/tsv/path.rb",
|
90
|
+
"lib/scout/tsv/persist.rb",
|
91
|
+
"lib/scout/tsv/persist/adapter.rb",
|
92
|
+
"lib/scout/tsv/persist/tokyocabinet.rb",
|
93
|
+
"lib/scout/tsv/traverse.rb",
|
94
|
+
"lib/scout/tsv/util.rb",
|
82
95
|
"lib/scout/work_queue.rb",
|
83
96
|
"lib/scout/work_queue/socket.rb",
|
84
97
|
"lib/scout/work_queue/worker.rb",
|
@@ -86,8 +99,12 @@ Gem::Specification.new do |s|
|
|
86
99
|
"lib/scout/workflow/definition.rb",
|
87
100
|
"lib/scout/workflow/documentation.rb",
|
88
101
|
"lib/scout/workflow/step.rb",
|
102
|
+
"lib/scout/workflow/step/config.rb",
|
103
|
+
"lib/scout/workflow/step/dependencies.rb",
|
104
|
+
"lib/scout/workflow/step/file.rb",
|
89
105
|
"lib/scout/workflow/step/info.rb",
|
90
106
|
"lib/scout/workflow/step/load.rb",
|
107
|
+
"lib/scout/workflow/step/provenance.rb",
|
91
108
|
"lib/scout/workflow/task.rb",
|
92
109
|
"lib/scout/workflow/task/inputs.rb",
|
93
110
|
"lib/scout/workflow/usage.rb",
|
@@ -104,6 +121,7 @@ Gem::Specification.new do |s|
|
|
104
121
|
"scout_commands/workflow/task_old",
|
105
122
|
"share/color/color_names",
|
106
123
|
"share/color/diverging_colors.hex",
|
124
|
+
"share/software/install_helpers",
|
107
125
|
"test/scout/indiferent_hash/test_case_insensitive.rb",
|
108
126
|
"test/scout/indiferent_hash/test_options.rb",
|
109
127
|
"test/scout/log/test_color.rb",
|
@@ -111,6 +129,7 @@ Gem::Specification.new do |s|
|
|
111
129
|
"test/scout/misc/test_digest.rb",
|
112
130
|
"test/scout/misc/test_filesystem.rb",
|
113
131
|
"test/scout/misc/test_insist.rb",
|
132
|
+
"test/scout/misc/test_system.rb",
|
114
133
|
"test/scout/open/test_lock.rb",
|
115
134
|
"test/scout/open/test_remote.rb",
|
116
135
|
"test/scout/open/test_stream.rb",
|
@@ -122,6 +141,7 @@ Gem::Specification.new do |s|
|
|
122
141
|
"test/scout/persist/test_serialize.rb",
|
123
142
|
"test/scout/resource/test_path.rb",
|
124
143
|
"test/scout/resource/test_produce.rb",
|
144
|
+
"test/scout/resource/test_software.rb",
|
125
145
|
"test/scout/resource/test_util.rb",
|
126
146
|
"test/scout/simple_opt/test_doc.rb",
|
127
147
|
"test/scout/simple_opt/test_get.rb",
|
@@ -129,10 +149,12 @@ Gem::Specification.new do |s|
|
|
129
149
|
"test/scout/simple_opt/test_setup.rb",
|
130
150
|
"test/scout/test_cmd.rb",
|
131
151
|
"test/scout/test_concurrent_stream.rb",
|
152
|
+
"test/scout/test_config.rb",
|
132
153
|
"test/scout/test_indiferent_hash.rb",
|
133
154
|
"test/scout/test_log.rb",
|
134
155
|
"test/scout/test_meta_extension.rb",
|
135
156
|
"test/scout/test_misc.rb",
|
157
|
+
"test/scout/test_named_array.rb",
|
136
158
|
"test/scout/test_open.rb",
|
137
159
|
"test/scout/test_path.rb",
|
138
160
|
"test/scout/test_persist.rb",
|
@@ -142,11 +164,20 @@ Gem::Specification.new do |s|
|
|
142
164
|
"test/scout/test_tsv.rb",
|
143
165
|
"test/scout/test_work_queue.rb",
|
144
166
|
"test/scout/test_workflow.rb",
|
167
|
+
"test/scout/tsv/persist/test_adapter.rb",
|
168
|
+
"test/scout/tsv/persist/test_tokyocabinet.rb",
|
169
|
+
"test/scout/tsv/test_dumper.rb",
|
170
|
+
"test/scout/tsv/test_index.rb",
|
145
171
|
"test/scout/tsv/test_parser.rb",
|
172
|
+
"test/scout/tsv/test_persist.rb",
|
173
|
+
"test/scout/tsv/test_traverse.rb",
|
174
|
+
"test/scout/tsv/test_util.rb",
|
146
175
|
"test/scout/work_queue/test_socket.rb",
|
147
176
|
"test/scout/work_queue/test_worker.rb",
|
177
|
+
"test/scout/workflow/step/test_dependencies.rb",
|
148
178
|
"test/scout/workflow/step/test_info.rb",
|
149
179
|
"test/scout/workflow/step/test_load.rb",
|
180
|
+
"test/scout/workflow/step/test_provenance.rb",
|
150
181
|
"test/scout/workflow/task/test_inputs.rb",
|
151
182
|
"test/scout/workflow/test_definition.rb",
|
152
183
|
"test/scout/workflow/test_documentation.rb",
|
data/scout_commands/find
CHANGED
@@ -69,7 +69,7 @@ end if resource
|
|
69
69
|
|
70
70
|
path = (resource || Scout)[path.dup]
|
71
71
|
|
72
|
-
if where.nil? || where == 'all' || path.
|
72
|
+
if where.nil? || where == 'all' || path.path_maps.include?(where.to_sym)
|
73
73
|
location = path.find(where)
|
74
74
|
|
75
75
|
if Array === location
|
@@ -13,6 +13,7 @@ $ #{$0} [<options>] <workflow> <task>
|
|
13
13
|
-h--help Print this help
|
14
14
|
-jn--job_name* Name to use as job identifier
|
15
15
|
-pf--print_filepath Print the file path
|
16
|
+
-prov--provenance Print the step provenance
|
16
17
|
-cl--clean Clean the last step
|
17
18
|
-rcl--recursive_clean Clean all steps
|
18
19
|
EOF
|
@@ -22,7 +23,8 @@ workflow_name, task_name = ARGV
|
|
22
23
|
raise MissingParameterException.new :workflow if workflow_name.nil?
|
23
24
|
|
24
25
|
workflow = Workflow.require_workflow workflow_name
|
25
|
-
|
26
|
+
task_name = task_name.to_sym if task_name
|
27
|
+
task = workflow.tasks[task_name.to_sym]
|
26
28
|
|
27
29
|
options[:help] = true if task.nil?
|
28
30
|
|
@@ -38,20 +40,24 @@ if options[:help]
|
|
38
40
|
end
|
39
41
|
|
40
42
|
job_options = task.get_SOPT(task)
|
41
|
-
job =
|
43
|
+
job = workflow.job(task_name, options[:job_name], job_options)
|
42
44
|
|
43
45
|
job.recursive_clean if options[:recursive_clean]
|
44
46
|
job.clean if options[:clean]
|
45
47
|
|
46
|
-
|
47
|
-
|
48
|
-
if options[:print_filepath]
|
49
|
-
path = job.path
|
50
|
-
path = path.find if Path === path
|
51
|
-
puts path
|
48
|
+
if options[:provenance]
|
49
|
+
puts Step.prov_report(job)
|
52
50
|
else
|
53
|
-
|
54
|
-
|
51
|
+
job.run unless job.done?
|
52
|
+
|
53
|
+
if options[:print_filepath]
|
54
|
+
path = job.path
|
55
|
+
path = path.find if Path === path
|
56
|
+
puts path
|
57
|
+
else
|
58
|
+
if ! ((c = Open.consume_stream(job.get_stream, false, STDOUT, false)) && c.end_with?("\n"))
|
59
|
+
puts
|
60
|
+
end
|
55
61
|
end
|
56
62
|
end
|
57
63
|
|