rbbt-util 5.31.4 → 5.31.10
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/batch.rb +14 -9
- data/lib/rbbt/hpc/lsf.rb +2 -1
- data/lib/rbbt/resource/util.rb +1 -1
- data/lib/rbbt/util/cmd.rb +8 -0
- data/lib/rbbt/workflow/step/accessor.rb +1 -0
- 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: 4909a13c518c1128adcdfc981153c04bb9f57c11b8501c65549b427fd0d647d5
|
4
|
+
data.tar.gz: 0b6f7089d1c78aec899dcfdec1784a0bbb56f3df7c84f24bedb6da0d79e058fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f041b99830f23f3bd8f6e29de8bec29ca5352d4a0873d36dc452b5c1d7a2d31a7d563247337980e8df06fbd9a1835ba04bab43bd9293d9484f82ab00fc534482
|
7
|
+
data.tar.gz: 2c80efb6433e60851c666cc7bb75a7e66a7a3e5813db3bd41c73c8511ef94a64b4ab8528da2a2abe104f2aad97d7ed69876931e5932c02a7ed2db1e5f470a3b1
|
data/lib/rbbt/hpc/batch.rb
CHANGED
@@ -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
|
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
|
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
|
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
|
-
|
37
|
-
|
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[:
|
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
|
-
|
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
|
data/lib/rbbt/resource/util.rb
CHANGED
@@ -33,7 +33,7 @@ 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.collect{|d| d.annotate(File.dirname(d)) }.reverse.each do |software_dir|
|
37
37
|
next unless software_dir.exists?
|
38
38
|
software_dir = File.expand_path(software_dir)
|
39
39
|
opt_dir = File.join(software_dir, 'opt')
|
data/lib/rbbt/util/cmd.rb
CHANGED
@@ -10,6 +10,14 @@ module CMD
|
|
10
10
|
TOOLS[tool] = [claim, test, block, cmd]
|
11
11
|
end
|
12
12
|
|
13
|
+
def self.conda(tool, env = nil, channel = 'bioconda')
|
14
|
+
if env
|
15
|
+
CMD.cmd("bash -l -c '(conda activate #{env} && conda install #{tool} -c #{channel})'")
|
16
|
+
else
|
17
|
+
CMD.cmd("bash -l -c 'conda install #{tool} -c #{channel}'")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
13
21
|
def self.get_tool(tool)
|
14
22
|
return tool.to_s unless TOOLS[tool]
|
15
23
|
|
@@ -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
|
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.
|
4
|
+
version: 5.31.10
|
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-
|
11
|
+
date: 2021-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|