rbbt-util 5.25.17 → 5.25.18
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 +4 -4
- data/lib/rbbt/hpc.rb +3 -2
- data/lib/rbbt/util/tmpfile.rb +5 -3
- data/share/install/software/lib/install_helpers +29 -13
- data/test/rbbt/util/test_tmpfile.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 32456b2f23ba8e3a018ae100b41b565a04284ccf
|
|
4
|
+
data.tar.gz: '0646998ae0c7d8ed85eef12e028e7e57ace7c380'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c1fa0f6562f1ed28a8d932372ab7cb6991d28c7587586e10d5e4a9235c5f045f9b7ba2dc8a7620d998c24b3f129dae89f7d6ce9950926ece5eeeed23ca097403
|
|
7
|
+
data.tar.gz: 2392d0dce826ea7e4c02da67a07e3fc7e11df664564ecc264946214327d1e3ddcbb68021dba50a791740e8b2bd93d0b475dca9e1bdb260cab318bb68148a82aa
|
data/lib/rbbt/hpc.rb
CHANGED
|
@@ -99,7 +99,6 @@ module load java
|
|
|
99
99
|
env +=<<-EOF
|
|
100
100
|
module load intel/2018.1
|
|
101
101
|
module load singularity
|
|
102
|
-
module load samtools
|
|
103
102
|
SINGULARITY_IMG="$HOME/projects/rbbt.singularity.img"
|
|
104
103
|
SINGULARITY_RUBY_INLINE="$HOME/.singularity_ruby_inline"
|
|
105
104
|
mkdir -p "$SINGULARITY_RUBY_INLINE"
|
|
@@ -356,7 +355,9 @@ EOF
|
|
|
356
355
|
task = job.task_name
|
|
357
356
|
name = job.clean_name
|
|
358
357
|
keep_workdir = options.delete :keep_SLURM_workdir
|
|
359
|
-
|
|
358
|
+
slurm_basedir = options.delete :SLURM_basedir
|
|
359
|
+
slurm_basedir = "~/rbbt-workdir" if slurm_basedir.nil?
|
|
360
|
+
TmpFile.with_file(nil, !keep_workdir, :tmpdir => slurm_basedir, :prefix => "SLURM_rbbt_job-") do |tmp_directory|
|
|
360
361
|
workdir = options[:workdir] ||= File.join(tmp_directory, 'workdir')
|
|
361
362
|
inputs_dir = File.join(tmp_directory, 'inputs_dir')
|
|
362
363
|
Step.save_job_inputs(job, inputs_dir)
|
data/lib/rbbt/util/tmpfile.rb
CHANGED
|
@@ -23,8 +23,8 @@ module TmpFile
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
# Creates a random filename in the temporary directory
|
|
26
|
-
def self.tmp_file(s = "",max=10000000)
|
|
27
|
-
File.join(
|
|
26
|
+
def self.tmp_file(s = "", max=10000000, dir = TMPDIR)
|
|
27
|
+
File.expand_path(File.join(dir, random_name(s,max)))
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def self.with_file(content = nil, erase = true, options = {})
|
|
@@ -32,7 +32,9 @@ module TmpFile
|
|
|
32
32
|
options, erase = erase, true if Hash === erase
|
|
33
33
|
|
|
34
34
|
prefix = options[:prefix] || ""
|
|
35
|
-
|
|
35
|
+
tmpdir = options[:tmpdir] || TMPDIR
|
|
36
|
+
max = options[:max] || 10000000
|
|
37
|
+
tmpfile = tmp_file prefix, max, tmpdir
|
|
36
38
|
if options[:extension]
|
|
37
39
|
tmpfile += ".#{options[:extension]}"
|
|
38
40
|
end
|
|
@@ -100,20 +100,32 @@ get_git(){
|
|
|
100
100
|
local name="$1"
|
|
101
101
|
local url="$2"
|
|
102
102
|
|
|
103
|
+
if [[ "$url" == *" "* ]]; then
|
|
104
|
+
version="${url/* /}"
|
|
105
|
+
url="${url/ */}"
|
|
106
|
+
echo "Using version $version of repo $url"
|
|
107
|
+
else
|
|
108
|
+
version='none'
|
|
109
|
+
fi
|
|
110
|
+
|
|
103
111
|
local old_pwd="`expand_path $(pwd)`"
|
|
104
112
|
|
|
105
113
|
cd $OPT_SCM_DIR
|
|
106
114
|
if [ -d "$name" ]; then
|
|
107
115
|
cd "$name"
|
|
108
116
|
|
|
109
|
-
if [ ! "$NOWEB" == "true" ]; then
|
|
117
|
+
if [ ! "$NOWEB" == "true" -a $version == 'none' ]; then
|
|
110
118
|
git stash
|
|
111
119
|
git pull origin master
|
|
112
120
|
git rebase master
|
|
113
121
|
git stash apply
|
|
114
122
|
fi
|
|
115
123
|
else
|
|
124
|
+
if [ $version == 'none' ];then
|
|
116
125
|
git clone "$url" "$name"
|
|
126
|
+
else
|
|
127
|
+
git clone "$url" "$name" -b $version
|
|
128
|
+
fi
|
|
117
129
|
fi
|
|
118
130
|
|
|
119
131
|
clean_build
|
|
@@ -202,28 +214,32 @@ build(){
|
|
|
202
214
|
fi
|
|
203
215
|
|
|
204
216
|
if [ -f CMakeLists.txt ]; then
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
217
|
+
[ -d build ] || mkdir build
|
|
218
|
+
cd build
|
|
219
|
+
cmake -DCMAKE_INSTALL_PREFIX:PATH=/install_dir ..
|
|
220
|
+
make DESTDIR="$(opt_dir "$name")" -j4
|
|
221
|
+
make DESTDIR="$(opt_dir "$name")" install || (cd .. ; mv build "$(opt_dir "$name")")
|
|
222
|
+
if [ -d "$(opt_dir "$name")/install_dir" ]; then
|
|
223
|
+
mv "$(opt_dir "$name")/install_dir"/** "$(opt_dir "$name")"
|
|
224
|
+
rmdir "$(opt_dir "$name")/install_dir"
|
|
225
|
+
fi
|
|
226
|
+
|
|
227
|
+
setup "$name"
|
|
228
|
+
clean_build
|
|
229
|
+
else
|
|
230
|
+
if [ -f configure ]; then
|
|
215
231
|
echo ./configure --prefix="$(opt_dir "$name")" $extra
|
|
216
232
|
./configure --prefix="$(opt_dir "$name")" $extra
|
|
217
233
|
compile "$name" $extra
|
|
218
234
|
setup "$name"
|
|
219
235
|
clean_build
|
|
220
|
-
|
|
236
|
+
else
|
|
221
237
|
compile "$name" $extra
|
|
222
238
|
move_opt "$name"
|
|
223
239
|
setup "$name"
|
|
224
240
|
clean_build
|
|
241
|
+
fi
|
|
225
242
|
fi
|
|
226
|
-
|
|
227
243
|
|
|
228
244
|
cd "$old_pwd"
|
|
229
245
|
}
|
|
@@ -5,7 +5,7 @@ require 'test/unit'
|
|
|
5
5
|
class TestTmpFile < Test::Unit::TestCase
|
|
6
6
|
|
|
7
7
|
def test_tmp_file
|
|
8
|
-
assert(TmpFile.tmp_file("test") =~ /tmp\/test\d+$/)
|
|
8
|
+
assert(TmpFile.tmp_file("test") =~ /(tmpfiles|tmp)\/test\d+$/)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def test_do_tmp_file
|
|
@@ -19,7 +19,12 @@ class TestTmpFile < Test::Unit::TestCase
|
|
|
19
19
|
TmpFile.with_file(nil, true, :extension => 'txt') do |file|
|
|
20
20
|
assert file =~ /\.txt$/
|
|
21
21
|
end
|
|
22
|
+
end
|
|
22
23
|
|
|
24
|
+
def test_tmpdir
|
|
25
|
+
TmpFile.with_file(nil, true, :tmpdir => 'TMPDIR') do |file|
|
|
26
|
+
assert file =~ /TMPDIR/
|
|
27
|
+
end
|
|
23
28
|
end
|
|
24
29
|
|
|
25
30
|
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.25.
|
|
4
|
+
version: 5.25.18
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Miguel Vazquez
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-01-
|
|
11
|
+
date: 2019-01-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|