scout-gear 8.1.0 → 9.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.vimproject +22 -0
- data/VERSION +1 -1
- data/bin/scout +1 -1
- data/lib/rbbt-scout.rb +4 -2
- data/lib/scout/cmd.rb +9 -5
- data/lib/scout/config.rb +1 -1
- data/lib/scout/indiferent_hash/options.rb +1 -1
- data/lib/scout/indiferent_hash.rb +17 -0
- data/lib/scout/log/progress/report.rb +1 -0
- data/lib/scout/log.rb +14 -11
- data/lib/scout/misc/digest.rb +1 -1
- data/lib/scout/misc/filesystem.rb +2 -3
- data/lib/scout/offsite/ssh.rb +3 -0
- data/lib/scout/offsite/step.rb +20 -3
- data/lib/scout/open/stream.rb +0 -1
- data/lib/scout/open.rb +8 -8
- data/lib/scout/path/util.rb +20 -0
- data/lib/scout/path.rb +1 -1
- data/lib/scout/persist/serialize.rb +1 -1
- data/lib/scout/resource/open.rb +8 -0
- data/lib/scout/resource/path.rb +12 -9
- data/lib/scout/resource/software.rb +4 -2
- data/lib/scout/resource/util.rb +5 -1
- data/lib/scout/resource.rb +2 -0
- data/lib/scout/tsv/dumper.rb +4 -1
- data/lib/scout/tsv/open.rb +7 -1
- data/lib/scout/tsv/parser.rb +13 -3
- data/lib/scout/tsv/util.rb +1 -1
- data/lib/scout/work_queue.rb +1 -0
- data/lib/scout/workflow/deployment/orchestrator.rb +17 -8
- data/lib/scout/workflow/step/dependencies.rb +11 -4
- data/lib/scout/workflow/step/file.rb +5 -1
- data/lib/scout/workflow/step/info.rb +16 -2
- data/lib/scout/workflow/step/inputs.rb +5 -0
- data/lib/scout/workflow/step/provenance.rb +28 -10
- data/lib/scout/workflow/step/status.rb +26 -2
- data/lib/scout/workflow/step.rb +26 -7
- data/lib/scout/workflow/task/dependencies.rb +3 -0
- data/lib/scout/workflow/task/inputs.rb +19 -9
- data/lib/scout/workflow/task.rb +24 -3
- data/lib/scout/workflow/usage.rb +22 -33
- data/lib/scout/workflow.rb +25 -12
- data/scout-gear.gemspec +9 -3
- data/scout_commands/resource/produce +66 -0
- data/scout_commands/template +52 -0
- data/scout_commands/workflow/install +3 -0
- data/scout_commands/workflow/task +25 -7
- data/share/software/install_helpers +2 -2
- data/share/templates/command +25 -0
- data/share/templates/workflow.rb +14 -0
- data/test/scout/offsite/test_step.rb +0 -1
- data/test/scout/resource/test_produce.rb +15 -0
- data/test/scout/resource/test_util.rb +9 -0
- data/test/scout/test_persist.rb +2 -2
- data/test/scout/test_work_queue.rb +1 -1
- data/test/scout/tsv/test_parser.rb +21 -0
- data/test/scout/workflow/step/test_info.rb +0 -1
- data/test/scout/workflow/step/test_provenance.rb +24 -1
- data/test/scout/workflow/task/test_dependencies.rb +2 -0
- data/test/scout/workflow/task/test_inputs.rb +0 -1
- data/test/scout/workflow/test_definition.rb +1 -1
- metadata +8 -2
data/lib/scout/workflow.rb
CHANGED
@@ -25,20 +25,33 @@ module Workflow
|
|
25
25
|
base.libdir = Path.setup(libdir).tap{|p| p.resource = base}
|
26
26
|
end
|
27
27
|
|
28
|
-
def self.require_workflow(
|
29
|
-
|
30
|
-
|
31
|
-
workflow = Path.setup('workflows')[Misc.snake_case(workflow_name)]["workflow.rb"] unless Open.exists?(workflow)
|
32
|
-
workflow = Path.setup('workflows')[Misc.camel_case(workflow_name)]["workflow.rb"] unless Open.exists?(workflow)
|
33
|
-
if Open.exists?(workflow)
|
28
|
+
def self.require_workflow(workflow_name_orig)
|
29
|
+
first = nil
|
30
|
+
workflow_name_orig.split("+").each do |complete_workflow_name|
|
34
31
|
self.main = nil
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
32
|
+
workflow_name, *subworkflows = complete_workflow_name.split("::")
|
33
|
+
workflow = workflow_name
|
34
|
+
workflow = Path.setup('workflows')[workflow_name]["workflow.rb"] unless Open.exists?(workflow)
|
35
|
+
workflow = Path.setup('workflows')[Misc.snake_case(workflow_name)]["workflow.rb"] unless Open.exists?(workflow)
|
36
|
+
workflow = Path.setup('workflows')[Misc.camel_case(workflow_name)]["workflow.rb"] unless Open.exists?(workflow)
|
37
|
+
if Open.exists?(workflow)
|
38
|
+
self.main = nil
|
39
|
+
workflow = workflow.find if Path === workflow
|
40
|
+
$LOAD_PATH.unshift(File.join(File.dirname(workflow), 'lib'))
|
41
|
+
load workflow
|
42
|
+
else
|
43
|
+
raise "Workflow #{workflow_name} not found"
|
44
|
+
end
|
45
|
+
|
46
|
+
current = begin
|
47
|
+
Kernel.const_get(complete_workflow_name)
|
48
|
+
rescue
|
49
|
+
self.main || workflows.last
|
50
|
+
end
|
51
|
+
|
52
|
+
first ||= current
|
40
53
|
end
|
41
|
-
|
54
|
+
first
|
42
55
|
end
|
43
56
|
|
44
57
|
def job(name, *args)
|
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
|
5
|
+
# stub: scout-gear 9.1.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "scout-gear".freeze
|
9
|
-
s.version = "
|
9
|
+
s.version = "9.1.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-06-
|
14
|
+
s.date = "2023-06-30"
|
15
15
|
s.description = "Temporary files, logs, path, resources, persistence, workflows, TSV, etc.".freeze
|
16
16
|
s.email = "mikisvaz@gmail.com".freeze
|
17
17
|
s.executables = ["scout".freeze]
|
@@ -77,6 +77,7 @@ Gem::Specification.new do |s|
|
|
77
77
|
"lib/scout/persist/path.rb",
|
78
78
|
"lib/scout/persist/serialize.rb",
|
79
79
|
"lib/scout/resource.rb",
|
80
|
+
"lib/scout/resource/open.rb",
|
80
81
|
"lib/scout/resource/path.rb",
|
81
82
|
"lib/scout/resource/produce.rb",
|
82
83
|
"lib/scout/resource/produce/rake.rb",
|
@@ -126,6 +127,7 @@ Gem::Specification.new do |s|
|
|
126
127
|
"lib/scout/workflow/step/dependencies.rb",
|
127
128
|
"lib/scout/workflow/step/file.rb",
|
128
129
|
"lib/scout/workflow/step/info.rb",
|
130
|
+
"lib/scout/workflow/step/inputs.rb",
|
129
131
|
"lib/scout/workflow/step/load.rb",
|
130
132
|
"lib/scout/workflow/step/progress.rb",
|
131
133
|
"lib/scout/workflow/step/provenance.rb",
|
@@ -143,6 +145,8 @@ Gem::Specification.new do |s|
|
|
143
145
|
"scout_commands/glob",
|
144
146
|
"scout_commands/offsite",
|
145
147
|
"scout_commands/rbbt",
|
148
|
+
"scout_commands/resource/produce",
|
149
|
+
"scout_commands/template",
|
146
150
|
"scout_commands/update",
|
147
151
|
"scout_commands/workflow/info",
|
148
152
|
"scout_commands/workflow/install",
|
@@ -151,6 +155,8 @@ Gem::Specification.new do |s|
|
|
151
155
|
"share/color/color_names",
|
152
156
|
"share/color/diverging_colors.hex",
|
153
157
|
"share/software/install_helpers",
|
158
|
+
"share/templates/command",
|
159
|
+
"share/templates/workflow.rb",
|
154
160
|
"test/scout/indiferent_hash/test_case_insensitive.rb",
|
155
161
|
"test/scout/indiferent_hash/test_options.rb",
|
156
162
|
"test/scout/log/test_color.rb",
|
@@ -0,0 +1,66 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'scout'
|
4
|
+
|
5
|
+
$0 = "scout #{$previous_commands.any? ? $previous_commands*" " + " " : "" }#{ File.basename(__FILE__) }" if $previous_commands
|
6
|
+
|
7
|
+
options = SOPT.setup <<EOF
|
8
|
+
|
9
|
+
Produce a resource
|
10
|
+
|
11
|
+
$ #{$0} [<options>] <Resource> <file>
|
12
|
+
|
13
|
+
-h--help Print this help
|
14
|
+
-W--workflows* Workflows to use; 'all' for all in Scout.etc.workflows:
|
15
|
+
-r--requires* Files to require; 'all' for all in Scout.etc.requires:
|
16
|
+
-f--force Force the production if the file is already present
|
17
|
+
EOF
|
18
|
+
if options[:help]
|
19
|
+
if defined? scout_usage
|
20
|
+
scout_usage
|
21
|
+
else
|
22
|
+
puts SOPT.doc
|
23
|
+
end
|
24
|
+
exit 0
|
25
|
+
end
|
26
|
+
|
27
|
+
case options[:workflows]
|
28
|
+
when nil, false, "false", "none"
|
29
|
+
when "all"
|
30
|
+
Scout.etc.workflows.list.each do |workflow|
|
31
|
+
Workflow.require_workflow file
|
32
|
+
end if Scout.etc.workflows.exists?
|
33
|
+
else
|
34
|
+
options[:workflows].split(/[ ,;|]/).each do |workflow|
|
35
|
+
Workflow.require_workflow workflow
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
case options[:requires]
|
40
|
+
when nil, false, "false", "none"
|
41
|
+
when "all"
|
42
|
+
Scout.etc.requires.list.each do |file|
|
43
|
+
require file
|
44
|
+
end if Scout.etc.requires.exists?
|
45
|
+
else
|
46
|
+
options[:requires].split(/[ ,;|]/).each do |file|
|
47
|
+
require file
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
resource, path = ARGV
|
52
|
+
|
53
|
+
begin
|
54
|
+
resource = Kernel.const_get(resource)
|
55
|
+
rescue
|
56
|
+
begin
|
57
|
+
resource = Workflow.require_workflow resource
|
58
|
+
rescue
|
59
|
+
raise "Resource not found: #{ resource }"
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
force = options[:force]
|
64
|
+
|
65
|
+
puts resource[path].produce(force).find
|
66
|
+
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'scout'
|
4
|
+
|
5
|
+
$0 = "scout #{$previous_commands.any? ? $previous_commands*" " + " " : "" }#{ File.basename(__FILE__) }" if $previous_commands
|
6
|
+
|
7
|
+
options = SOPT.setup <<EOF
|
8
|
+
|
9
|
+
Print a template
|
10
|
+
|
11
|
+
$ #{$0} [<options>] <template> [<VAR>=<value>]*
|
12
|
+
|
13
|
+
Print a template making the substitutions that follow
|
14
|
+
|
15
|
+
-h--help Print this help
|
16
|
+
-s--sub* List a substitutions as a parameter instead
|
17
|
+
-s--var* List a substitutions as a parameter, variable name
|
18
|
+
-s--value* List a substitutions as a parameter, value
|
19
|
+
EOF
|
20
|
+
if options[:help]
|
21
|
+
if defined? scout_usage
|
22
|
+
scout_usage
|
23
|
+
else
|
24
|
+
puts SOPT.doc
|
25
|
+
end
|
26
|
+
exit 0
|
27
|
+
end
|
28
|
+
|
29
|
+
template, *subs = ARGV
|
30
|
+
|
31
|
+
raise MissingParameterException, :template if template.nil?
|
32
|
+
|
33
|
+
txt = Scout.share.templates[template].find_with_extension('rb').read
|
34
|
+
|
35
|
+
if options[:sub]
|
36
|
+
subs ||= []
|
37
|
+
subs << options[:sub]
|
38
|
+
end
|
39
|
+
|
40
|
+
if options[:var]
|
41
|
+
subs ||= []
|
42
|
+
subs << [options[:var], options[:value]] * "="
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
subs.each do |sub|
|
47
|
+
key, value = sub.split("=")
|
48
|
+
|
49
|
+
txt.gsub!(key, value)
|
50
|
+
end
|
51
|
+
|
52
|
+
puts txt
|
@@ -49,6 +49,7 @@ Misc.in_dir(workflow_dir) do
|
|
49
49
|
Log.info "Updating: " + workflow
|
50
50
|
Misc.in_dir(Misc.snake_case(workflow)) do
|
51
51
|
`git pull`
|
52
|
+
`git checkout scout 2> /dev/null`
|
52
53
|
`git submodule init`
|
53
54
|
`git submodule update`
|
54
55
|
end
|
@@ -56,6 +57,7 @@ Misc.in_dir(workflow_dir) do
|
|
56
57
|
Misc.in_dir(workflow) do
|
57
58
|
Log.info "Updating: " + workflow
|
58
59
|
`git pull`
|
60
|
+
`git checkout scout 2> /dev/null`
|
59
61
|
`git submodule init`
|
60
62
|
`git submodule update`
|
61
63
|
end
|
@@ -93,6 +95,7 @@ Misc.in_dir(workflow_dir) do
|
|
93
95
|
end
|
94
96
|
Log.warn "Initializing and updating submodules for #{repo}. You might be prompted for passwords."
|
95
97
|
Misc.in_dir(Misc.snake_case(workflow)) do
|
98
|
+
`git checkout scout 2> /dev/null`
|
96
99
|
`git submodule init`
|
97
100
|
`git submodule update`
|
98
101
|
end
|
@@ -18,14 +18,15 @@ $ #{$0} [<options>] <workflow> <task>
|
|
18
18
|
-h--help Print this help
|
19
19
|
--nostream Disable job streaming
|
20
20
|
--update Update jobs with newer dependencies
|
21
|
-
|
21
|
+
--deploy* Deploy mode: serial, local, or SLURM (default 'serial')
|
22
|
+
-jn--jobname* Name to use as job identifier
|
22
23
|
-li--load_inputs* Directory with inputs files to load
|
23
24
|
-pf--print_filepath Print the file path
|
24
25
|
-prov--provenance Print the step provenance
|
25
26
|
-cl--clean Clean the last step
|
26
27
|
-rcl--recursive_clean Clean all steps
|
27
28
|
-ct--clean_task* Clean a particular task
|
28
|
-
-
|
29
|
+
-od--override_deps* Override deps using 'Workflow#task=<path>' array_separated
|
29
30
|
EOF
|
30
31
|
|
31
32
|
workflow_name, task_name = ARGV
|
@@ -38,8 +39,8 @@ task = workflow.tasks[task_name.to_sym] if task_name
|
|
38
39
|
|
39
40
|
options[:help] = true if task.nil?
|
40
41
|
|
41
|
-
help, provenance, clean, recursive_clean, clean_task, load_inputs, jobname, print_filepath, deploy = IndiferentHash.process_options options,
|
42
|
-
:help, :provenance, :clean, :recursive_clean, :clean_task, :load_inputs, :
|
42
|
+
help, provenance, clean, recursive_clean, clean_task, load_inputs, jobname, print_filepath, deploy, override_deps = IndiferentHash.process_options options,
|
43
|
+
:help, :provenance, :clean, :recursive_clean, :clean_task, :load_inputs, :jobname, :print_filepath, :deploy, :override_deps,
|
43
44
|
:deploy => 'serial'
|
44
45
|
|
45
46
|
if help
|
@@ -59,6 +60,13 @@ else
|
|
59
60
|
job_inputs = task.get_SOPT
|
60
61
|
end
|
61
62
|
|
63
|
+
if override_deps
|
64
|
+
override_deps.split($array_separator || ",").each do |part|
|
65
|
+
t_, value = part.split("=")
|
66
|
+
job_inputs.merge!( t_ => value)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
62
70
|
job = workflow.job(task_name, jobname, job_inputs)
|
63
71
|
|
64
72
|
job.recursive_clean if recursive_clean
|
@@ -78,7 +86,7 @@ if clean_task
|
|
78
86
|
dep.set_info :status, :cleaned
|
79
87
|
end
|
80
88
|
|
81
|
-
job.clean if job.task_name.to_s == clean_task.to_s
|
89
|
+
job.clean if (job.task_name.to_s == clean_task.to_s) || ! job.updated?
|
82
90
|
end
|
83
91
|
end
|
84
92
|
|
@@ -92,9 +100,19 @@ else
|
|
92
100
|
orchestrator = Workflow::Orchestrator.new 3, "cpus" => Misc.processors
|
93
101
|
orchestrator.process({}, job)
|
94
102
|
when "slurm"
|
95
|
-
|
103
|
+
require 'rbbt-scout'
|
104
|
+
require_relative '../../modules/rbbt-util/lib/rbbt/hpc'
|
105
|
+
HPC::BATCH_MODULE = HPC.batch_system "SLURM"
|
106
|
+
HPC::BATCH_MODULE.orchestrate_job(job, {})
|
107
|
+
job.grace
|
96
108
|
else
|
97
|
-
|
109
|
+
if deploy.end_with?('-slurm')
|
110
|
+
server = deploy.sub('-slurm','')
|
111
|
+
OffsiteStep.setup(job, server: server, slurm: true)
|
112
|
+
else
|
113
|
+
OffsiteStep.setup(job, server: deploy)
|
114
|
+
end
|
115
|
+
|
98
116
|
job.run
|
99
117
|
end unless job.done?
|
100
118
|
|
@@ -32,6 +32,7 @@ else
|
|
32
32
|
local basedir="$(realpath $1)"
|
33
33
|
local path="$(realpath "$2")"
|
34
34
|
local pre=""
|
35
|
+
basedir=${basedir%.}
|
35
36
|
while [[ ! $path = $basedir* ]]; do
|
36
37
|
pre=${pre}../
|
37
38
|
basedir=$(dirname $basedir)
|
@@ -44,9 +45,8 @@ function link(){
|
|
44
45
|
local source="$1"
|
45
46
|
local target="$2"
|
46
47
|
local rel_source=$(relative_path "$(dirname $target)" "$source")
|
47
|
-
|
48
|
+
|
48
49
|
[ -h "$target" ] && rm "$target"
|
49
|
-
echo ln -s "$rel_source" "$target" 1>&2
|
50
50
|
[ -h "$target" ] || ln -s "$rel_source" "$target"
|
51
51
|
}
|
52
52
|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'scout'
|
4
|
+
|
5
|
+
$0 = "scout #{$previous_commands.any? ? $previous_commands*" " + " " : "" }#{ File.basename(__FILE__) }" if $previous_commands
|
6
|
+
|
7
|
+
options = SOPT.setup <<EOF
|
8
|
+
|
9
|
+
Description of the tool
|
10
|
+
|
11
|
+
$ #{$0} [<options>] <filename> [<other|->]*
|
12
|
+
|
13
|
+
-h--help Print this help
|
14
|
+
EOF
|
15
|
+
if options[:help]
|
16
|
+
if defined? scout_usage
|
17
|
+
scout_usage
|
18
|
+
else
|
19
|
+
puts SOPT.doc
|
20
|
+
end
|
21
|
+
exit 0
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
|
@@ -74,4 +74,19 @@ end
|
|
74
74
|
assert_equal list, file.list
|
75
75
|
end
|
76
76
|
end
|
77
|
+
|
78
|
+
def test_produce_compressed
|
79
|
+
dir = tmpdir.directory[__method__]
|
80
|
+
dir.pkgdir = Scout
|
81
|
+
list = %w(a b)
|
82
|
+
|
83
|
+
Scout.claim dir["foo.gz"], :proc do |filename|
|
84
|
+
list
|
85
|
+
end
|
86
|
+
|
87
|
+
Misc.in_dir(dir) do
|
88
|
+
file = dir.foo
|
89
|
+
assert_include file.produce.find, '.gz'
|
90
|
+
end
|
91
|
+
end
|
77
92
|
end
|
@@ -7,6 +7,15 @@ class TestResourceUtil < Test::Unit::TestCase
|
|
7
7
|
assert_equal 'share/data/somedir/somepath', Scout.identify(path)
|
8
8
|
end
|
9
9
|
|
10
|
+
def test_identify_with_subdir
|
11
|
+
m = Module.new
|
12
|
+
m.extend Resource
|
13
|
+
m.subdir = 'test/subdir'
|
14
|
+
path = m.root['share/data/somedir/somepath'].find
|
15
|
+
assert_equal 'share/data/somedir/somepath', m.identify(path)
|
16
|
+
end
|
17
|
+
|
18
|
+
|
10
19
|
def test_relocate
|
11
20
|
TmpFile.with_file do |dir|
|
12
21
|
Path.setup dir
|
data/test/scout/test_persist.rb
CHANGED
@@ -138,8 +138,8 @@ class TestPersist < Test::Unit::TestCase
|
|
138
138
|
Open.write(output2, io)
|
139
139
|
end
|
140
140
|
end
|
141
|
-
Process.
|
142
|
-
Process.
|
141
|
+
Process.waitpid pid1
|
142
|
+
Process.waitpid pid2
|
143
143
|
|
144
144
|
assert File.exist?(output1) || File.exist?(output2)
|
145
145
|
[pid1, pid2].zip([output2, output1]).each do |pid, found|
|
@@ -95,6 +95,27 @@ k a|A b|B
|
|
95
95
|
assert_equal 'a', tsv['k'][0][0]
|
96
96
|
end
|
97
97
|
|
98
|
+
def test_parse_head
|
99
|
+
content =<<-EOF
|
100
|
+
#: :sep=" "#:type=:double
|
101
|
+
#Key ValueA ValueB
|
102
|
+
k a|A b|B
|
103
|
+
k1 a|A b|B
|
104
|
+
k2 a|A b|B
|
105
|
+
k3 a|A b|B
|
106
|
+
k4 a|A b|B
|
107
|
+
EOF
|
108
|
+
content = StringIO.new content
|
109
|
+
|
110
|
+
tsv = TSV.parse(content, :head => 2)
|
111
|
+
assert_equal 2, tsv.keys.length
|
112
|
+
|
113
|
+
content.rewind
|
114
|
+
tsv = TSV.parse(content, :head => 3)
|
115
|
+
assert_equal 3, tsv.keys.length
|
116
|
+
end
|
117
|
+
|
118
|
+
|
98
119
|
def test_parse_fields
|
99
120
|
content =<<-EOF
|
100
121
|
#: :sep=" "#:type=:double
|
@@ -3,7 +3,7 @@ require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1
|
|
3
3
|
|
4
4
|
require 'scout/workflow'
|
5
5
|
class TestStepProvenance < Test::Unit::TestCase
|
6
|
-
def
|
6
|
+
def test_prov_report
|
7
7
|
tmpfile = tmpdir.test_step
|
8
8
|
step1 = Step.new tmpfile.step1, ["12"] do |s|
|
9
9
|
s.length
|
@@ -21,5 +21,28 @@ class TestStepProvenance < Test::Unit::TestCase
|
|
21
21
|
assert_include Step.prov_report(step2), 'step1'
|
22
22
|
assert_include Step.prov_report(step2), 'step2'
|
23
23
|
end
|
24
|
+
|
25
|
+
def __test_input_dependencies
|
26
|
+
wf = Workflow.annonymous_workflow "TaskInputDepProv" do
|
27
|
+
input :value1, :integer
|
28
|
+
task :number1 => :integer do |i| i end
|
29
|
+
|
30
|
+
input :value2, :integer
|
31
|
+
task :number2 => :integer do |i| i end
|
32
|
+
|
33
|
+
input :number1, :integer
|
34
|
+
input :number2, :integer
|
35
|
+
task :sum => :integer do |i1,i2| i1 + i2 end
|
36
|
+
|
37
|
+
dep :number1, :value1 => 1
|
38
|
+
dep :number2, :value1 => 2
|
39
|
+
dep_task :my_sum, self, :sum, :number1 => :number1, :number2 => :number2
|
40
|
+
|
41
|
+
end
|
42
|
+
job = wf.job(:my_sum)
|
43
|
+
|
44
|
+
ppp Step.prov_report(job)
|
45
|
+
|
46
|
+
end
|
24
47
|
end
|
25
48
|
|
@@ -20,6 +20,8 @@ class TestTaskDependencies < Test::Unit::TestCase
|
|
20
20
|
|
21
21
|
assert_equal 18, wf.job(:step2, :input1 => 2, "TaskInputs#step1" => step1_job).exec
|
22
22
|
|
23
|
+
assert_equal [step1_job.path], wf.job(:step2, :input1 => 2, "TaskInputs#step1" => step1_job).overriden_deps.collect{|d| d.path }
|
24
|
+
|
23
25
|
assert_equal 18, wf.job(:step2, "TaskInputs#step1" => step1_job).exec
|
24
26
|
end
|
25
27
|
|
@@ -111,7 +111,6 @@ class TestTaskInput < Test::Unit::TestCase
|
|
111
111
|
def test_save_and_load
|
112
112
|
task = self.example_task
|
113
113
|
|
114
|
-
sss 0
|
115
114
|
TmpFile.with_file("2\n3") do |integer_array_file|
|
116
115
|
inputs = {:string => "String", :integer => 2, :integer_array => integer_array_file, :float_array => %w(1.1 2.2)}
|
117
116
|
original_digest = task.process_inputs(inputs).last
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
|
2
2
|
require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')
|
3
3
|
|
4
|
-
class
|
4
|
+
class TestWorkflowDefinition < Test::Unit::TestCase
|
5
5
|
def test_function_task
|
6
6
|
wf = Workflow.annonymous_workflow do
|
7
7
|
self.name = "StringLength"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scout-gear
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 9.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: term-ansicolor
|
@@ -203,6 +203,7 @@ files:
|
|
203
203
|
- lib/scout/persist/path.rb
|
204
204
|
- lib/scout/persist/serialize.rb
|
205
205
|
- lib/scout/resource.rb
|
206
|
+
- lib/scout/resource/open.rb
|
206
207
|
- lib/scout/resource/path.rb
|
207
208
|
- lib/scout/resource/produce.rb
|
208
209
|
- lib/scout/resource/produce/rake.rb
|
@@ -252,6 +253,7 @@ files:
|
|
252
253
|
- lib/scout/workflow/step/dependencies.rb
|
253
254
|
- lib/scout/workflow/step/file.rb
|
254
255
|
- lib/scout/workflow/step/info.rb
|
256
|
+
- lib/scout/workflow/step/inputs.rb
|
255
257
|
- lib/scout/workflow/step/load.rb
|
256
258
|
- lib/scout/workflow/step/progress.rb
|
257
259
|
- lib/scout/workflow/step/provenance.rb
|
@@ -269,6 +271,8 @@ files:
|
|
269
271
|
- scout_commands/glob
|
270
272
|
- scout_commands/offsite
|
271
273
|
- scout_commands/rbbt
|
274
|
+
- scout_commands/resource/produce
|
275
|
+
- scout_commands/template
|
272
276
|
- scout_commands/update
|
273
277
|
- scout_commands/workflow/info
|
274
278
|
- scout_commands/workflow/install
|
@@ -277,6 +281,8 @@ files:
|
|
277
281
|
- share/color/color_names
|
278
282
|
- share/color/diverging_colors.hex
|
279
283
|
- share/software/install_helpers
|
284
|
+
- share/templates/command
|
285
|
+
- share/templates/workflow.rb
|
280
286
|
- test/scout/indiferent_hash/test_case_insensitive.rb
|
281
287
|
- test/scout/indiferent_hash/test_options.rb
|
282
288
|
- test/scout/log/test_color.rb
|