rbbt-util 5.31.1 → 5.31.7

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: 61b346a2806a9f5c6f32dd2e972386ad2ebd5d748b4d71ac89fdeabc0250567b
4
- data.tar.gz: faa0e2b8eee1eb1271406f16bf8b030ee4ecd3d83e6dfce205a5129e6676e2c9
3
+ metadata.gz: 34e7a247caa69fc1c5f63d78ed8dd0884f8a57bb85940f5331484482115b4169
4
+ data.tar.gz: 0c390b5aa9c71bf06f0964bb8a5f21b1a1d500c9865c442a7365532094949e15
5
5
  SHA512:
6
- metadata.gz: 57f76043890f5ad9ecdf7b397f7803d59556bc39fe8110fd719db68192cda82542ccf072899f37f23fd497a03fe79b9d1119146c268e7571843dee9a35eeb506
7
- data.tar.gz: 8b4b959e19804a206abb1a080d81866aa73388eee85d1c031021ed79e239df570b055a3f9d007fbe406eb372edd76ade85a556bf9d38dca16011b326efbf8117
6
+ metadata.gz: 47c595b2129fcdadc2caf5c7d3ae2c0ea005b5d0969c96eb49fef69a6773430dc02fc83f2abfed47492d4fa66c09b43c5ab3f28a4667465cb612d3aaff9261c7
7
+ data.tar.gz: 82db64ecc144b0d29169a6736bf9df736b3ccb3355117f3808a0b1c631b35f1ca5e91f36cfdd96a6e5c823767ace2b12ebb3666af068a794d859a15683917f00
@@ -11,30 +11,35 @@ module HPC
11
11
  env_cmd = Misc.process_options options, :env_cmd
12
12
  development = Misc.process_options options, :development
13
13
 
14
+ if contain = options[:contain]
15
+ contain = File.expand_path(contain)
16
+ env_cmd ||= ""
17
+ env_cmd << " TMPDIR='#{contain}/.rbbt/tmp' "
18
+ end
19
+
14
20
  if options[:singularity]
15
21
 
16
22
  group, user, user_group, scratch_group_dir, projects_group_dir = options.values_at :group, :user, :user_group, :scratch_group_dir, :projects_group_dir
17
23
 
18
24
  singularity_img, singularity_opt_dir, singularity_ruby_inline = options.values_at :singularity_img, :singularity_opt_dir, :singularity_ruby_inline
19
25
 
20
- 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 )
21
27
 
22
- if contain = options[:contain]
23
- contain = File.expand_path(contain)
28
+ if contain && options[:hardened]
24
29
  singularity_cmd << %( -C -H "#{contain}" \
30
+ -B "/.singularity_ruby_inline":"#{contain}/.singularity_ruby_inline":rw
25
31
  -B "#{options[:batch_dir]}" \
26
32
  -B /scratch/tmp \
27
33
  #{ group != user_group ? "-B /gpfs/projects/#{user_group}" : "" } \
28
34
  -B #{scratch_group_dir} \
29
35
  -B #{projects_group_dir} \
30
- -B "#{singularity_ruby_inline}":"#{contain}/.ruby_inline":rw \
36
+ -B /apps/ \
31
37
  -B ~/git:"#{contain}/git":ro \
32
38
  #{Open.exists?('~/.rbbt/software/opt/')? '-B ~/.rbbt/software/opt/:"/opt/":ro' : '' } \
33
39
  -B ~/.rbbt:"#{contain}/home/":ro)
34
- singularity_cmd << " #{singularity_img} "
35
40
  end
36
- env_cmd ||= ""
37
- env_cmd << " TMPDIR='#{contain}/.rbbt/tmp' "
41
+
42
+ singularity_cmd << " #{singularity_img} "
38
43
  end
39
44
 
40
45
  if env_cmd
@@ -170,7 +175,7 @@ EOF
170
175
  batch_options[:wipe_container] ||= 'post'
171
176
  end
172
177
 
173
- if batch_options[:contain] && ! batch_options[:singularity]
178
+ if batch_options[:contain] && ! batch_options[:hardened]
174
179
  options[:workdir_all] = batch_options[:contain]
175
180
  end
176
181
 
@@ -304,7 +309,7 @@ module load singularity
304
309
  mkdir -p "#{singularity_opt_dir}"
305
310
  EOF
306
311
 
307
- if contain
312
+ if contain && options[:hardened]
308
313
 
309
314
  prepare_environment +=<<-EOF
310
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
@@ -33,9 +33,9 @@ end
33
33
 
34
34
  module Resource
35
35
  def set_software_env(software_dir)
36
- software_dir.find_all.reverse.each do |software_dir|
36
+ software_dir.opt.find_all.reverse.each do |software_dir|
37
37
  next unless software_dir.exists?
38
- software_dir = File.expand_path(software_dir)
38
+ software_dir = File.expand_path(File.dirname(software_dir))
39
39
  opt_dir = File.join(software_dir, 'opt')
40
40
  bin_dir = File.join(opt_dir, 'bin')
41
41
 
@@ -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,6 +99,7 @@ class Step
99
99
  if String === value && File.exists?(value)
100
100
  Open.ln_s(value, path)
101
101
  else
102
+ value = value.collect{|v| v = "#{v}" if Path === v; v }if Array === value
102
103
  value = "#{value}" if Path === value
103
104
  Open.write(path + '.yaml', value.to_yaml)
104
105
  end
@@ -549,7 +550,7 @@ class Step
549
550
 
550
551
  def aborted?
551
552
  status = self.status
552
- 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?)
553
554
  end
554
555
 
555
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.1
4
+ version: 5.31.7
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