rbbt-util 5.33.1 → 5.33.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70ba4440be0bdca6f80b4aa78393ca4fbec5dbc8d8a1cc72b6393e73127b5340
4
- data.tar.gz: 42021bd242233b5e4e3a268c27291953d84c8bad85b87d8feaf6389685f043bf
3
+ metadata.gz: 1e780efeaa15611ce5835bb314b9ad378719f9f744228a2c9a8a765c202e10e1
4
+ data.tar.gz: 7338f595861b6f93ea0043ffabe9e78762c1acc478669f989ea23dc84820a213
5
5
  SHA512:
6
- metadata.gz: d6a229aa39440cf3b0b42a505e32c699d791d8dd1e1328f42cd6500c947560b0d9343312080af78475a6f4835077e53c029d862e9d4c90addd84408925754b50
7
- data.tar.gz: e31505e92ca6425095a90bdcd8fe95d435c8435bc929dcb1c0c77083a1286439c952d7a98af1091664fcee7a57ba3f86b99258a84958714d630ab4a3678f1ee3
6
+ metadata.gz: 6650b5f00f6e2b8a9ccb3b2d389357ee0b9f551166d185aa2c5ec2c635150e2274c75af35fa6dc66cb09abeaa3c9e445a344015bee616ef78607933337c67e6f
7
+ data.tar.gz: 4847e30f91c1fc388cb83bb842966fdf73cf150d4ed528b89e755d8ae5ed732e6886b7939031664fa0671b386c34e3daaf4ce0873f0991c4711b70bce03ed5c2
@@ -538,10 +538,13 @@ env > #{batch_options[:fenv]}
538
538
  workflow = job.workflow
539
539
  task_name = job.task_name
540
540
 
541
+ workflows_to_load = job.rec_dependencies.select{|d| Step === d}.collect{|d| d.workflow }.compact.collect(&:to_s) - [workflow.to_s]
542
+
541
543
  TmpFile.with_file(nil, remove_batch_dir, :tmpdir => batch_base_dir, :prefix => "#{system}_rbbt_job-#{workflow.to_s}-#{task_name}-") do |batch_dir|
542
544
  Misc.add_defaults options,
543
545
  :batch_dir => batch_dir,
544
- :inputs_dir => File.join(batch_dir, "inputs_dir")
546
+ :inputs_dir => File.join(batch_dir, "inputs_dir"),
547
+ :workflows => workflows_to_load * ","
545
548
 
546
549
  options[:procpath_performance] ||= File.join(batch_dir, "procpath##{procpath.gsub(',', '#')}") if procpath
547
550
 
@@ -11,7 +11,7 @@ module HPC
11
11
  iii :END_BATCHES
12
12
  else
13
13
  n = batch.dup
14
- n[:deps] = n[:deps].collect{|b| b[:top_level] }
14
+ n[:deps] = n[:deps].collect{|b| b[:top_level] } if n[:deps]
15
15
  iif n
16
16
  end
17
17
  end
@@ -79,14 +79,14 @@ module HPC
79
79
 
80
80
  batches.each do |batch|
81
81
  jobs = batch[:jobs]
82
- all_deps = jobs.collect{|d| job_dependencies(d) }.flatten.uniq
82
+ all_deps = jobs.collect{|d| job_dependencies(d) }.flatten.uniq - jobs
83
83
 
84
84
  minimum = all_deps
85
85
  all_deps.each do |dep|
86
86
  minimum -= job_dependencies(dep)
87
87
  end
88
88
 
89
- all_deps = minimum
89
+ all_deps = minimum
90
90
  deps = all_deps.collect do |d|
91
91
  (batches - [batch]).select{|batch| batch[:jobs].collect(&:path).include? d.path }
92
92
  end.flatten.uniq
@@ -14,8 +14,14 @@ module HPC
14
14
  options.delete "detach"
15
15
  options.delete "jobname"
16
16
 
17
- rules = YAML.load(Open.read(options[:orchestration_rules])) if options[:orchestration_rules]
18
- rules ||= {}
17
+ if options[:orchestration_rules]
18
+ rules = YAML.load(Open.read(options[:orchestration_rules]))
19
+ elsif Rbbt.etc.slurm["default.yaml"].exists?
20
+ rules = YAML.load(Open.read(Rbbt.etc.slurm["default.yaml"]))
21
+ else
22
+ rules = {}
23
+ end
24
+
19
25
  IndiferentHash.setup(rules)
20
26
 
21
27
  batches = HPC::Orchestration.job_batches(rules, job)
data/lib/rbbt/resource.rb CHANGED
@@ -270,6 +270,7 @@ source "$INSTALL_HELPER_FILE"
270
270
  git = content[:git]
271
271
  src = content[:src]
272
272
  url = content[:url]
273
+ jar = content[:jar]
273
274
  extra = content[:extra]
274
275
  commands = content[:commands]
275
276
  if git
@@ -290,6 +291,16 @@ url='#{src}'
290
291
 
291
292
  install_src "$name" "$url" #{extra}
292
293
 
294
+ #{commands}
295
+ EOF
296
+ elsif jar
297
+ <<-EOF
298
+
299
+ name='#{name}'
300
+ url='#{jar}'
301
+
302
+ install_jar "$name" "$url" #{extra}
303
+
293
304
  #{commands}
