rbbt-util 5.25.56 → 5.26.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/workflow/prepare.rb +23 -0
- data/share/rbbt_commands/workflow/task +11 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e46da3a8f9a6af1484317f1b072ec5b7ce9b896
|
4
|
+
data.tar.gz: b62b161eb2202bde09d7368d104621c968b4fdff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4acc4980955ab32ebc68ce730d27cd03c58ea84a7e7b5764e744f0b197b756317e442692ed00d83ec84f698064be5447a46964f7611e46774ca846fb529ce88c
|
7
|
+
data.tar.gz: e5c8196ba18b2aedd92f48b2cdb41a59bd6b44f38bb8caa4943e7bc7bc4d2c43a772dbb88251947a6e54c24e5f7f3d6774d35f84246d421e43410c65e8c87348
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class Step
|
2
|
+
def self.prepare_dependencies(jobs, tasks, cpus)
|
3
|
+
deps = []
|
4
|
+
|
5
|
+
jobs = [jobs] unless Array === jobs
|
6
|
+
tasks = [tasks] unless Array === tasks
|
7
|
+
tasks = tasks.collect{|t| t.to_s}
|
8
|
+
|
9
|
+
jobs.each do |job|
|
10
|
+
job.rec_dependencies.each do |dep|
|
11
|
+
next if dep.done?
|
12
|
+
deps << dep if tasks.include?(dep.task_name.to_s) or tasks.include?([dep.workflow.to_s, dep.task_name] * "#")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
cpus = jobs.length if cpus.to_s == "max"
|
17
|
+
cpus = cpus.to_i if String === cpus
|
18
|
+
TSV.traverse deps.collect{|dep| dep.path}, :type => :array, :cpus => cpus, :bar => "Prepare dependencies #{Misc.fingerprint tasks} for #{Misc.fingerprint job}" do |path|
|
19
|
+
dep = deps.select{|dep| dep.path == path}.first
|
20
|
+
dep.produce
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -190,6 +190,8 @@ the job dependencies recursively.
|
|
190
190
|
-prov--provenance Report the jobs provenance
|
191
191
|
-W--workflows* Load a list of workflows
|
192
192
|
-R--requires* Require a list of files
|
193
|
+
-pre--prepare* Prepare dependencies
|
194
|
+
-prec--prepare_cpus* Number of dependencies prepared in parallel
|
193
195
|
-rwt--remote_workflow_tasks* Load a yaml file describing remote workflow tasks
|
194
196
|
-od--override_deps* Override deps using 'Workflow#task=<path>' array_separated
|
195
197
|
EOF
|
@@ -370,6 +372,15 @@ begin
|
|
370
372
|
exit 0
|
371
373
|
end
|
372
374
|
|
375
|
+
if tasks = options.delete(:prepare)
|
376
|
+
require 'rbbt/workflow/prepare'
|
377
|
+
tasks = tasks.split(",")
|
378
|
+
prepare_cpus = (options[:prepare_cpus] || 1)
|
379
|
+
puts Step.prepare_dependencies(job, tasks, prepare_cpus)
|
380
|
+
exit 0
|
381
|
+
end
|
382
|
+
|
383
|
+
|
373
384
|
if do_fork
|
374
385
|
ENV["RBBT_NO_PROGRESS"] = "true"
|
375
386
|
if detach
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbbt-util
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.26.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
@@ -323,6 +323,7 @@ files:
|
|
323
323
|
- lib/rbbt/workflow/definition.rb
|
324
324
|
- lib/rbbt/workflow/doc.rb
|
325
325
|
- lib/rbbt/workflow/examples.rb
|
326
|
+
- lib/rbbt/workflow/prepare.rb
|
326
327
|
- lib/rbbt/workflow/provenance.rb
|
327
328
|
- lib/rbbt/workflow/soap.rb
|
328
329
|
- lib/rbbt/workflow/step.rb
|