ood_core 0.3.0 → 0.4.0

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
  SHA1:
3
- metadata.gz: cc6dd320e10be434a6689cf286a0250e639ae82a
4
- data.tar.gz: cfaa8e4bad41f728f6bf08e6db0bea634dca9e4b
3
+ metadata.gz: cdde96a0722a74c2029aa85fec797955c26af463
4
+ data.tar.gz: 565037a93bc40bb5c03040b72474d1bf120cb611
5
5
  SHA512:
6
- metadata.gz: 60f7e34ded14e2ed6aba02a850d2157c90b73347e1846c69e18a663dde3992e80a71d90be7a1c1dac4b895c007b1d5cf062f54a08913e18bd67de864088278db
7
- data.tar.gz: c2927b9f0342ec93462e74f04d806b9359780949bb99f6af8e304e3c1da5c72fe27d77ebfdb575686012f04067c8d927e6914bf452d3fc5c7fffb6736f774a19
6
+ metadata.gz: a4d0b4338925e8ed5dd26a55cc589cfc9ef9bd3dbe435457ea8c18a59ec8cc608affb102751acc6a719b365bdf2e4d3c92881733f34c10fd60f120f3f4e282a3
7
+ data.tar.gz: d0d6ac85526748c9bfb81582877b01749b27f8f754abc6fd4e89cf64ba7156f084a3533c95ca5b8b16613ad8a2f130b842dca563874e8a4d56c0d9d69a0b8bf0
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.0] - 2018-04-20
11
+ ### Changed
12
+ - Updated Torque adapter to take into account the new `Script#native` format
13
+ allowing for arrays. [#65](https://github.com/OSC/ood_core/issues/65)
14
+
10
15
  ## [0.3.0] - 2018-04-05
11
16
  ### Added
12
17
  - Basic multi-cluster support for LSF by specifying name of cluster for -m
@@ -112,7 +117,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
112
117
  ### Added
113
118
  - Initial release!
114
119
 
115
- [Unreleased]: https://github.com/OSC/ood_core/compare/v0.3.0...HEAD
120
+ [Unreleased]: https://github.com/OSC/ood_core/compare/v0.4.0...HEAD
121
+ [0.4.0]: https://github.com/OSC/ood_core/compare/v0.3.0...v0.4.0
116
122
  [0.3.0]: https://github.com/OSC/ood_core/compare/v0.2.1...v0.3.0
117
123
  [0.2.1]: https://github.com/OSC/ood_core/compare/v0.2.0...v0.2.1
118
124
  [0.2.0]: https://github.com/OSC/ood_core/compare/v0.1.1...v0.2.0
@@ -71,54 +71,94 @@ module OodCore
71
71
  afternotok = Array(afternotok).map(&:to_s)
72
72
  afterany = Array(afterany).map(&:to_s)
73
73
 
74
- # Set headers
75
- headers = {}
76
- headers.merge!(job_arguments: script.args.join(' ')) unless script.args.nil?
77
- headers.merge!(Hold_Types: :u) if script.submit_as_hold
78
- headers.merge!(Rerunable: script.rerunnable ? 'y' : 'n') unless script.rerunnable.nil?
79
- headers.merge!(init_work_dir: script.workdir) unless script.workdir.nil?
80
- headers.merge!(Mail_Users: script.email.join(',')) unless script.email.nil?
81
- mail_points = ''
82
- mail_points += 'b' if script.email_on_started
83
- mail_points += 'e' if script.email_on_terminated
84
- headers.merge!(Mail_Points: mail_points) unless mail_points.empty?
85
- headers.merge!(Job_Name: script.job_name) unless script.job_name.nil?
86
- headers.merge!(Shell_Path_List: script.shell_path) unless script.shell_path.nil?
87
- # ignore input_path (not defined in Torque)
88
- headers.merge!(Output_Path: script.output_path) unless script.output_path.nil?
89
- headers.merge!(Error_Path: script.error_path) unless script.error_path.nil?
90
- # If error_path is not specified we join stdout & stderr (as this
91
- # mimics what the other resource managers do)
92
- headers.merge!(Join_Path: 'oe') if script.error_path.nil?
93
- headers.merge!(reservation_id: script.reservation_id) unless script.reservation_id.nil?
94
- headers.merge!(Priority: script.priority) unless script.priority.nil?
95
- headers.merge!(Execution_Time: script.start_time.localtime.strftime("%C%y%m%d%H%M.%S")) unless script.start_time.nil?
96
- headers.merge!(Account_Name: script.accounting_id) unless script.accounting_id.nil?
97
-
98
74
  # Set dependencies
99
75
  depend = []
100
76
  depend << "after:#{after.join(':')}" unless after.empty?
101
77
  depend << "afterok:#{afterok.join(':')}" unless afterok.empty?
102
78
  depend << "afternotok:#{afternotok.join(':')}" unless afternotok.empty?
103
79
  depend << "afterany:#{afterany.join(':')}" unless afterany.empty?
104
- headers.merge!(depend: depend.join(',')) unless depend.empty?
105
80
 
106
- # Set resources
107
- resources = {}
108
- resources.merge!(walltime: seconds_to_duration(script.wall_time)) unless script.wall_time.nil?
81
+ # Set mailing options
82
+ mail_points = ""
83
+ mail_points += "b" if script.email_on_started
84
+ mail_points += "e" if script.email_on_terminated
109
85
 
110
- # Set environment variables
111
- envvars = script.job_environment || {}
86
+ # FIXME: Remove the Hash option once all Interactive Apps are
87
+ # converted to Array format
88
+ if script.native.is_a?(Hash)
89
+ # Set headers
90
+ headers = {}
91
+ headers.merge!(job_arguments: script.args.join(' ')) unless script.args.nil?
92
+ headers.merge!(Hold_Types: :u) if script.submit_as_hold
93
+ headers.merge!(Rerunable: script.rerunnable ? 'y' : 'n') unless script.rerunnable.nil?
94
+ headers.merge!(init_work_dir: script.workdir) unless script.workdir.nil?
95
+ headers.merge!(Mail_Users: script.email.join(',')) unless script.email.nil?
96
+ headers.merge!(Mail_Points: mail_points) unless mail_points.empty?
97
+ headers.merge!(Job_Name: script.job_name) unless script.job_name.nil?
98
+ headers.merge!(Shell_Path_List: script.shell_path) unless script.shell_path.nil?
99
+ # ignore input_path (not defined in Torque)
100
+ headers.merge!(Output_Path: script.output_path) unless script.output_path.nil?
101
+ headers.merge!(Error_Path: script.error_path) unless script.error_path.nil?
102
+ # If error_path is not specified we join stdout & stderr (as this
103
+ # mimics what the other resource managers do)
104
+ headers.merge!(Join_Path: 'oe') if script.error_path.nil?
105
+ headers.merge!(reservation_id: script.reservation_id) unless script.reservation_id.nil?
106
+ headers.merge!(Priority: script.priority) unless script.priority.nil?
107
+ headers.merge!(Execution_Time: script.start_time.localtime.strftime("%C%y%m%d%H%M.%S")) unless script.start_time.nil?
108
+ headers.merge!(Account_Name: script.accounting_id) unless script.accounting_id.nil?
109
+ headers.merge!(depend: depend.join(',')) unless depend.empty?
112
110
 
113
- # Set native options
114
- if script.native
115
- headers.merge! script.native.fetch(:headers, {})
116
- resources.merge! script.native.fetch(:resources, {})
117
- envvars.merge! script.native.fetch(:envvars, {})
118
- end
111
+ # Set resources
112
+ resources = {}
113
+ resources.merge!(walltime: seconds_to_duration(script.wall_time)) unless script.wall_time.nil?
114
+
115
+ # Set environment variables
116
+ envvars = script.job_environment || {}
117
+
118
+ # Set native options
119
+ if script.native
120
+ headers.merge! script.native.fetch(:headers, {})
121
+ resources.merge! script.native.fetch(:resources, {})
122
+ envvars.merge! script.native.fetch(:envvars, {})
123
+ end
119
124
 
120
- # Submit job
121
- @pbs.submit_string(script.content, queue: script.queue_name, headers: headers, resources: resources, envvars: envvars)
125
+ # Submit job
126
+ @pbs.submit_string(script.content, queue: script.queue_name, headers: headers, resources: resources, envvars: envvars)
127
+ else
128
+ # Set qsub arguments
129
+ args = []
130
+ args += ["-F", script.args.join(" ")] unless script.args.nil?
131
+ args += ["-h"] if script.submit_as_hold
132
+ args += ["-r", script.rerunnable ? "y" : "n"] unless script.rerunnable.nil?
133
+ args += ["-M", script.email.join(",")] unless script.email.nil?
134
+ args += ["-m", mail_points] unless mail_points.empty?
135
+ args += ["-N", script.job_name] unless script.job_name.nil?
136
+ args += ["-S", script.shell_path] unless script.shell_path.nil?
137
+ # ignore input_path (not defined in Torque)
138
+ args += ["-o", script.output_path] unless script.output_path.nil?
139
+ args += ["-e", script.error_path] unless script.error_path.nil?
140
+ args += ["-W", "x=advres:#{script.reservation_id}"] unless script.reservation_id.nil?
141
+ args += ["-q", script.queue_name] unless script.queue_name.nil?
142
+ args += ["-p", script.priority] unless script.priority.nil?
143
+ args += ["-a", script.start_time.localtime.strftime("%C%y%m%d%H%M.%S")] unless script.start_time.nil?
144
+ args += ["-A", script.accounting_id] unless script.accounting_id.nil?
145
+ args += ["-W", "depend=#{depend.join(",")}"] unless depend.empty?
146
+ args += ["-l", "walltime=#{seconds_to_duration(script.wall_time)}"] unless script.wall_time.nil?
147
+
148
+ # Set environment variables
149
+ env = script.job_environment.to_h
150
+ args += ["-v", env.keys.join(",")] unless env.empty?
151
+
152
+ # If error_path is not specified we join stdout & stderr (as this
153
+ # mimics what the other resource managers do)
154
+ args += ["-j", "oe"] if script.error_path.nil?
155
+
156
+ # Set native options
157
+ args += script.native if script.native
158
+
159
+ # Submit job
160
+ @pbs.submit(script.content, args: args, env: env, chdir: script.workdir)
161
+ end
122
162
  rescue PBS::Error => e
123
163
  raise JobAdapterError, e.message
124
164
  end
@@ -1,4 +1,4 @@
1
1
  module OodCore
2
2
  # The current version of {OodCore}
3
- VERSION = "0.3.0"
3
+ VERSION = "0.4.0"
4
4
  end
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.required_ruby_version = ">= 2.2.0"
24
24
 
25
25
  spec.add_runtime_dependency "ood_support", "~> 0.0.2"
26
- spec.add_development_dependency "pbs", "~> 2.1", ">= 2.1.0"
26
+ spec.add_development_dependency "pbs", "~> 2.1", ">= 2.2.0"
27
27
  spec.add_development_dependency "bundler", "~> 1.7"
28
28
  spec.add_development_dependency "rake", "~> 10.0"
29
29
  spec.add_development_dependency "rspec", "~> 3.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ood_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Nicklas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-05 00:00:00.000000000 Z
11
+ date: 2018-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ood_support
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '2.1'
34
34
  - - ">="
35
35
  - !ruby/object:Gem::Version
36
- version: 2.1.0
36
+ version: 2.2.0
37
37
  type: :development
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '2.1'
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 2.1.0
46
+ version: 2.2.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
49
  requirement: !ruby/object:Gem::Requirement