rbbt-util 5.32.17 → 5.32.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/hpc/slurm.rb +1 -0
- data/lib/rbbt/util/config.rb +6 -1
- data/lib/rbbt/util/misc/inspect.rb +3 -1
- data/lib/rbbt/workflow/definition.rb +7 -5
- data/lib/rbbt/workflow/dependencies.rb +3 -2
- data/lib/rbbt/workflow/step.rb +0 -32
- data/lib/rbbt/workflow/step/dependencies.rb +33 -1
- data/lib/rbbt/workflow/util/provenance.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bff9b30f50c873f7db46003571a8557c0ea756aaf342041119d4737da78e461b
|
4
|
+
data.tar.gz: 0765a797be1c16f90cd5ebf4f18fe5adb3d154aa69d07ab666cfe464fcb0a6bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ba97c967d615145553d0f73bd84debbceee41c7ce1ca0c4fda512eeaf54880c256d36a4cf9d215ddce97b43a44a2cf19aa17f7e3b086512633210401cdfc085
|
7
|
+
data.tar.gz: c58f507abee878f56945886b06582271ace368c00808ff6fc7d0f0343373070a40dac797aff440a8abffd8cce3647fec9affeff078150bab8b7f52625754c91b
|
data/lib/rbbt/hpc/slurm.rb
CHANGED
data/lib/rbbt/util/config.rb
CHANGED
@@ -122,7 +122,12 @@ module Rbbt::Config
|
|
122
122
|
Log.debug "Value #{value.inspect} for config key '#{ key }': #{tokens * ", "}"
|
123
123
|
GOT_KEYS << [key, value, tokens]
|
124
124
|
|
125
|
-
value
|
125
|
+
if String === value && m = value.match(/^env:(.*)/)
|
126
|
+
variable = m.captures.first
|
127
|
+
ENV[variable]
|
128
|
+
else
|
129
|
+
value
|
130
|
+
end
|
126
131
|
end
|
127
132
|
|
128
133
|
def self.with_config
|
@@ -320,7 +320,9 @@ module Misc
|
|
320
320
|
end
|
321
321
|
end
|
322
322
|
when String
|
323
|
-
|
323
|
+
good_filename = Misc.is_filename?(obj, false) && ! %w(. ..).include?(obj) && %w(. /).include?(obj[0])
|
324
|
+
is_path = Path === obj
|
325
|
+
if good_filename && ! is_path
|
324
326
|
obj2str Path.setup(obj.dup)
|
325
327
|
else
|
326
328
|
obj = obj.chomp if String === obj
|
@@ -77,15 +77,15 @@ module Workflow
|
|
77
77
|
returns workflow.tasks[oname].result_description if workflow.tasks.include?(oname) unless @result_description
|
78
78
|
task name do
|
79
79
|
raise RbbtException, "dependency not found in dep_task" if dependencies.empty?
|
80
|
-
Step.wait_for_jobs dependencies
|
80
|
+
Step.wait_for_jobs dependencies.select{|d| d.streaming? }
|
81
81
|
dep = dependencies.last
|
82
82
|
dep.join
|
83
83
|
raise dep.get_exception if dep.error?
|
84
84
|
raise Aborted, "Aborted dependency #{dep.path}" if dep.aborted?
|
85
85
|
set_info :result_type, dep.info[:result_type]
|
86
|
-
forget = config :forget_dep_tasks, "forget_dep_tasks",
|
86
|
+
forget = config :forget_dep_tasks, "forget_dep_tasks", :default => FORGET_DEP_TASKS
|
87
87
|
if forget
|
88
|
-
remove = config :remove_dep_tasks, "remove_dep_tasks",
|
88
|
+
remove = config :remove_dep_tasks, "remove_dep_tasks", :default => REMOVE_DEP_TASKS
|
89
89
|
|
90
90
|
self.archive_deps
|
91
91
|
self.copy_files_dir
|
@@ -93,15 +93,17 @@ module Workflow
|
|
93
93
|
Open.rm_rf self.files_dir if Open.exist? self.files_dir
|
94
94
|
FileUtils.cp_r dep.files_dir, self.files_dir if Open.exist?(dep.files_dir)
|
95
95
|
Open.ln_h dep.path, self.tmp_path
|
96
|
+
|
96
97
|
case remove.to_s
|
97
98
|
when 'true'
|
98
99
|
dep.clean
|
99
100
|
when 'recursive'
|
100
|
-
dep.rec_dependencies.each do |d|
|
101
|
+
(dep.dependencies + dep.rec_dependencies).uniq.each do |d|
|
102
|
+
next if d.overriden
|
101
103
|
d.clean unless config(:remove_dep, d.task_signature, d.task_name, d.workflow.to_s, :default => true).to_s == 'false'
|
102
104
|
end
|
103
105
|
dep.clean unless config(:remove_dep, dep.task_signature, dep.task_name, dep.workflow.to_s, :default => true).to_s == 'false'
|
104
|
-
end
|
106
|
+
end unless dep.overriden
|
105
107
|
else
|
106
108
|
if Open.exists?(dep.files_dir)
|
107
109
|
Open.rm_rf self.files_dir
|
@@ -71,7 +71,7 @@ module Workflow
|
|
71
71
|
|
72
72
|
def setup_override_dependency(dep, workflow, task_name)
|
73
73
|
return [] if dep == :skip || dep == 'skip'
|
74
|
-
dep = Step === dep ? dep : Workflow.load_step(dep)
|
74
|
+
dep = Step === dep ? dep.dup : Workflow.load_step(dep)
|
75
75
|
dep.workflow = workflow
|
76
76
|
dep.info[:name] = dep.name
|
77
77
|
dep.original_task_name ||= dep.task_name if dep.workflow
|
@@ -83,8 +83,9 @@ module Workflow
|
|
83
83
|
rescue
|
84
84
|
Log.exception $!
|
85
85
|
end
|
86
|
+
|
86
87
|
dep.task_name = task_name
|
87
|
-
dep.overriden = dep.original_task_name.to_sym
|
88
|
+
dep.overriden = dep.original_task_name.to_sym if dep.original_task_name
|
88
89
|
|
89
90
|
dep.extend step_module
|
90
91
|
|
data/lib/rbbt/workflow/step.rb
CHANGED
@@ -351,38 +351,6 @@ class Step
|
|
351
351
|
end
|
352
352
|
end
|
353
353
|
|
354
|
-
#connected = true means that dependency searching ends when a result is done
|
355
|
-
#but dependencies are absent, meanining that the file could have been dropped
|
356
|
-
#in
|
357
|
-
def rec_dependencies(connected = false, seen = [])
|
358
|
-
|
359
|
-
# A step result with no info_file means that it was manually
|
360
|
-
# placed. In that case, do not consider its dependencies
|
361
|
-
return [] if ! (defined? WorkflowRemoteClient && WorkflowRemoteClient::RemoteStep === self) && ! Open.exists?(self.info_file) && Open.exists?(self.path.to_s)
|
362
|
-
|
363
|
-
return [] if dependencies.nil? or dependencies.empty?
|
364
|
-
|
365
|
-
new_dependencies = []
|
366
|
-
if self.overriden?
|
367
|
-
archived_deps = []
|
368
|
-
else
|
369
|
-
archived_deps = self.info[:archived_info] ? self.info[:archived_info].keys : []
|
370
|
-
end
|
371
|
-
|
372
|
-
dependencies.each{|step|
|
373
|
-
#next if self.done? && Open.exists?(info_file) && info[:dependencies] && info[:dependencies].select{|task,name,path| path == step.path }.empty?
|
374
|
-
next if archived_deps.include? step.path
|
375
|
-
next if seen.include? step.path
|
376
|
-
next if self.done? && connected && ! updatable?
|
377
|
-
|
378
|
-
r = step.rec_dependencies(connected, new_dependencies.collect{|d| d.path})
|
379
|
-
new_dependencies.concat r
|
380
|
-
new_dependencies << step
|
381
|
-
}
|
382
|
-
|
383
|
-
new_dependencies.uniq
|
384
|
-
end
|
385
|
-
|
386
354
|
def writable?
|
387
355
|
Open.writable?(self.path) && Open.writable?(self.info_file)
|
388
356
|
end
|
@@ -206,7 +206,7 @@ class Step
|
|
206
206
|
if dup and step.streaming? and not step.result.nil?
|
207
207
|
if dep_step[step.path] and dep_step[step.path].length > 1
|
208
208
|
stream = step.result
|
209
|
-
other_steps = dep_step[step.path].uniq
|
209
|
+
other_steps = dep_step[step.path].uniq.reject{|d| d.overriden }
|
210
210
|
return unless other_steps.length > 1
|
211
211
|
log_dependency_exec(step, "duplicating #{other_steps.length}")
|
212
212
|
copies = Misc.tee_stream_thread_multiple(stream, other_steps.length)
|
@@ -523,4 +523,36 @@ class Step
|
|
523
523
|
set_info :dependencies, dependencies.collect{|dep| [dep.task_name, dep.name, dep.path]} if dependencies
|
524
524
|
end
|
525
525
|
|
526
|
+
#connected = true means that dependency searching ends when a result is done
|
527
|
+
#but dependencies are absent, meanining that the file could have been dropped
|
528
|
+
#in
|
529
|
+
def rec_dependencies(connected = false, seen = [])
|
530
|
+
|
531
|
+
# A step result with no info_file means that it was manually
|
532
|
+
# placed. In that case, do not consider its dependencies
|
533
|
+
return [] if ! (defined? WorkflowRemoteClient && WorkflowRemoteClient::RemoteStep === self) && ! Open.exists?(self.info_file) && Open.exists?(self.path.to_s)
|
534
|
+
|
535
|
+
return [] if dependencies.nil? or dependencies.empty?
|
536
|
+
|
537
|
+
new_dependencies = []
|
538
|
+
if self.overriden?
|
539
|
+
archived_deps = []
|
540
|
+
else
|
541
|
+
archived_deps = self.info[:archived_info] ? self.info[:archived_info].keys : []
|
542
|
+
end
|
543
|
+
|
544
|
+
dependencies.each{|step|
|
545
|
+
#next if self.done? && Open.exists?(info_file) && info[:dependencies] && info[:dependencies].select{|task,name,path| path == step.path }.empty?
|
546
|
+
next if archived_deps.include? step.path
|
547
|
+
next if seen.include? step.path
|
548
|
+
next if self.done? && connected && ! updatable?
|
549
|
+
|
550
|
+
r = step.rec_dependencies(connected, new_dependencies.collect{|d| d.path})
|
551
|
+
new_dependencies.concat r
|
552
|
+
new_dependencies << step
|
553
|
+
}
|
554
|
+
|
555
|
+
new_dependencies.uniq
|
556
|
+
end
|
557
|
+
|
526
558
|
end
|
@@ -102,7 +102,7 @@ class Step
|
|
102
102
|
dep.input_dependencies.each do |id|
|
103
103
|
input_name = dep.recursive_inputs.fields.zip(dep.recursive_inputs).select{|f,d|
|
104
104
|
d == id || (String === d && d.start_with?(id.files_dir)) || (Array === d && d.include?(id))
|
105
|
-
}.
|
105
|
+
}.last.first
|
106
106
|
input_dependencies[id] ||= []
|
107
107
|
input_dependencies[id] << [dep, input_name]
|
108
108
|
end
|
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.32.
|
4
|
+
version: 5.32.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|