scout-gear 10.8.4 → 10.10.1
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 +38 -0
- data/README.md +352 -0
- data/VERSION +1 -1
- data/bin/scout +4 -1
- data/doc/Association.md +288 -0
- data/doc/Entity.md +296 -0
- data/doc/KnowledgeBase.md +433 -0
- data/doc/Persist.md +356 -0
- data/doc/Semaphore.md +171 -0
- data/doc/TSV.md +449 -0
- data/doc/WorkQueue.md +359 -0
- data/doc/Workflow.md +586 -0
- data/lib/scout/association.rb +4 -2
- data/lib/scout/entity/identifiers.rb +1 -1
- data/lib/scout/entity/object.rb +1 -1
- data/lib/scout/entity/property.rb +5 -5
- data/lib/scout/entity.rb +1 -1
- data/lib/scout/knowledge_base/description.rb +1 -1
- data/lib/scout/knowledge_base/list.rb +7 -2
- data/lib/scout/knowledge_base/registry.rb +4 -5
- data/lib/scout/knowledge_base.rb +20 -2
- data/lib/scout/monitor.rb +10 -6
- data/lib/scout/persist/engine/packed_index.rb +2 -2
- data/lib/scout/persist/engine/sharder.rb +1 -1
- data/lib/scout/persist/tsv.rb +1 -0
- data/lib/scout/semaphore.rb +1 -1
- data/lib/scout/tsv/dumper.rb +3 -3
- data/lib/scout/tsv/open.rb +1 -0
- data/lib/scout/tsv/parser.rb +1 -1
- data/lib/scout/tsv/transformer.rb +1 -0
- data/lib/scout/tsv/util.rb +2 -2
- data/lib/scout/work_queue/socket.rb +1 -1
- data/lib/scout/work_queue/worker.rb +7 -5
- data/lib/scout/workflow/definition.rb +11 -0
- data/lib/scout/workflow/deployment/local.rb +288 -0
- data/lib/scout/workflow/deployment/orchestrator/batches.rb +130 -0
- data/lib/scout/workflow/deployment/orchestrator/chains.rb +104 -0
- data/lib/scout/workflow/deployment/orchestrator/rules.rb +256 -0
- data/lib/scout/workflow/deployment/orchestrator/workload.rb +67 -0
- data/lib/scout/workflow/deployment/scheduler/job.rb +740 -0
- data/lib/scout/workflow/deployment/scheduler/lfs.rb +125 -0
- data/lib/scout/workflow/deployment/scheduler/pbs.rb +176 -0
- data/lib/scout/workflow/deployment/scheduler/slurm.rb +158 -0
- data/lib/scout/workflow/deployment/scheduler.rb +73 -0
- data/lib/scout/workflow/deployment.rb +10 -1
- data/lib/scout/workflow/entity.rb +22 -1
- data/lib/scout/workflow/exceptions.rb +2 -0
- data/lib/scout/workflow/step/config.rb +6 -3
- data/lib/scout/workflow/step/file.rb +4 -0
- data/lib/scout/workflow/step/info.rb +10 -4
- data/lib/scout/workflow/step/progress.rb +52 -0
- data/lib/scout/workflow/step.rb +39 -5
- data/lib/scout/workflow/task/inputs.rb +1 -1
- data/lib/scout/workflow/task.rb +2 -0
- data/lib/scout/workflow/usage.rb +3 -2
- data/lib/scout/workflow/util.rb +22 -0
- data/scout-gear.gemspec +37 -7
- data/scout_commands/batch/list +1 -1
- data/scout_commands/cat +86 -0
- data/scout_commands/doc +3 -1
- data/scout_commands/entity +151 -0
- data/scout_commands/system/status +238 -0
- data/scout_commands/workflow/cmd +5 -13
- data/scout_commands/workflow/info +23 -10
- data/scout_commands/workflow/install +1 -1
- data/scout_commands/workflow/task +61 -25
- data/test/scout/entity/test_property.rb +1 -1
- data/test/scout/knowledge_base/test_registry.rb +19 -0
- data/test/scout/test_work_queue.rb +1 -1
- data/test/scout/work_queue/test_worker.rb +12 -10
- data/test/scout/workflow/deployment/orchestrator/test_batches.rb +138 -0
- data/test/scout/workflow/deployment/orchestrator/test_chains.rb +171 -0
- data/test/scout/workflow/deployment/orchestrator/test_rules.rb +219 -0
- data/test/scout/workflow/deployment/orchestrator/test_workload.rb +117 -0
- data/test/scout/workflow/deployment/scheduler/test_job.rb +31 -0
- data/test/scout/workflow/deployment/scheduler/test_lfs.rb +32 -0
- data/test/scout/workflow/deployment/scheduler/test_pbs.rb +32 -0
- data/test/scout/workflow/deployment/scheduler/test_slurm.rb +32 -0
- data/test/scout/workflow/deployment/{test_orchestrator.rb → test_local.rb} +161 -33
- data/test/scout/workflow/deployment/test_scheduler.rb +75 -0
- data/test/scout/workflow/deployment/test_trace.rb +1 -1
- data/test/scout/workflow/step/test_progress.rb +27 -0
- data/test/scout/workflow/task/test_inputs.rb +17 -0
- data/test/test_helper.rb +2 -1
- metadata +36 -6
- data/doc/lib/scout/path.md +0 -35
- data/doc/lib/scout/workflow/task.md +0 -13
- data/lib/scout/workflow/deployment/orchestrator.rb +0 -292
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
|
|
2
|
+
require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')
|
|
3
|
+
|
|
4
|
+
# Define a small workflow used by tests
|
|
5
|
+
module TestSchedWF
|
|
6
|
+
extend Workflow
|
|
7
|
+
|
|
8
|
+
task :a1 => :string do self.task_name.to_s end
|
|
9
|
+
|
|
10
|
+
dep :a1
|
|
11
|
+
task :b1 => :string do self.task_name.to_s end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
class TestSchedulerJobPBS < Test::Unit::TestCase
|
|
15
|
+
def test_basic_template
|
|
16
|
+
job = TestSchedWF.job(:b1, "TEST")
|
|
17
|
+
TmpFile.with_file do |batch_dir|
|
|
18
|
+
tpl = PBS.job_template(job, :batch_dir => batch_dir, :lua_modules => 'java')
|
|
19
|
+
assert_include tpl, 'module load java'
|
|
20
|
+
assert_include tpl, '#STEP_PATH'
|
|
21
|
+
assert_include tpl, '#PBS'
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def test_singularity
|
|
26
|
+
job = TestSchedWF.job(:b1, "TEST")
|
|
27
|
+
TmpFile.with_file do |batch_dir|
|
|
28
|
+
tpl = PBS.job_template(job, :batch_dir => batch_dir, :singularity => true, :singularity_img => '/tmp/img.sif')
|
|
29
|
+
assert_include tpl, 'singularity exec'
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
|
|
2
|
+
require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')
|
|
3
|
+
|
|
4
|
+
# Define a small workflow used by tests
|
|
5
|
+
module TestSchedWF
|
|
6
|
+
extend Workflow
|
|
7
|
+
|
|
8
|
+
task :a1 => :string do self.task_name.to_s end
|
|
9
|
+
|
|
10
|
+
dep :a1
|
|
11
|
+
task :b1 => :string do self.task_name.to_s end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
class TestSchedulerJobSLURM < Test::Unit::TestCase
|
|
15
|
+
def test_basic_template
|
|
16
|
+
job = TestSchedWF.job(:b1, "TEST")
|
|
17
|
+
TmpFile.with_file do |batch_dir|
|
|
18
|
+
tpl = SLURM.job_template(job, :batch_dir => batch_dir, :lua_modules => 'java')
|
|
19
|
+
assert_include tpl, 'module load java'
|
|
20
|
+
assert_include tpl, '#STEP_PATH'
|
|
21
|
+
assert_include tpl, '#SBATCH'
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def test_singularity
|
|
26
|
+
job = TestSchedWF.job(:b1, "TEST")
|
|
27
|
+
TmpFile.with_file do |batch_dir|
|
|
28
|
+
tpl = SLURM.job_template(job, :batch_dir => batch_dir, :singularity => true, :singularity_img => '/tmp/img.sif')
|
|
29
|
+
assert_include tpl, 'singularity exec'
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -1,38 +1,40 @@
|
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
require 'scout/workflow/deployment/trace'
|
|
5
|
+
module TestWF
|
|
6
|
+
extend Workflow
|
|
7
|
+
self.name = "TestWF"
|
|
8
|
+
|
|
9
|
+
MULT = 0.1
|
|
10
|
+
task :a => :text do
|
|
11
|
+
sleep(TestWF::MULT * (rand(10) + 2))
|
|
12
|
+
end
|
|
9
13
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
dep :a
|
|
15
|
+
task :b => :text do
|
|
16
|
+
sleep(TestWF::MULT * (rand(10) + 2))
|
|
17
|
+
end
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
dep :a
|
|
20
|
+
dep :b
|
|
21
|
+
task :c => :text do
|
|
22
|
+
sleep(TestWF::MULT * (rand(10) + 2))
|
|
23
|
+
end
|
|
19
24
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
end
|
|
25
|
+
dep :c
|
|
26
|
+
task :d => :text do
|
|
27
|
+
sleep(TestWF::MULT * (rand(10) + 2))
|
|
28
|
+
end
|
|
25
29
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
dep :c
|
|
31
|
+
task :e => :text do
|
|
32
|
+
sleep(TestWF::MULT * (rand(10) + 2))
|
|
33
|
+
end
|
|
34
|
+
end
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
sleep(TestWF::MULT * (rand(10) + 2))
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
+
class TestLocalExec < Test::Unit::TestCase
|
|
37
|
+
setup do
|
|
36
38
|
end
|
|
37
39
|
|
|
38
40
|
def test_orchestrate_resources
|
|
@@ -65,7 +67,7 @@ TestWF:
|
|
|
65
67
|
cpus: 15
|
|
66
68
|
EOF
|
|
67
69
|
|
|
68
|
-
orchestrator = Workflow::
|
|
70
|
+
orchestrator = Workflow::LocalExecutor.new(0.01, "cpus" => 30, "IO" => 10, "size" => 10 )
|
|
69
71
|
orchestrator.process(rules, jobs)
|
|
70
72
|
|
|
71
73
|
data = Workflow.trace jobs, :plot_data => true
|
|
@@ -89,7 +91,50 @@ TestWF:
|
|
|
89
91
|
|
|
90
92
|
jobs =[]
|
|
91
93
|
|
|
92
|
-
num =
|
|
94
|
+
num = 1
|
|
95
|
+
num.times do |i|
|
|
96
|
+
jobs.concat %w(TEST1 TEST2).collect{|name| TestWF.job(:d, name + " #{i}") }
|
|
97
|
+
end
|
|
98
|
+
jobs.each do |j| j.recursive_clean end
|
|
99
|
+
|
|
100
|
+
rules = YAML.load <<-EOF
|
|
101
|
+
defaults:
|
|
102
|
+
log: 4
|
|
103
|
+
default_resources:
|
|
104
|
+
IO: 1
|
|
105
|
+
TestWF:
|
|
106
|
+
a:
|
|
107
|
+
erase: true
|
|
108
|
+
resources:
|
|
109
|
+
cpus: 7
|
|
110
|
+
b:
|
|
111
|
+
erase: true
|
|
112
|
+
resources:
|
|
113
|
+
cpus: 2
|
|
114
|
+
c:
|
|
115
|
+
resources:
|
|
116
|
+
cpus: 10
|
|
117
|
+
d:
|
|
118
|
+
resources:
|
|
119
|
+
cpus: 15
|
|
120
|
+
EOF
|
|
121
|
+
|
|
122
|
+
orchestrator = Workflow::LocalExecutor.new(TestWF::MULT, "cpus" => 30, "IO" => 4, "size" => 10 )
|
|
123
|
+
orchestrator.process(rules, jobs)
|
|
124
|
+
|
|
125
|
+
jobs.each do |job|
|
|
126
|
+
assert job.step(:c).dependencies.empty?
|
|
127
|
+
assert job.step(:c).info[:archived_info].keys.select{|k| k.include?("TestWF/a/")}.any?
|
|
128
|
+
assert job.step(:c).info[:archived_info].keys.select{|k| k.include?("TestWF/b/")}.any?
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def test_orchestrate_erase_long
|
|
134
|
+
|
|
135
|
+
jobs =[]
|
|
136
|
+
|
|
137
|
+
num = 3
|
|
93
138
|
num.times do |i|
|
|
94
139
|
jobs.concat %w(TEST1 TEST2).collect{|name| TestWF.job(:d, name + " #{i}") }
|
|
95
140
|
end
|
|
@@ -117,7 +162,7 @@ TestWF:
|
|
|
117
162
|
cpus: 15
|
|
118
163
|
EOF
|
|
119
164
|
|
|
120
|
-
orchestrator = Workflow::
|
|
165
|
+
orchestrator = Workflow::LocalExecutor.new(TestWF::MULT, "cpus" => 30, "IO" => 4, "size" => 10 )
|
|
121
166
|
orchestrator.process(rules, jobs)
|
|
122
167
|
|
|
123
168
|
jobs.each do |job|
|
|
@@ -162,7 +207,7 @@ TestWF:
|
|
|
162
207
|
cpus: 15
|
|
163
208
|
EOF
|
|
164
209
|
|
|
165
|
-
orchestrator = Workflow::
|
|
210
|
+
orchestrator = Workflow::LocalExecutor.new(TestWF::MULT, "cpus" => 30, "IO" => 4, "size" => 10 )
|
|
166
211
|
orchestrator.process(rules, jobs)
|
|
167
212
|
|
|
168
213
|
jobs.each do |job|
|
|
@@ -205,7 +250,7 @@ TestWF:
|
|
|
205
250
|
cpus: 15
|
|
206
251
|
EOF
|
|
207
252
|
|
|
208
|
-
orchestrator = Workflow::
|
|
253
|
+
orchestrator = Workflow::LocalExecutor.new(TestWF::MULT, "cpus" => 30, "IO" => 4, "size" => 10 )
|
|
209
254
|
orchestrator.process(rules, jobs)
|
|
210
255
|
|
|
211
256
|
jobs.each do |job|
|
|
@@ -249,7 +294,7 @@ TestWF:
|
|
|
249
294
|
cpus: 15
|
|
250
295
|
EOF
|
|
251
296
|
|
|
252
|
-
orchestrator = Workflow::
|
|
297
|
+
orchestrator = Workflow::LocalExecutor.new(TestWF::MULT, "cpus" => 30, "IO" => 4, "size" => 10 )
|
|
253
298
|
orchestrator.process(rules, jobs)
|
|
254
299
|
|
|
255
300
|
jobs.each do |job|
|
|
@@ -259,5 +304,88 @@ TestWF:
|
|
|
259
304
|
end
|
|
260
305
|
|
|
261
306
|
end
|
|
307
|
+
|
|
308
|
+
def test_orchestrate_produce
|
|
309
|
+
|
|
310
|
+
jobs =[]
|
|
311
|
+
|
|
312
|
+
num = 1
|
|
313
|
+
num.times do |i|
|
|
314
|
+
jobs.concat %w(TEST1 TEST2).collect{|name| TestWF.job(:d, name + " #{i}") }
|
|
315
|
+
jobs.concat %w(TEST1 TEST2).collect{|name| TestWF.job(:c, name + " #{i}") }
|
|
316
|
+
end
|
|
317
|
+
jobs.each do |j| j.recursive_clean end
|
|
318
|
+
|
|
319
|
+
rules = YAML.load <<-EOF
|
|
320
|
+
defaults:
|
|
321
|
+
erase: true
|
|
322
|
+
log: 4
|
|
323
|
+
default_resources:
|
|
324
|
+
IO: 1
|
|
325
|
+
TestWF:
|
|
326
|
+
a:
|
|
327
|
+
resources:
|
|
328
|
+
cpus: 7
|
|
329
|
+
b:
|
|
330
|
+
resources:
|
|
331
|
+
cpus: 2
|
|
332
|
+
c:
|
|
333
|
+
resources:
|
|
334
|
+
cpus: 10
|
|
335
|
+
d:
|
|
336
|
+
resources:
|
|
337
|
+
cpus: 15
|
|
338
|
+
EOF
|
|
339
|
+
|
|
340
|
+
Workflow::LocalExecutor.produce(jobs, rules, produce_timer: 0.1, produce_cpus: 20)
|
|
341
|
+
|
|
342
|
+
jobs.each do |job|
|
|
343
|
+
next unless job.task_name.to_s == 'd'
|
|
344
|
+
assert job.step(:c).dependencies.empty?
|
|
345
|
+
assert job.step(:c).info[:archived_info].keys.select{|k| k.include?("TestWF/a/")}.any?
|
|
346
|
+
assert job.step(:c).info[:archived_info].keys.select{|k| k.include?("TestWF/b/")}.any?
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
def test_orchestrate_produce_deps
|
|
352
|
+
|
|
353
|
+
jobs =[]
|
|
354
|
+
|
|
355
|
+
num = 1
|
|
356
|
+
num.times do |i|
|
|
357
|
+
jobs.concat %w(TEST1 TEST2).collect{|name| TestWF.job(:d, name + " #{i}") }
|
|
358
|
+
jobs.concat %w(TEST1 TEST2).collect{|name| TestWF.job(:c, name + " #{i}") }
|
|
359
|
+
end
|
|
360
|
+
jobs.each do |j| j.recursive_clean end
|
|
361
|
+
|
|
362
|
+
rules = YAML.load <<-EOF
|
|
363
|
+
defaults:
|
|
364
|
+
erase: true
|
|
365
|
+
log: 4
|
|
366
|
+
default_resources:
|
|
367
|
+
IO: 1
|
|
368
|
+
TestWF:
|
|
369
|
+
a:
|
|
370
|
+
resources:
|
|
371
|
+
cpus: 7
|
|
372
|
+
b:
|
|
373
|
+
resources:
|
|
374
|
+
cpus: 2
|
|
375
|
+
c:
|
|
376
|
+
resources:
|
|
377
|
+
cpus: 10
|
|
378
|
+
d:
|
|
379
|
+
resources:
|
|
380
|
+
cpus: 15
|
|
381
|
+
EOF
|
|
382
|
+
|
|
383
|
+
Workflow::LocalExecutor.produce_dependencies(jobs, [:a, :b], rules, produce_timer: 0.1)
|
|
384
|
+
|
|
385
|
+
jobs.each do |job|
|
|
386
|
+
assert job.step(:a).done?
|
|
387
|
+
refute job.done?
|
|
388
|
+
end
|
|
389
|
+
end
|
|
262
390
|
end
|
|
263
391
|
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
|
|
2
|
+
require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')
|
|
3
|
+
|
|
4
|
+
require 'scout/workflow/deployment/scheduler/slurm'
|
|
5
|
+
|
|
6
|
+
class TestScheduler < Test::Unit::TestCase
|
|
7
|
+
setup do
|
|
8
|
+
module TestWF
|
|
9
|
+
extend Workflow
|
|
10
|
+
self.name = "TestWF"
|
|
11
|
+
|
|
12
|
+
MULT ||= 0.1
|
|
13
|
+
task :a => :text do
|
|
14
|
+
sleep(TestWF::MULT * (rand(10) + 2))
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
dep :a
|
|
18
|
+
task :b => :text do
|
|
19
|
+
sleep(TestWF::MULT * (rand(10) + 2))
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
dep :a
|
|
23
|
+
dep :b
|
|
24
|
+
task :c => :text do
|
|
25
|
+
sleep(TestWF::MULT * (rand(10) + 2))
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
dep :c
|
|
29
|
+
task :d => :text do
|
|
30
|
+
sleep(TestWF::MULT * (rand(10) + 2))
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
dep :c
|
|
34
|
+
task :e => :text do
|
|
35
|
+
sleep(TestWF::MULT * (rand(10) + 2))
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def test_orchestrate_process
|
|
41
|
+
|
|
42
|
+
jobs =[]
|
|
43
|
+
|
|
44
|
+
num = 1
|
|
45
|
+
num.times do |i|
|
|
46
|
+
jobs.concat %w(TEST1 TEST2).collect{|name| TestWF.job(:d, name + " #{i}") }
|
|
47
|
+
end
|
|
48
|
+
jobs.each do |j| j.recursive_clean end
|
|
49
|
+
|
|
50
|
+
rules = YAML.load <<-EOF
|
|
51
|
+
defaults:
|
|
52
|
+
log: 4
|
|
53
|
+
default_resources:
|
|
54
|
+
IO: 1
|
|
55
|
+
TestWF:
|
|
56
|
+
a:
|
|
57
|
+
resources:
|
|
58
|
+
cpus: 7
|
|
59
|
+
b:
|
|
60
|
+
resources:
|
|
61
|
+
cpus: 2
|
|
62
|
+
c:
|
|
63
|
+
resources:
|
|
64
|
+
cpus: 10
|
|
65
|
+
d:
|
|
66
|
+
resources:
|
|
67
|
+
cpus: 15
|
|
68
|
+
EOF
|
|
69
|
+
|
|
70
|
+
batches = Workflow::Orchestrator.job_batches(rules, jobs)
|
|
71
|
+
dirs = Workflow::Scheduler.process_batches(batches, dry_run: true)
|
|
72
|
+
iii dirs
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
|
|
2
|
+
require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')
|
|
3
|
+
|
|
4
|
+
class TestStepProgress < Test::Unit::TestCase
|
|
5
|
+
def test_monitor_stream
|
|
6
|
+
|
|
7
|
+
TmpFile.with_file do |tmpfile|
|
|
8
|
+
items = %w(foo bar baz)
|
|
9
|
+
lines = []
|
|
10
|
+
step = Step.new tmpfile, ["12"] do |s|
|
|
11
|
+
file = file('test')
|
|
12
|
+
Open.write file, items * "\n"
|
|
13
|
+
s = file.open
|
|
14
|
+
self.monitor_stream s, bar: 3 do |line|
|
|
15
|
+
lines << line.strip
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
step.type = :text
|
|
19
|
+
|
|
20
|
+
res = step.run(:stream)
|
|
21
|
+
res.read
|
|
22
|
+
res.join
|
|
23
|
+
assert_equal items, lines
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
@@ -18,6 +18,7 @@ class TestTaskInput < Test::Unit::TestCase
|
|
|
18
18
|
input :boolean_array, :boolean_array, "", [true, false, true]
|
|
19
19
|
input :path_array, :path_array, "", %w(dir/subdir/file1 dir/subdir/file2)
|
|
20
20
|
input :file_array, :file_array
|
|
21
|
+
input :select, :select, '', :foo, select_options: %(foo bar)
|
|
21
22
|
task :task => :array do
|
|
22
23
|
inputs
|
|
23
24
|
end
|
|
@@ -124,6 +125,22 @@ class TestTaskInput < Test::Unit::TestCase
|
|
|
124
125
|
end
|
|
125
126
|
end
|
|
126
127
|
|
|
128
|
+
def test_save_and_load_select
|
|
129
|
+
task = self.example_task
|
|
130
|
+
|
|
131
|
+
TmpFile.with_file("2\n3") do |integer_array_file|
|
|
132
|
+
inputs = {:select => 'bar'}
|
|
133
|
+
original_digest = task.process_inputs(inputs).last
|
|
134
|
+
|
|
135
|
+
TmpFile.with_path do |save_directory|
|
|
136
|
+
task.save_inputs(save_directory, inputs)
|
|
137
|
+
new_inputs = task.load_inputs(save_directory)
|
|
138
|
+
new_digest = task.process_inputs(new_inputs).last
|
|
139
|
+
assert_equal original_digest, new_digest
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
127
144
|
def test_save_and_load_file
|
|
128
145
|
task = self.example_task
|
|
129
146
|
|
data/test/test_helper.rb
CHANGED
|
@@ -51,11 +51,12 @@ class Test::Unit::TestCase
|
|
|
51
51
|
Workflow.directory = tmpdir.var.jobs
|
|
52
52
|
Workflow.workflows.each{|wf| wf.directory = Workflow.directory[wf.name] }
|
|
53
53
|
Entity.entity_property_cache = tmpdir.entity_properties if defined?(Entity)
|
|
54
|
+
Workflow.job_cache.clear
|
|
55
|
+
SchedulerJob.batch_base_dir = tmpdir.batch
|
|
54
56
|
end
|
|
55
57
|
|
|
56
58
|
teardown do
|
|
57
59
|
Open.rm_rf tmpdir
|
|
58
|
-
Workflow.job_cache.clear
|
|
59
60
|
end
|
|
60
61
|
|
|
61
62
|
def self.datadir_test
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: scout-gear
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 10.
|
|
4
|
+
version: 10.10.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Miguel Vazquez
|
|
@@ -101,18 +101,26 @@ executables:
|
|
|
101
101
|
extensions: []
|
|
102
102
|
extra_rdoc_files:
|
|
103
103
|
- LICENSE.txt
|
|
104
|
+
- README.md
|
|
104
105
|
- README.rdoc
|
|
105
106
|
files:
|
|
106
107
|
- ".document"
|
|
107
108
|
- ".gitmodules"
|
|
108
109
|
- ".vimproject"
|
|
109
110
|
- LICENSE.txt
|
|
111
|
+
- README.md
|
|
110
112
|
- README.rdoc
|
|
111
113
|
- Rakefile
|
|
112
114
|
- VERSION
|
|
113
115
|
- bin/scout
|
|
114
|
-
- doc/
|
|
115
|
-
- doc/
|
|
116
|
+
- doc/Association.md
|
|
117
|
+
- doc/Entity.md
|
|
118
|
+
- doc/KnowledgeBase.md
|
|
119
|
+
- doc/Persist.md
|
|
120
|
+
- doc/Semaphore.md
|
|
121
|
+
- doc/TSV.md
|
|
122
|
+
- doc/WorkQueue.md
|
|
123
|
+
- doc/Workflow.md
|
|
116
124
|
- lib/scout-gear.rb
|
|
117
125
|
- lib/scout.rb
|
|
118
126
|
- lib/scout/association.rb
|
|
@@ -181,8 +189,17 @@ files:
|
|
|
181
189
|
- lib/scout/workflow.rb
|
|
182
190
|
- lib/scout/workflow/definition.rb
|
|
183
191
|
- lib/scout/workflow/deployment.rb
|
|
184
|
-
- lib/scout/workflow/deployment/
|
|
192
|
+
- lib/scout/workflow/deployment/local.rb
|
|
193
|
+
- lib/scout/workflow/deployment/orchestrator/batches.rb
|
|
194
|
+
- lib/scout/workflow/deployment/orchestrator/chains.rb
|
|
195
|
+
- lib/scout/workflow/deployment/orchestrator/rules.rb
|
|
196
|
+
- lib/scout/workflow/deployment/orchestrator/workload.rb
|
|
185
197
|
- lib/scout/workflow/deployment/queue.rb
|
|
198
|
+
- lib/scout/workflow/deployment/scheduler.rb
|
|
199
|
+
- lib/scout/workflow/deployment/scheduler/job.rb
|
|
200
|
+
- lib/scout/workflow/deployment/scheduler/lfs.rb
|
|
201
|
+
- lib/scout/workflow/deployment/scheduler/pbs.rb
|
|
202
|
+
- lib/scout/workflow/deployment/scheduler/slurm.rb
|
|
186
203
|
- lib/scout/workflow/deployment/trace.rb
|
|
187
204
|
- lib/scout/workflow/documentation.rb
|
|
188
205
|
- lib/scout/workflow/entity.rb
|
|
@@ -213,7 +230,9 @@ files:
|
|
|
213
230
|
- scout_commands/alias
|
|
214
231
|
- scout_commands/batch/clean
|
|
215
232
|
- scout_commands/batch/list
|
|
233
|
+
- scout_commands/cat
|
|
216
234
|
- scout_commands/doc
|
|
235
|
+
- scout_commands/entity
|
|
217
236
|
- scout_commands/find
|
|
218
237
|
- scout_commands/glob
|
|
219
238
|
- scout_commands/kb/config
|
|
@@ -228,6 +247,7 @@ files:
|
|
|
228
247
|
- scout_commands/resource/produce
|
|
229
248
|
- scout_commands/resource/sync
|
|
230
249
|
- scout_commands/system/clean
|
|
250
|
+
- scout_commands/system/status
|
|
231
251
|
- scout_commands/template
|
|
232
252
|
- scout_commands/update
|
|
233
253
|
- scout_commands/workflow/cmd
|
|
@@ -309,13 +329,23 @@ files:
|
|
|
309
329
|
- test/scout/tsv/util/test_unzip.rb
|
|
310
330
|
- test/scout/work_queue/test_socket.rb
|
|
311
331
|
- test/scout/work_queue/test_worker.rb
|
|
312
|
-
- test/scout/workflow/deployment/
|
|
332
|
+
- test/scout/workflow/deployment/orchestrator/test_batches.rb
|
|
333
|
+
- test/scout/workflow/deployment/orchestrator/test_chains.rb
|
|
334
|
+
- test/scout/workflow/deployment/orchestrator/test_rules.rb
|
|
335
|
+
- test/scout/workflow/deployment/orchestrator/test_workload.rb
|
|
336
|
+
- test/scout/workflow/deployment/scheduler/test_job.rb
|
|
337
|
+
- test/scout/workflow/deployment/scheduler/test_lfs.rb
|
|
338
|
+
- test/scout/workflow/deployment/scheduler/test_pbs.rb
|
|
339
|
+
- test/scout/workflow/deployment/scheduler/test_slurm.rb
|
|
340
|
+
- test/scout/workflow/deployment/test_local.rb
|
|
341
|
+
- test/scout/workflow/deployment/test_scheduler.rb
|
|
313
342
|
- test/scout/workflow/deployment/test_trace.rb
|
|
314
343
|
- test/scout/workflow/step/test_archive.rb
|
|
315
344
|
- test/scout/workflow/step/test_children.rb
|
|
316
345
|
- test/scout/workflow/step/test_dependencies.rb
|
|
317
346
|
- test/scout/workflow/step/test_info.rb
|
|
318
347
|
- test/scout/workflow/step/test_load.rb
|
|
348
|
+
- test/scout/workflow/step/test_progress.rb
|
|
319
349
|
- test/scout/workflow/step/test_provenance.rb
|
|
320
350
|
- test/scout/workflow/step/test_status.rb
|
|
321
351
|
- test/scout/workflow/task/test_dependencies.rb
|
|
@@ -350,7 +380,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
350
380
|
- !ruby/object:Gem::Version
|
|
351
381
|
version: '0'
|
|
352
382
|
requirements: []
|
|
353
|
-
rubygems_version: 3.
|
|
383
|
+
rubygems_version: 3.7.0.dev
|
|
354
384
|
specification_version: 4
|
|
355
385
|
summary: basic gear for scouts
|
|
356
386
|
test_files: []
|
data/doc/lib/scout/path.md
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
Path
|
|
2
|
-
===
|
|
3
|
-
|
|
4
|
-
```ruby
|
|
5
|
-
:current => '{PWD}/{TOPLEVEL}/{SUBPATH}',
|
|
6
|
-
:user => '{HOME}/.{PKGDIR}/{TOPLEVEL}/{SUBPATH}',
|
|
7
|
-
:global => '/{TOPLEVEL}/{PKGDIR}/{SUBPATH}',
|
|
8
|
-
:usr => '/usr/{TOPLEVEL}/{PKGDIR}/{SUBPATH}',
|
|
9
|
-
:local => '/usr/local/{TOPLEVEL}/{PKGDIR}/{SUBPATH}',
|
|
10
|
-
:fast => '/fast/{TOPLEVEL}/{PKGDIR}/{SUBPATH}',
|
|
11
|
-
:cache => '/cache/{TOPLEVEL}/{PKGDIR}/{SUBPATH}',
|
|
12
|
-
:bulk => '/bulk/{TOPLEVEL}/{PKGDIR}/{SUBPATH}',
|
|
13
|
-
:lib => '{LIBDIR}/{TOPLEVEL}/{SUBPATH}',
|
|
14
|
-
:scout_gear => File.join(Path.caller_lib_dir(__FILE__), "{TOPLEVEL}/{SUBPATH}"),
|
|
15
|
-
:tmp => '/tmp/{PKGDIR}/{TOPLEVEL}/{SUBPATH}',
|
|
16
|
-
:default => :user
|
|
17
|
-
|
|
18
|
-
@@basic_map_order ||= %w(current workflow user local global lib fast cache bulk)
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
# tags
|
|
25
|
-
{PKGDIR}
|
|
26
|
-
{LIBDIR}
|
|
27
|
-
{RESOURCE}
|
|
28
|
-
{HOME}
|
|
29
|
-
{PWD}
|
|
30
|
-
{TOPLEVEL}
|
|
31
|
-
{SUBPATH}
|
|
32
|
-
{BASENAME}
|
|
33
|
-
{PATH}
|
|
34
|
-
{MAPNAME}
|
|
35
|
-
{REMOVE}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Task
|
|
2
|
-
====
|
|
3
|
-
|
|
4
|
-
```ruby
|
|
5
|
-
wf = Workflow.annonymous_workflow "TaskInputs" do
|
|
6
|
-
input :input1, :integer
|
|
7
|
-
task :step1 => :integer do |i| i end
|
|
8
|
-
|
|
9
|
-
dep :step1
|
|
10
|
-
input :input2, :integer, "Integer", 3
|
|
11
|
-
task :step2 => :integer do |i| i * step(:step1).load end
|
|
12
|
-
end
|
|
13
|
-
```
|