miga-base 0.7.16.6 → 0.7.16.12

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: fcd30efdaa8cf3a8ae87b5cc658363c2d37c0beb3c13491595beb983b1629b32
4
- data.tar.gz: '0441764548f4199a8f3df253c151dc856aa414f5a91d02126bcb893ee2fe6835'
3
+ metadata.gz: 1e89d0bc90eef4ca458fbc415cbeff6eaa6c2b07ee4df77268826ecfbe0720df
4
+ data.tar.gz: b082d83022262e82d309e8ff70f077fe28cebddacf5b85844547ed24a8a877f7
5
5
  SHA512:
6
- metadata.gz: 18e829f1cb4141df9515565bd19af32e67b9920689a75dd4b5f2f5a79d0a5b7d86ea425f64e7702766e09a14c5b70af4d07ccb16df94aeef3ba4ade54e9506ab
7
- data.tar.gz: 72ad22fd3386214825c463edc9232f2deeae24d06257a523f73592fd2d9496e452d192d10f37cf493b52a936578c3111a1a8801a78494688d51fc75b01e489f2
6
+ metadata.gz: fa0746c6173b1b7a504b6d40ed0a158ef647694970f9222aeeaa5465dcad73f4647894164d0edc823b54dce837410393ac61186a6b217ff5edacbfc81a01591d
7
+ data.tar.gz: b8411e7c9fb0f62de20e5a909dbf7b4c998bcb18aa4fa79fbe48dc128292f8983ce1dfae54d9e3082807449b6c5cf9d4a3bb913bc9dde77c1c2d4bab6aa8fe27
data/bin/miga CHANGED
@@ -4,6 +4,8 @@
4
4
  # @license Artistic-2.0
5
5
 
6
6
  $LOAD_PATH.push File.expand_path('../../lib', __FILE__)
7
+ $LOAD_PATH.push File.expand_path('../../lib', File.realpath(__FILE__))
8
+
7
9
  require 'miga'
8
10
  require 'miga/cli'
9
11
 
@@ -73,6 +73,7 @@ class MiGA::Cli::Action::Daemon < MiGA::Cli::Action
73
73
  end
74
74
 
75
75
  def perform
76
+ cli.operation or raise 'Please specify a daemon operation'
76
77
  p = cli.load_project
77
78
  d = MiGA::Daemon.new(p, cli[:json])
78
79
  dopts = %i[latency maxjobs nodelist ppn shutdown_when_done]
@@ -37,6 +37,9 @@ class MiGA::Cli::Action::Run < MiGA::Cli::Action
37
37
  cli[:thr] ||= ENV['CORES'].to_i unless ENV['CORES'].nil?
38
38
  cli[:result] = File.basename(cli[:result].to_s, '.bash').to_sym
39
39
  end
40
+ %i[project dataset result].each do |i|
41
+ cli[i] = nil if cli[i].nil? || cli[i].empty?
42
+ end
40
43
 
41
44
  # Unset dataset if the requested result is for projects
42
45
  if (MiGA::Project.RESULT_DIRS.keys + [:p]).include? cli[:result]
@@ -184,7 +184,7 @@ module MiGA::Cli::Action::Wf
184
184
  def call_cli(cmd)
185
185
  cmd << '-v' if cli[:verbose]
186
186
  MiGA::MiGA.DEBUG "Cli::Action::Wf.call_cli #{cmd}"
187
- MiGA::Cli.new(cmd.map(&:to_s)).launch
187
+ MiGA::Cli.new(cmd.map(&:to_s)).launch(true)
188
188
  end
189
189
 
190
190
  def run_daemon
@@ -92,8 +92,7 @@ class MiGA::Daemon < MiGA::MiGA
92
92
  flush!
93
93
  if (loop_i % 12).zero?
94
94
  purge!
95
- # TEMPORARILY DISABLED:
96
- # recalculate_status!
95
+ recalculate_status!
97
96
  end
98
97
  save_status
99
98
  sleep(latency)
@@ -102,8 +101,10 @@ class MiGA::Daemon < MiGA::MiGA
102
101
  end
103
102
 
104
103
  def recalculate_status!
105
- say 'Recalculating status for all datasets'
106
- project.each_dataset(&:recalculate_status)
104
+ say 'Recalculating status for all complete datasets'
105
+ project.each_dataset do |ds|
106
+ ds.recalculate_status if ds.status == :complete
107
+ end
107
108
  end
108
109
 
109
110
  ##
@@ -309,11 +310,13 @@ class MiGA::Daemon < MiGA::MiGA
309
310
  job[:hostk] = hostk
310
311
  job[:cmd] = job[:cmd].miga_variables(host: nodelist[hostk])
311
312
  job[:pid] = spawn job[:cmd]
312
- Process.detach job[:pid] unless [nil, '', 0].include?(job[:pid])
313
+ MiGA::MiGA.DEBUG "Detaching PID: #{job[:pid]}"
314
+ Process.detach(job[:pid]) unless [nil, '', 0].include?(job[:pid])
313
315
  when 'bash'
314
316
  # Local job
315
317
  job[:pid] = spawn job[:cmd]
316
- Process.detach job[:pid] unless [nil, '', 0].include?(job[:pid])
318
+ MiGA::MiGA.DEBUG "Detaching PID: #{job[:pid]}"
319
+ Process.detach(job[:pid]) unless [nil, '', 0].include?(job[:pid])
317
320
  else
318
321
  # Schedule cluster job (qsub, msub, slurm)
319
322
  job[:pid] = `#{job[:cmd]}`.chomp
@@ -156,10 +156,12 @@ class MiGA::RemoteDataset < MiGA::MiGA
156
156
  return nil unless metadata[:ncbi_asm]
157
157
 
158
158
  ncbi_asm_id = self.class.ncbi_asm_acc2id metadata[:ncbi_asm]
159
- doc = MiGA::Json.parse(
160
- self.class.download(:ncbi_summary, :assembly, ncbi_asm_id, :json),
161
- symbolize: false, contents: true
162
- )
159
+ txt = nil
160
+ 3.times do
161
+ txt = self.class.download(:ncbi_summary, :assembly, ncbi_asm_id, :json)
162
+ txt.empty? ? sleep(1) : break
163
+ end
164
+ doc = MiGA::Json.parse(txt, symbolize: false, contents: true)
163
165
  @_ncbi_asm_json_doc = doc['result'][ doc['result']['uids'].first ]
164
166
  end
165
167
 
@@ -8,7 +8,7 @@ module MiGA
8
8
  # - Float representing the major.minor version.
9
9
  # - Integer representing gem releases of the current version.
10
10
  # - Integer representing minor changes that require new version number.
11
- VERSION = [0.7, 16, 6]
11
+ VERSION = [0.7, 16, 12]
12
12
 
13
13
  ##
14
14
  # Nickname for the current major.minor version.
@@ -16,7 +16,7 @@ module MiGA
16
16
 
17
17
  ##
18
18
  # Date of the current gem release.
19
- VERSION_DATE = Date.new(2020, 11, 22)
19
+ VERSION_DATE = Date.new(2020, 12, 24)
20
20
 
21
21
  ##
22
22
  # Reference of MiGA.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miga-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.16.6
4
+ version: 0.7.16.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis M. Rodriguez-R
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-22 00:00:00.000000000 Z
11
+ date: 2020-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daemons