autoflow 0.8.0 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 94220cd6f51e6b8715d6f89e7bf8e7fcc081651d
4
+ data.tar.gz: b823cce8cd1125752a9fb9328aa687c72ebc0c81
5
+ SHA512:
6
+ metadata.gz: 6b3479c881c662937922a604eb993dfd2f2ee4b340075753b33710b54a710f8a515c02a1dac1688c3e0ba55aa4256468d5c9ccb4e7f0a1db5e14d9d1bd41efa9
7
+ data.tar.gz: cc737f01685322374f41b482ac3e97f12c11fab420d2050a2812ceb0197ad652b3f1bc8df004e316a35399b5dc4f7515dd56bfdb95aae863d7b5803c77fab37c
@@ -171,6 +171,11 @@ optparse = OptionParser.new do |opts|
171
171
  options[:use_ntasks] = TRUE
172
172
  end
173
173
 
174
+ options[:show_submit_command] = FALSE
175
+ opts.on( '-S', '--show_submit_command', 'Show the command line used to submit the job' ) do
176
+ options[:show_submit_command] = TRUE
177
+ end
178
+
174
179
  options[:time] = '20:00:00'
175
180
  opts.on( '-t', '--time STRING', 'Max time that can be needed in a task. Format: dd-hh:mm:ss' ) do |time|
176
181
  options[:time] = time
@@ -36,7 +36,7 @@ def report_log(log, initial_flow_attribs, mode, workflow_status, no_size)
36
36
  puts Terminal::Table.new :headings => ['Status', 'Folder', 'Time', 'Size', 'Job Name'], :rows => rows
37
37
  end
38
38
 
39
- def launch_failed_jobs(log, initial_flow_attribs, exec_folder, batch)
39
+ def launch_failed_jobs(log, initial_flow_attribs, exec_folder, batch, pending = false)
40
40
  options = {
41
41
  :verbose => FALSE,
42
42
  :identifier => nil,
@@ -47,6 +47,7 @@ def launch_failed_jobs(log, initial_flow_attribs, exec_folder, batch)
47
47
  :write_sh => FALSE
48
48
  }
49
49
  failed_jobs = get_failed_jobs(log)
50
+ failed_jobs.concat(get_pending_jobs(log, failed_jobs, initial_flow_attribs)) if pending
50
51
  jobs = {}
51
52
  create_jobs(jobs, failed_jobs, initial_flow_attribs)
52
53
  get_all_dependencies(jobs, failed_jobs, initial_flow_attribs)
@@ -86,8 +87,24 @@ def get_all_dependencies(jobs, failed_jobs, initial_flow_attribs)
86
87
  end
87
88
  end
88
89
 
90
+ def get_pending_jobs(log, failed_jobs, initial_flow_attribs)
91
+ pending = []
92
+ log.each do |task, attribs|
93
+ if attribs['start'].last == 0 && attribs['end'].last == 0
94
+ pending << task
95
+ end
96
+ end
97
+ pending_to_launch = [] #PENDING jobs that for some reason has not been launched although their depedencies has been executed succesful.
98
+ pending.each do |job|
99
+ folder, dependencies = initial_flow_attribs[job]
100
+ if (dependencies & failed_jobs).length == 0 || (dependencies & pending).length == 0
101
+ pending_to_launch << job
102
+ end
103
+ end
104
+ return pending_to_launch
105
+ end
106
+
89
107
  def get_failed_jobs(log)
90
- failed_jobs = []
91
108
  position = 0
92
109
  fails = []
93
110
  log.each do |task, attribs|
@@ -97,13 +114,7 @@ def get_failed_jobs(log)
97
114
  fails << [task, abort]
98
115
  end
99
116
  end
100
- if !fails.empty?
101
- fails.each do |task, index|
102
- if position == index
103
- failed_jobs << task
104
- end
105
- end
106
- end
117
+ failed_jobs = fails.select{|task, index| index == position}.map{|t, i| t}
107
118
  return failed_jobs
108
119
  end
109
120
 
@@ -272,10 +283,15 @@ OptionParser.new do |opts|
272
283
  end
273
284
 
274
285
  options[:launch_failed_jobs] = FALSE
275
- opts.on("-l", "--launch_failed_jobs", "Launch jobs tagges as ABORT and NOT. This option only works when the -w flag is enabled") do |opt|
286
+ opts.on("-l", "--launch_failed_jobs", "Launch jobs tagged as ABORT and NOT. This option only works when the -w flag is enabled") do |opt|
276
287
  options[:launch_failed_jobs] = TRUE
277
288
  end
278
289
 
290
+ options[:pending] = FALSE
291
+ opts.on("-p", "--pending", "Launch jobs tagged as NOT. This option only works when the -w flag is enabled") do |opt|
292
+ options[:pending] = TRUE
293
+ end
294
+
279
295
  options[:html] = FALSE
