sushi_fabric 0.9.8 → 1.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c57dc465158ddf76e857e126e427f581ecf1a65a805fd01af17e1782b0503208
4
- data.tar.gz: 7ff6d22fd4617f2e10459474d86f706b1f4bbd39c7922031271c49c8f4f45269
3
+ metadata.gz: b645fb8369eee1152493ef424f092cd00f0a5a08c27cb78d4b081e17c0b18784
4
+ data.tar.gz: 2630d702479d4eac533f737e226c80cbe115598d891eb526ec1f8e7004fc9481
5
5
  SHA512:
6
- metadata.gz: c88d5589e019b1742b962d78550658c53302d453a2ce76c21b171f9caa4cc176be79ccb60dbb3d9edfb9cc88e7fbde1a36848a8392a64f089b1ffcbb53a99260
7
- data.tar.gz: eacc4d03b02f4a94adeb42a40f2217022aa0b7659c1cfe3fc1035d9726dd04375e15eebf47c4a7f582416c7c7b18eabaac4e9c8b6e46c5c48fbea4139380ada6
6
+ metadata.gz: a68e3cee864cc0cd12b5335b9d8d1eb8688175870455b61d4153109c8d98e5d77846d4ef87d50bec8c1dde624511cfde6b60de1110724b1878ccc19af91bd6ea
7
+ data.tar.gz: 331228ad3cebe41dbf0b6b921e2284d1030e2948f92b2ecebbc9955242ec3c47730b972e367947018114748e0fe9c65a6f9e3660896047684370b3f8fabfd8c5
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: utf-8
3
- # Version = '20200723-132451'
3
+ # Version = '20201218-155451'
4
4
 
5
5
  require 'csv'
6
6
  require 'fileutils'
@@ -238,6 +238,7 @@ class SushiApp
238
238
  @params['scratch'] = nil
239
239
  @params['node'] = ''
240
240
  @params['queue'] = ''
241
+ @params['partition'] = ''
241
242
  @params['process_mode'] = 'SAMPLE'
242
243
  @params['samples'] = ''
243
244
  @job_ids = []
@@ -390,16 +391,18 @@ class SushiApp
390
391
  FileUtils.mkdir_p(@scratch_result_dir)
391
392
  FileUtils.mkdir_p(@job_script_dir)
392
393
  end
393
- def check_latest_module_version(mod)
394
- command_out = %x[ bash -lc "source #{@module_source}; module whatis #{mod} 2>&1" ]
395
- latest_mod = nil
396
- command_out.split("\n").each do |line|
397
- if line =~ /#{mod}/
398
- latest_mod = line.split.first
399
- break
394
+ def check_latest_modules_version(modules)
395
+ command_out = %x[ bash -lc "source #{@module_source}; module whatis #{modules.join(" ")} 2>&1" | cut -f 1 -d " " | uniq ]
396
+ latest_modules = []
397
+ command_out.split("\n").each do |line_|
398
+ line = line_.chomp
399
+ unless line.empty?
400
+ if line =~ /#{modules.join("|")}/
401
+ latest_modules << line
402
+ end
400
403
  end
401
404
  end
402
- latest_mod
405
+ latest_modules
403
406
  end
404
407
  def job_header
405
408
  @scratch_dir = if @params['process_mode'] == 'SAMPLE'
@@ -419,9 +422,17 @@ class SushiApp
419
422
  ""
420
423
  end
421
424
  module_add_commands = if @modules and !@modules.empty?
422
- modules_with_version = @modules.map{|mod| check_latest_module_version(mod)}
423
- modules_with_version.compact!
424
- "module add #{modules_with_version.join(' ')}"
425
+ modules_with_version = check_latest_modules_version(@modules)
426
+ if @modules.length == modules_with_version.length
427
+ modules_with_version.compact!
428
+ "module add #{modules_with_version.join(' ')}"
429
+ else
430
+ @logger.error("#"*100)
431
+ @logger.error("# Error in checking modules ")
432
+ @logger.error("# Please check if all modules are correctly installed, searched #{@modules.join(",")} but only detected #{modules_with_version.join(",")}")
433
+ @logger.error("#"*100)
434
+ "exit # Please check if all modules are correctly installed, searched #{@modules.join(",")} but only detected #{modules_with_version.join(",")}"
435
+ end
425
436
  else
426
437
  ""
427
438
  end
@@ -448,6 +459,13 @@ cd $SCRATCH_DIR || exit 1
448
459
  end
449
460
  def job_footer
450
461
  @out.print "#### JOB IS DONE WE PUT THINGS IN PLACE AND CLEAN AUP\n"
462
+ if File.exist?("/usr/local/ngseq/miniconda3/etc/profile.d/conda.sh")
463
+ @out.print <<-EOS
464
+ . "/usr/local/ngseq/miniconda3/etc/profile.d/conda.sh"
465
+ conda activate sushi
466
+ EOS
467
+ end
468
+
451
469
  if @output_files
452
470
  @output_files.map{|header| next_dataset[header]}.each do |file|
453
471
  # in actual case, to save under /srv/gstore/
@@ -477,6 +495,7 @@ rm -rf #{@scratch_dir} || exit 1
477
495
  gsub_options = []
478
496
  gsub_options << "-c #{@params['cores']}" unless @params['cores'].to_s.empty?
479
497
  gsub_options << "-n #{@params['node']}" unless @params['node'].to_s.empty?
498
+ gsub_options << "-p #{@params['partition']}" unless @params['partition'].to_s.empty?
480
499
  gsub_options << "-r #{@params['ram']}" unless @params['ram'].to_s.empty?
481
500
  gsub_options << "-s #{@params['scratch']}" unless @params['scratch'].to_s.empty?
482
501
  command = "wfm_monitoring --server #{WORKFLOW_MANAGER} --user #{@user} --project #{@project.gsub(/p/,'')} --logdir #{@gstore_script_dir} #{job_script} #{gsub_options.join(' ')}"
@@ -795,7 +814,6 @@ rm -rf #{@scratch_dir} || exit 1
795
814
  if next_dataset.workunit_id
796
815
  @job_scripts.each do |job_script|
797
816
  open(job_script, "a") do |out|
798
- out.puts "module load Dev/Python"
799
817
  out.puts "WORKUNIT_ID=#{next_dataset.workunit_id}"
800
818
  out.puts "update_resource_size -w $WORKUNIT_ID"
801
819
  end
@@ -1,3 +1,3 @@
1
1
  module SushiFabric
2
- VERSION = "0.9.8"
2
+ VERSION = "1.0.3"
3
3
  end
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.9.8
4
+ version: 1.0.3
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: 2020-07-23 00:00:00.000000000 Z
11
+ date: 2020-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler