pbs 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +5 -1
- data/lib/pbs/batch.rb +12 -32
- data/lib/pbs/version.rb +1 -1
- data/pbs.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c42c7352f3bed19c09615d1478787d9a806c1231
|
4
|
+
data.tar.gz: e97cd9bbecb3f5c3cc032a8c6d98eda8e48228b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c54720352ae8cb8fa44a2c00738bfba451cdfebad7d73b00a310e5e88d6083bd6db9271dccb48918ba64df9b3dd8083101125fafa5fc0a30264f1f31ca3df89e
|
7
|
+
data.tar.gz: a50902c7b82d77d6e17d502b6f19e7a6aa36f346478831728b5edea822aaebb01c7740cf860bf16b737539382ea4b4d610df983cd820e6b0403913dcd28ee81c
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -27,7 +27,11 @@ installation as:
|
|
27
27
|
|
28
28
|
```ruby
|
29
29
|
# Create new batch object for OSC's Oakley batch server
|
30
|
-
oakley = PBS::Batch.new(
|
30
|
+
oakley = PBS::Batch.new(
|
31
|
+
host: 'oak-batch.osc.edu',
|
32
|
+
lib: '/usr/local/torque/default/lib',
|
33
|
+
bin: '/usr/local/torque/bin'
|
34
|
+
)
|
31
35
|
|
32
36
|
# Get status information for this batch server
|
33
37
|
# see http://linux.die.net/man/7/pbs_server_attributes
|
data/lib/pbs/batch.rb
CHANGED
@@ -13,41 +13,21 @@ module PBS
|
|
13
13
|
# @example For Torque 5.0.0
|
14
14
|
# my_conn.lib.to_s #=> "/usr/local/torque/5.0.0/lib"
|
15
15
|
# @return [Pathname] path to torque libraries
|
16
|
-
|
17
|
-
@lib ||=
|
18
|
-
if @prefix.join('lib').directory?
|
19
|
-
@prefix.join('lib')
|
20
|
-
elsif @prefix.join('lib32').directory?
|
21
|
-
@prefix.join('lib32')
|
22
|
-
elsif @prefix.join('lib64').directory?
|
23
|
-
@prefix.join('lib64')
|
24
|
-
else
|
25
|
-
@prefix
|
26
|
-
end
|
27
|
-
end
|
16
|
+
attr_reader :lib
|
28
17
|
|
29
18
|
# The path to the Torque client installation binaries
|
30
19
|
# @example For Torque 5.0.0
|
31
20
|
# my_conn.bin.to_s #=> "/usr/local/torque/5.0.0/bin"
|
32
21
|
# @return [Pathname] path to torque binaries
|
33
|
-
|
34
|
-
@bin ||=
|
35
|
-
if @prefix.join('bin').directory?
|
36
|
-
@prefix.join('bin')
|
37
|
-
else
|
38
|
-
@prefix
|
39
|
-
end
|
40
|
-
end
|
22
|
+
attr_reader :bin
|
41
23
|
|
42
24
|
# @param host [#to_s] the batch server host
|
43
|
-
# @param
|
44
|
-
# @param
|
45
|
-
|
46
|
-
def initialize(host:, prefix: '', lib: nil, bin: nil, **_)
|
25
|
+
# @param lib [#to_s] path to torque installation libraries
|
26
|
+
# @param bin [#to_s] path to torque installation binaries
|
27
|
+
def initialize(host:, lib: "", bin: "", **_)
|
47
28
|
@host = host.to_s
|
48
|
-
@
|
49
|
-
@
|
50
|
-
@bin = Pathname.new(bin) if bin
|
29
|
+
@lib = Pathname.new(lib.to_s)
|
30
|
+
@bin = Pathname.new(bin.to_s)
|
51
31
|
end
|
52
32
|
|
53
33
|
# Convert object to hash
|
@@ -252,7 +232,7 @@ module PBS
|
|
252
232
|
# @example Put job '10219837.oak-batch.osc.edu' on hold
|
253
233
|
# my_conn.hold_job('10219837.oak-batch.osc.edu')
|
254
234
|
# @param id [#to_s] the id of the job
|
255
|
-
# @param type [
|
235
|
+
# @param type [#to_s] type of hold to be applied
|
256
236
|
# @return [void]
|
257
237
|
def hold_job(id, type: :u)
|
258
238
|
connect do |cid|
|
@@ -268,7 +248,7 @@ module PBS
|
|
268
248
|
# @example Release job '10219837.oak-batch.osc.edu' from hold
|
269
249
|
# my_conn.release_job('10219837.oak-batch.osc.edu')
|
270
250
|
# @param id [#to_s] the id of the job
|
271
|
-
# @param type [
|
251
|
+
# @param type [#to_s] type of hold to be removed
|
272
252
|
# @return [void]
|
273
253
|
def release_job(id, type: :u)
|
274
254
|
connect do |cid|
|
@@ -311,7 +291,7 @@ module PBS
|
|
311
291
|
# @param qsub [Boolean] whether use library or binary for submission
|
312
292
|
# @return [String] the id of the job that was created
|
313
293
|
def submit_script(script, queue: nil, headers: {}, resources: {}, envvars: {}, qsub: true)
|
314
|
-
send(qsub ? :qsub_submit : :pbs_submit, script, queue, headers, resources, envvars)
|
294
|
+
send(qsub ? :qsub_submit : :pbs_submit, script.to_s, queue.to_s, headers, resources, envvars)
|
315
295
|
end
|
316
296
|
|
317
297
|
# Submit a script expanded into a string to the batch server
|
@@ -335,7 +315,7 @@ module PBS
|
|
335
315
|
|
336
316
|
connect do |cid|
|
337
317
|
attropl = Torque::Attropl.from_hash attribs
|
338
|
-
Torque.pbs_submit cid, attropl, script
|
318
|
+
Torque.pbs_submit cid, attropl, script, queue, nil
|
339
319
|
end
|
340
320
|
end
|
341
321
|
|
@@ -352,7 +332,7 @@ module PBS
|
|
352
332
|
["-W", "#{k}=#{v}"]
|
353
333
|
end
|
354
334
|
end.flatten
|
355
|
-
params << script
|
335
|
+
params << script
|
356
336
|
|
357
337
|
env = {
|
358
338
|
"LD_LIBRARY_PATH" => "#{lib}:#{ENV['LD_LIBRARY_PATH']}"
|
data/lib/pbs/version.rb
CHANGED
data/pbs.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ["lib"]
|
21
|
-
spec.required_ruby_version = '
|
21
|
+
spec.required_ruby_version = '>= 2.2.0'
|
22
22
|
|
23
23
|
spec.add_runtime_dependency "ffi", "~> 1.9", ">= 1.9.6"
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.7"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pbs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Nicklas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -89,9 +89,9 @@ require_paths:
|
|
89
89
|
- lib
|
90
90
|
required_ruby_version: !ruby/object:Gem::Requirement
|
91
91
|
requirements:
|
92
|
-
- - "
|
92
|
+
- - ">="
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
version:
|
94
|
+
version: 2.2.0
|
95
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
96
|
requirements:
|
97
97
|
- - ">="
|