280
296
  opts.on("-H", "--html", "Make a workflow execution full report in html format") do |opt|
281
297
  options[:html] = TRUE
@@ -310,6 +326,6 @@ else
310
326
  elsif options[:html]
311
327
  report_html(log, attribs)
312
328
  elsif options[:workflow_status] && options[:launch_failed_jobs]
313
- launch_failed_jobs(log, attribs, options[:workflow_execution], options[:batch])
329
+ launch_failed_jobs(log, attribs, options[:workflow_execution], options[:batch], options[:pending])
314
330
  end
315
331
  end
@@ -174,6 +174,7 @@ class Batch
174
174
  resources_line = nil
175
175
  command.each_line do |line|
176
176
  if line.include?('resources:')
177
+ line = line.chomp
177
178
  resources_line = line
178
179
  fields = line.split(' ')
179
180
  fields.each_with_index do |field, index|
@@ -7,6 +7,7 @@ class QueueManager
7
7
  @commands = commands
8
8
  @persist_variables = persist_variables
9
9
  @verbose = options[:verbose]
10
+ @show_submit = options[:show_submit_command]
10
11
  @job_identifier = options[:identifier]
11
12
  @files = {}
12
13
  @remote = options[:remote]
@@ -20,6 +20,7 @@ class SlurmManager < QueueManager
20
20
  dependencies = nil
21
21
  dependencies='--dependency=afterok:'+final_dep.join(':') if !final_dep.empty?
22
22
  cmd = "sbatch #{dependencies} #{job.name}.sh"
23
+ STDOUT.puts cmd if @show_submit
23
24
  queue_id = get_queue_system_id(system_call(cmd, job.attrib[:exec_folder]))
24
25
  return queue_id
25
26
  end
@@ -1,3 +1,3 @@
1
1
  module Autoflow
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.4"
3
3
  end
metadata CHANGED
@@ -1,113 +1,100 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
5
- prerelease:
4
+ version: 0.8.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Pedro Seoane
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2017-01-25 00:00:00.000000000 Z
11
+ date: 2017-07-27 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: net-ssh
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: 2.8.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: 2.8.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: git
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: 1.3.0
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: 1.3.0
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: colorize
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ~>
45
+ - - "~>"
52
46
  - !ruby/object:Gem::Version
53
47
  version: 0.7.3
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ~>
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
54
  version: 0.7.3
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: terminal-table
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ~>
59
+ - - "~>"
68
60
  - !ruby/object:Gem::Version
69
61
  version: 1.6.0
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ~>
66
+ - - "~>"
76
67
  - !ruby/object:Gem::Version
77
68
  version: 1.6.0
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: bundler
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ~>
73
+ - - "~>"
84
74
  - !ruby/object:Gem::Version
85
75
  version: '1.3'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ~>
80
+ - - "~>"
92
81
  - !ruby/object:Gem::Version
93
82
  version: '1.3'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rake
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
- description: ! '"Autoflow makes easy to launch big pipelines on a queue system. Only
97
+ description: '"Autoflow makes easy to launch big pipelines on a queue system. Only
111
98
  works with SLURM & PBS"'
112
99
  email:
113
100
  - seoanezonjic@hotmail.com
@@ -119,7 +106,7 @@ executables:
119
106
  extensions: []
120
107
  extra_rdoc_files: []
121
108
  files:
122
- - .gitignore
109
+ - ".gitignore"
123
110
  - Gemfile
124
111
  - LICENSE.txt
125
112
  - README.md
@@ -143,28 +130,27 @@ files:
143
130
  homepage: ''
144
131
  licenses:
145
132
  - MIT
133
+ metadata: {}
146
134
  post_install_message:
147
135
  rdoc_options: []
148
136
  require_paths:
149
137
  - lib
150
138
  required_ruby_version: !ruby/object:Gem::Requirement
151
- none: false
152
139
  requirements:
153
- - - ! '>='
140
+ - - ">="
154
141
  - !ruby/object:Gem::Version
155
142
  version: '0'
156
143
  required_rubygems_version: !ruby/object:Gem::Requirement
157
- none: false
158
144
  requirements:
159
- - - ! '>='
145
+ - - ">="
160
146
  - !ruby/object:Gem::Version
161
147
  version: '0'
162
148
  requirements: []
163
149
  rubyforge_project:
164
- rubygems_version: 1.8.23
150
+ rubygems_version: 2.4.8
165
151
  signing_key:
166
- specification_version: 3
167
- summary: ! '"This gem take a pipeline and launch it on a queue system"'
152
+ specification_version: 4
153
+ summary: '"This gem take a pipeline and launch it on a queue system"'
168
154
  test_files:
169
155
  - test/stack_test.rb
170
156
  - test/test_helper.rb