rbbt-util 5.31.0 → 5.31.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71eb12f214343e48d8b2fdbcf5886e382dd3c60c8faeb89625cfb9aa56a5ad08
4
- data.tar.gz: cf8f167c63aecfd2f389650ea9c0baeac59c769c9258bdedc973bc58d8a845e4
3
+ metadata.gz: 4a455f72e89c6996a19cea23673b6c49f99ffd891bf04b6d0d239fbf79a1897a
4
+ data.tar.gz: d8dd575e2869c014508eaeebe52ef20cc29b6baed79a6d3e7559c9fdd1d8da19
5
5
  SHA512:
6
- metadata.gz: a8a23f6a6ab179cb2d4a23ad4556e8f5d5cb1aee600e51b9205a6545c62e364353504adf94cafe8b0e9878881d67c14a27b95724587e1ec109157ad749bdf43d
7
- data.tar.gz: 2d44d126bf3c7963a2846ebac4a749f1c124b82d94b925a1f1c6d2d4ff371ace5b29d86ee80f581c9aab7368b8d4a403687520dd62289c4da964e00263e65065
6
+ metadata.gz: 8613bbffa085f4899e64a5cb71071a061d20f08b479f95d8bc95e9c5abfd5735539a87ee4dddb6ed4822f3acc65d4bac787704e98213b99e4c7922d6ca8a0645
7
+ data.tar.gz: 231dc925d3ae454cadacd5f60f0d7f40d3646df2f7dc00949a7ae5f3e7480f372df06c4c59a3a85d36151d898511eee4c604315aaa2cbae92cf36ffbb1378e7d
@@ -11,7 +11,11 @@ module HPC
11
11
  env_cmd = Misc.process_options options, :env_cmd
12
12
  development = Misc.process_options options, :development
13
13
 
14
- job_cmd = self.rbbt_job_exec_cmd(job, options)
14
+ if contain = options[:contain]
15
+ contain = File.expand_path(contain)
16
+ env_cmd ||= ""
17
+ env_cmd << " TMPDIR='#{contain}/.rbbt/tmp' "
18
+ end
15
19
 
16
20
  if options[:singularity]
17
21
 
@@ -19,24 +23,23 @@ module HPC
19
23
 
20
24
  singularity_img, singularity_opt_dir, singularity_ruby_inline = options.values_at :singularity_img, :singularity_opt_dir, :singularity_ruby_inline
21
25
 