294
305
  EOF
295
306
  else
data/lib/rbbt/util/cmd.rb CHANGED
@@ -75,7 +75,7 @@ module CMD
75
75
 
76
76
  string = ""
77
77
  options.each do |option, value|
78
- raise "Invalid option key: #{option.inspect}" if option.to_s !~ /^[a-z_0-9\-=]+$/i
78
+ raise "Invalid option key: #{option.inspect}" if option.to_s !~ /^[a-z_0-9\-=.]+$/i
79
79
  #raise "Invalid option value: #{value.inspect}" if value.to_s.include? "'"
80
80
  value = value.gsub("'","\\'") if value.to_s.include? "'"
81
81
 
@@ -92,7 +92,12 @@ module Workflow
92
92
  self.dependencies = self.dependencies - [dep]
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
- Open.ln_h dep.path, self.tmp_path
95
+
96
+ if dep.overriden
97
+ Open.link dep.path, self.tmp_path
98
+ else
99
+ Open.ln_h dep.path, self.tmp_path
100
+ end
96
101
 
97
102
  case remove.to_s
98
103
  when 'true'
@@ -4,7 +4,7 @@ module Workflow
4
4
  end
5
5
 
6
6
  def self.nextflow_includes(file)
7
- Open.read(file).scan(/^include\s*{\s*(.*?)(?:\s*as.*?)?}\s*from\s+"(.*?)"(?:\s*params.*)?/).collect{|p| p}.uniq
7
+ Open.read(file).scan(/^include\s*{\s*([^\s]*?)\s+.*?}\s*from\s+["'](.*?)["'](?:\s*params.*)?/).collect{|p| p}.uniq
8
8
  end
9
9
 
10
10
  def self.nextflow_recursive_params(file)
@@ -48,25 +48,43 @@ module Workflow
48
48
  task name => result do
49
49
  work = file('work')
50
50
  profile = config :profile, :nextflow
51
+ config_file = config :config, :nextflow
51
52
 
52
- new_inputs = inputs.zip(inputs.fields).collect do |v,f|
53
- if String === v && m = v.match(/^JOB_FILE:(.*)/)
54
- file(m[1])
55
- elsif v.nil?
56
- Rbbt::Config.get(['nextflow', f] * "_", 'default', f)
53
+ nextflow_inputs = {}
54
+
55
+ inputs.zip(inputs.fields).collect do |v,f|
56
+ v = if String === v && m = v.match(/^JOB_FILE:(.*)/)
57
+ file(m[1])
58
+ elsif v.nil?
59
+ Rbbt::Config.get(['nextflow', f] * "_", 'default', f)
60
+ else
61
+ v
62
+ end
63
+
64
+ if f.to_s.include?("-")
65
+ p,_sep, section = f.to_s.partition("-")
66
+ name = [section, p] * "."
57
67
  else
58
- v
68
+ name = f
59
69
  end
70
+
71
+ nextflow_inputs[name] = v
60
72
  end
61
73
 
62
- inputs.replace new_inputs
63
-
64
74
  Misc.in_dir file('stage') do
65
- if profile
66
- cmd("nextflow run -work-dir #{work} -ansi-log false -profile #{profile} #{file}", inputs.to_hash.merge('add_option_dashes' => true))
67
- else
68
- cmd("nextflow run -work-dir #{work} -ansi-log false #{file}", inputs.to_hash.merge('add_option_dashes' => true))
69
- end
75
+
76
+ cmd = "nextflow "
77
+
78
+ cmd += " -C #{config_file}" if config_file
79
+
80
+ cmd += " run"
81
+
82
+ cmd += " -work-dir #{work} -ansi-log false"
83
+
84
+ cmd += " -profile #{profile}" if profile
85
+
86
+
87
+ cmd("#{cmd} #{file}", nextflow_inputs.merge('add_option_dashes' => true))
70
88
  end
71
89
 
72
90
  output_file = file(output).glob.first if output
@@ -512,6 +512,7 @@ class Step
512
512
  return true if @overriden
513
513
  return true if dependencies.select{|dep| dep.overriden? }.any?
514
514
  info[:archived_info].each do |f,i|
515
+ next if Symbol === i
515
516
  return true if i[:overriden] || i["overriden"]
516
517
  end if info[:archived_info]
517
518
  return false
@@ -84,7 +84,8 @@ module Workflow
84
84
 
85
85
  def self.candidates(workload, rules)
86
86
  if rules.empty?
87
- candidates = workload.select{|k,v| v.empty? }.
87
+ candidates = workload.
88
+ select{|k,v| v.empty? }.
88
89
  collect{|k,v| k }.
89
90
  reject{|k| k.done? }
90
91
  else
@@ -204,7 +205,6 @@ module Workflow
204
205
  when (job.error? || job.aborted?)
205
206
  begin
206
207
  if job.recoverable_error?
207
- iif [:CLEAN, job, job.status, job.info[:exception]]
208
208
  job.clean
209
209
  raise TryAgain
210
210
  else
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.33.1
4
+ version: 5.33.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-22 00:00:00.000000000 Z
11
+ date: 2022-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake