sushi_fabric 0.9.5 → 1.0.0
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 +5 -5
- data/lib/sushi_fabric/sushiApp.rb +52 -29
- data/lib/sushi_fabric/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 795af5bedd1d25f2f6c41bcab16b699b015df28615ff1ef5a975f330ba8f7255
|
4
|
+
data.tar.gz: ebc667d556828450ae331a4e63ed07bde0b4871b97d18747bc71ff6e407f185a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ae60c4d4acef1444c9b1bfdb11f2dc6455add3414cfc63412603051d992c402c67037c45ff136b905ac2166100e36fa3f1e3c8d313cea80bc24c31a3b7f2577
|
7
|
+
data.tar.gz: 8a046912e3b798e662b9e1131d5a0151f36cbb83e4eb986c9827dff6e410e1910c2965d383daba7a1dc9a5798f08c566feb72bb3c812cbdcbf1f7fe9d4cf575d
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# encoding: utf-8
|
3
|
-
# Version = '
|
3
|
+
# Version = '20200724-120813'
|
4
4
|
|
5
5
|
require 'csv'
|
6
6
|
require 'fileutils'
|
@@ -237,6 +237,7 @@ class SushiApp
|
|
237
237
|
@params['ram'] = nil
|
238
238
|
@params['scratch'] = nil
|
239
239
|
@params['node'] = ''
|
240
|
+
@params['queue'] = ''
|
240
241
|
@params['process_mode'] = 'SAMPLE'
|
241
242
|
@params['samples'] = ''
|
242
243
|
@job_ids = []
|
@@ -391,8 +392,13 @@ class SushiApp
|
|
391
392
|
end
|
392
393
|
def check_latest_module_version(mod)
|
393
394
|
command_out = %x[ bash -lc "source #{@module_source}; module whatis #{mod} 2>&1" ]
|
394
|
-
latest_mod =
|
395
|
-
|
395
|
+
latest_mod = nil
|
396
|
+
command_out.split("\n").each do |line|
|
397
|
+
if line =~ /#{mod}/
|
398
|
+
latest_mod = line.split.first
|
399
|
+
break
|
400
|
+
end
|
401
|
+
end
|
396
402
|
latest_mod
|
397
403
|
end
|
398
404
|
def job_header
|
@@ -416,7 +422,6 @@ class SushiApp
|
|
416
422
|
modules_with_version = @modules.map{|mod| check_latest_module_version(mod)}
|
417
423
|
modules_with_version.compact!
|
418
424
|
"module add #{modules_with_version.join(' ')}"
|
419
|
-
#"module add #{@modules.join(' ')}"
|
420
425
|
else
|
421
426
|
""
|
422
427
|
end
|
@@ -443,6 +448,13 @@ cd $SCRATCH_DIR || exit 1
|
|
443
448
|
end
|
444
449
|
def job_footer
|
445
450
|
@out.print "#### JOB IS DONE WE PUT THINGS IN PLACE AND CLEAN AUP\n"
|
451
|
+
if File.exist?("/usr/local/ngseq/miniconda3/etc/profile.d/conda.sh")
|
452
|
+
@out.print <<-EOS
|
453
|
+
. "/usr/local/ngseq/miniconda3/etc/profile.d/conda.sh"
|
454
|
+
conda activate sushi
|
455
|
+
EOS
|
456
|
+
end
|
457
|
+
|
446
458
|
if @output_files
|
447
459
|
@output_files.map{|header| next_dataset[header]}.each do |file|
|
448
460
|
# in actual case, to save under /srv/gstore/
|
@@ -755,28 +767,14 @@ rm -rf #{@scratch_dir} || exit 1
|
|
755
767
|
if mock
|
756
768
|
make_dummy_files
|
757
769
|
end
|
758
|
-
copy_inputdataset_parameter_jobscripts
|
759
|
-
|
760
|
-
# job submittion
|
761
|
-
gstore_job_script_paths = []
|
762
|
-
@job_scripts.each_with_index do |job_script, i|
|
763
|
-
if job_id = submit(job_script, mock)
|
764
|
-
@job_ids << job_id
|
765
|
-
print "Submit job #{File.basename(job_script)} job_id=#{job_id}"
|
766
|
-
gstore_job_script_paths << File.join(@gstore_script_dir, File.basename(job_script))
|
767
|
-
end
|
768
|
-
end
|
769
770
|
|
770
|
-
puts
|
771
|
-
print 'job scripts: '
|
772
|
-
p @job_scripts
|
773
771
|
print 'result dataset: '
|
774
772
|
p @result_dataset
|
775
773
|
|
776
774
|
# copy application data to gstore
|
777
775
|
@next_dataset_tsv_path = save_next_dataset_as_tsv
|
778
776
|
|
779
|
-
if
|
777
|
+
if @dataset_sushi_id and dataset = DataSet.find_by_id(@dataset_sushi_id.to_i)
|
780
778
|
data_set_arr = []
|
781
779
|
headers = []
|
782
780
|
rows = []
|
@@ -801,20 +799,45 @@ rm -rf #{@scratch_dir} || exit 1
|
|
801
799
|
unless @off_bfabric_registration
|
802
800
|
if next_dataset = DataSet.find_by_id(@next_dataset_id)
|
803
801
|
next_dataset.register_bfabric(bfabric_application_number: @next_dataset_bfabric_application_number)
|
802
|
+
if next_dataset.workunit_id
|
803
|
+
@job_scripts.each do |job_script|
|
804
|
+
open(job_script, "a") do |out|
|
805
|
+
out.puts "WORKUNIT_ID=#{next_dataset.workunit_id}"
|
806
|
+
out.puts "update_resource_size -w $WORKUNIT_ID"
|
807
|
+
end
|
808
|
+
end
|
809
|
+
end
|
804
810
|
end
|
805
811
|
end
|
812
|
+
end
|
813
|
+
end
|
814
|
+
copy_inputdataset_parameter_jobscripts
|
815
|
+
|
816
|
+
# job submittion
|
817
|
+
gstore_job_script_paths = []
|
818
|
+
@job_scripts.each_with_index do |job_script, i|
|
819
|
+
if job_id = submit(job_script, mock)
|
820
|
+
@job_ids << job_id
|
821
|
+
print "Submit job #{File.basename(job_script)} job_id=#{job_id}"
|
822
|
+
gstore_job_script_paths << File.join(@gstore_script_dir, File.basename(job_script))
|
823
|
+
end
|
824
|
+
end
|
825
|
+
|
826
|
+
puts
|
827
|
+
print 'job scripts: '
|
828
|
+
p @job_scripts
|
806
829
|
|
807
|
-
# save job and dataset relation in Sushi DB
|
808
|
-
job_ids.each_with_index do |job_id, i|
|
809
|
-
new_job = Job.new
|
810
|
-
new_job.submit_job_id = job_id.to_i
|
811
|
-
new_job.script_path = gstore_job_script_paths[i]
|
812
|
-
new_job.next_dataset_id = @next_dataset_id
|
813
|
-
new_job.save
|
814
|
-
new_job.data_set.jobs << new_job
|
815
|
-
new_job.data_set.save
|
816
|
-
end
|
817
830
|
|
831
|
+
unless @job_ids.empty? or NO_ROR
|
832
|
+
# save job and dataset relation in Sushi DB
|
833
|
+
job_ids.each_with_index do |job_id, i|
|
834
|
+
new_job = Job.new
|
835
|
+
new_job.submit_job_id = job_id.to_i
|
836
|
+
new_job.script_path = gstore_job_script_paths[i]
|
837
|
+
new_job.next_dataset_id = @next_dataset_id
|
838
|
+
new_job.save
|
839
|
+
new_job.data_set.jobs << new_job
|
840
|
+
new_job.data_set.save
|
818
841
|
end
|
819
842
|
end
|
820
843
|
copy_nextdataset
|
data/lib/sushi_fabric/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sushi_fabric
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Functional Genomics Center Zurich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -84,8 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
|
-
|
88
|
-
rubygems_version: 2.6.14
|
87
|
+
rubygems_version: 3.0.3
|
89
88
|
signing_key:
|
90
89
|
specification_version: 4
|
91
90
|
summary: workflow manager client.
|