22
- singularity_cmd = %(singularity exec -e -B #{singularity_opt_dir}:/singularity_opt/ -B /apps/)
26
+ singularity_cmd = %(singularity exec -e -B #{singularity_opt_dir}:/singularity_opt/ -B "#{singularity_ruby_inline}":"/.singularity_ruby_inline":rw )
23
27
 
24
- if contain = options[:contain]
25
- contain = File.expand_path(contain)
28
+ if contain && options[:hardened]
26
29
  singularity_cmd << %( -C -H "#{contain}" \
30
+ -B "/.singularity_ruby_inline":"#{contain}/.singularity_ruby_inline":rw
27
31
  -B "#{options[:batch_dir]}" \
28
32
  -B /scratch/tmp \
29
33
  #{ group != user_group ? "-B /gpfs/projects/#{user_group}" : "" } \
30
34
  -B #{scratch_group_dir} \
31
35
  -B #{projects_group_dir} \
32
- -B "#{singularity_ruby_inline}":"#{contain}/.ruby_inline":rw \
36
+ -B /apps/ \
33
37
  -B ~/git:"#{contain}/git":ro \
34
38
  #{Open.exists?('~/.rbbt/software/opt/')? '-B ~/.rbbt/software/opt/:"/opt/":ro' : '' } \
35
39
  -B ~/.rbbt:"#{contain}/home/":ro)
36
- singularity_cmd << " #{singularity_img} "
37
40
  end
38
- env_cmd ||= ""
39
- env_cmd << " TMPDIR='#{contain}/.rbbt/tmp' "
41
+
42
+ singularity_cmd << " #{singularity_img} "
40
43
  end
41
44
 
42
45
  if env_cmd
@@ -172,7 +175,7 @@ EOF
172
175
  batch_options[:wipe_container] ||= 'post'
173
176
  end
174
177
 
175
- if batch_options[:contain] && ! batch_options[:singularity]
178
+ if batch_options[:contain] && ! batch_options[:hardened]
176
179
  options[:workdir_all] = batch_options[:contain]
177
180
  end
178
181
 
@@ -306,7 +309,7 @@ module load singularity
306
309
  mkdir -p "#{singularity_opt_dir}"
307
310
  EOF
308
311
 
309
- if contain
312
+ if contain && options[:hardened]
310
313
 
311
314
  prepare_environment +=<<-EOF
312
315
  # Prepare container for singularity
data/lib/rbbt/hpc/lsf.rb CHANGED
@@ -7,7 +7,8 @@ module HPC
7
7
 
8
8
  def self.batch_system_variables
9
9
  <<-EOF
10
- MAX_MEMORY=$LSB_MAX_MEM_RUSAGE || let MAX_MEMORY="$(grep MemTotal /proc/meminfo|grep -o "[[:digit:]]*") / 1024"
10
+ [[ -z $LSB_MAX_MEM_RUSAGE ]] || MAX_MEMORY=$LSB_MAX_MEM_RUSAGE
11
+ [[ -z $MAX_MEMORY ]] && let MAX_MEMORY="$(grep MemTotal /proc/meminfo|grep -o "[[:digit:]]*") / 1024"
11
12
  BATCH_JOB_ID=$LSF_JOBID
12
13
  BATCH_SYSTEM=LSF
13
14
  EOF
@@ -2,7 +2,7 @@ require_relative 'ansible/workflow'
2
2
  require 'rbbt/workflow/usage'
3
3
 
4
4
  module Ansible
5
- def self.play(playbook, inventory = nil)
5
+ def self.play(playbook, inventory = nil, verbose = false)
6
6
  inventory = Rbbt.etc.ansible_inventory.find
7
7
  Log.with_severity 0 do
8
8
  TmpFile.with_file do |tmp|
@@ -10,7 +10,11 @@ module Ansible
10
10
  Open.write(tmp, [playbook].to_yaml)
11
11
  playbook = tmp
12
12
  end
13
- CMD.cmd_log("ansible-playbook -i #{inventory} #{playbook}")
13
+ if verbose
14
+ CMD.cmd_log("ansible-playbook -i #{inventory} -v #{playbook}")
15
+ else
16
+ CMD.cmd_log("ansible-playbook -i #{inventory} #{playbook}")
17
+ end
14
18
  end
15
19
  end
16
20
  end
@@ -46,7 +50,7 @@ module Ansible
46
50
  def self.playbook(file, task = nil, options = {})
47
51
  task = 'default' if task.nil?
48
52
 
49
- workflow = Workflow.require_workflow file
53
+ workflow = Workflow === file ? file : Workflow.require_workflow(file)
50
54
  task = workflow.tasks.keys.last if workflow.tasks[task].nil?
51
55
  workflow2playbook workflow, task, options
52
56
  end
@@ -99,7 +99,9 @@ class Step
99
99
  if String === value && File.exists?(value)
100
100
  Open.ln_s(value, path)
101
101
  else
102
- Open.write(path + '.yaml', value.to_s.to_yaml)
102
+ value = value.collect{|v| v = "#{v}" if Path === v; v }if Array === value
103
+ value = "#{value}" if Path === value
104
+ Open.write(path + '.yaml', value.to_yaml)
103
105
  end
104
106
  when Array === value
105
107
  Open.write(path, value.collect{|v| Step === v ? v.path : v.to_s} * "\n")
@@ -122,15 +124,18 @@ class Step
122
124
  workflow = job.workflow
123
125
  workflow = Kernel.const_get workflow if String === workflow
124
126
  if workflow
125
- task_info = workflow.task_info(task_name)
126
- input_types = task_info[:input_types]
127
- task_inputs = task_info[:inputs]
128
- input_defaults = task_info[:input_defaults]
127
+ task_info = IndiferentHash.setup(workflow.task_info(task_name))
128
+ input_types = IndiferentHash.setup(task_info[:input_types])
129
+ task_inputs = IndiferentHash.setup(task_info[:inputs])
130
+ input_defaults = IndiferentHash.setup(task_info[:input_defaults])
129
131
  else
130
- task_info = input_types = task_inputs = input_defaults = {}
132
+ task_info = IndiferentHash.setup({})
133
+ input_types = IndiferentHash.setup({})
134
+ task_inputs = IndiferentHash.setup({})
135
+ input_defaults = IndiferentHash.setup({})
131
136
  end
132
137
 
133
- inputs = {}
138
+ inputs = IndiferentHash.setup({})
134
139
  real_inputs = job.real_inputs || job.info[:real_inputs]
135
140
  job.recursive_inputs.zip(job.recursive_inputs.fields).each do |value,name|
136
141
  next unless task_inputs.include? name.to_sym
@@ -545,7 +550,7 @@ class Step
545
550
 
546
551
  def aborted?
547
552
  status = self.status
548
- status == :aborted || ((status != :cleaned && status != :noinfo && status != :setup && status != :noinfo) && nopid?)
553
+ status == :aborted || ((status != :dependencies && status != :cleaned && status != :noinfo && status != :setup && status != :noinfo) && nopid?)
549
554
  end
550
555
 
551
556
  # {{{ INFO
@@ -147,6 +147,8 @@ get_git(){
147
147
  git pull origin master
148
148
  git rebase master
149
149
  git stash apply
150
+ git submodule init
151
+ git submodule update
150
152
  fi
151
153
  else
152
154
  if [ $version == 'none' ];then
@@ -154,6 +156,10 @@ get_git(){
154
156
  else
155
157
  git clone --recursive "$url" "$name" -b $version
156
158
  fi
159
+
160
+ cd "$name"
161
+ git submodule init
162
+ git submodule update
157
163
  fi
158
164
 
159
165
  clean_build
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.31.0
4
+ version: 5.31.5
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-03-24 00:00:00.000000000 Z
11
+ date: 2021-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake