ood_core 0.23.0 → 0.23.1
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 +4 -4
- data/CHANGELOG.md +12 -1
- data/lib/ood_core/data_formatter.rb +14 -0
- data/lib/ood_core/job/account_info.rb +3 -1
- data/lib/ood_core/job/adapters/helper.rb +0 -11
- data/lib/ood_core/job/adapters/slurm.rb +2 -2
- data/lib/ood_core/job/queue_info.rb +14 -2
- data/lib/ood_core/job/script.rb +1 -0
- data/lib/ood_core/version.rb +1 -1
- data/lib/ood_core.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd8cb5dc98cf0b2c2120fdb6234e5482fb40cbec59f6688318e0d33b050d0dc4
|
4
|
+
data.tar.gz: 0fe72b2fe29aa1e4ca2d5e28ca43e8b3f9e0381fe17f4678ea7218a5c062a3e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53bd81e896ae96b55e92732b86d9ca364449f8140bedbaba0b6fc9de73d5ffb06e65ea9ba84cc84e621bbf64af5b30a241a803b7fb4944745ebb50cc2a6ba39f
|
7
|
+
data.tar.gz: 9106dbc505aff7040bedeba9c0531cd539dbcd11e3aac54072e7bc01660f8f07147fb19be325631496215b6c1725bb68ca57968b39e377b0567747ef5569563c
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.23.1] - 02-01-2023
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
|
14
|
+
- `QueueInfo` objects also upcase accounts when applicable in [792](https://github.com/OSC/ood_core/pull/792).
|
15
|
+
|
16
|
+
### Added
|
17
|
+
|
18
|
+
- `queue_name` has the alias `queue` in [790](https://github.com/OSC/ood_core/pull/790).
|
19
|
+
|
10
20
|
## [0.23.0] - 01-17-2023
|
11
21
|
|
12
22
|
### Added
|
@@ -469,7 +479,8 @@ Functionally the same as [0.17.3] but with some CI updates.
|
|
469
479
|
### Added
|
470
480
|
- Initial release!
|
471
481
|
|
472
|
-
[Unreleased]: https://github.com/OSC/ood_core/compare/v0.23.
|
482
|
+
[Unreleased]: https://github.com/OSC/ood_core/compare/v0.23.1...HEAD
|
483
|
+
[0.23.1]: https://github.com/OSC/ood_core/compare/v0.22.0...v0.23.0
|
473
484
|
[0.23.0]: https://github.com/OSC/ood_core/compare/v0.22.0...v0.23.0
|
474
485
|
[0.22.0]: https://github.com/OSC/ood_core/compare/v0.21.0...v0.22.0
|
475
486
|
[0.21.0]: https://github.com/OSC/ood_core/compare/v0.20.2...v0.21.0
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module OodCore
|
2
|
+
module DataFormatter
|
3
|
+
# Determine whether to upcase account strings when returning adapter#accounts
|
4
|
+
def upcase_accounts?
|
5
|
+
env_var = ENV['OOD_UPCASE_ACCOUNTS']
|
6
|
+
|
7
|
+
if env_var.nil? || env_var.to_s.downcase == 'false'
|
8
|
+
false
|
9
|
+
else
|
10
|
+
true
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -3,6 +3,8 @@ module OodCore
|
|
3
3
|
|
4
4
|
class AccountInfo
|
5
5
|
|
6
|
+
include OodCore::DataFormatter
|
7
|
+
|
6
8
|
# The name of the account.
|
7
9
|
attr_reader :name
|
8
10
|
alias to_s name
|
@@ -19,7 +21,7 @@ module OodCore
|
|
19
21
|
|
20
22
|
def initialize(**opts)
|
21
23
|
orig_name = opts.fetch(:name, 'unknown')
|
22
|
-
@name =
|
24
|
+
@name = upcase_accounts? ? orig_name.upcase : orig_name
|
23
25
|
@qos = opts.fetch(:qos, [])
|
24
26
|
@cluster = opts.fetch(:cluster, nil)
|
25
27
|
@queue = opts.fetch(:queue, nil)
|
@@ -31,17 +31,6 @@ module OodCore
|
|
31
31
|
|
32
32
|
return 'ssh', args + [cmd] + cmd_args
|
33
33
|
end
|
34
|
-
|
35
|
-
# Determine whether to upcase account strings when returning adapter#accounts
|
36
|
-
def self.upcase_accounts?
|
37
|
-
env_var = ENV['OOD_UPCASE_ACCOUNTS']
|
38
|
-
|
39
|
-
if env_var.nil? || env_var.to_s.downcase == 'false'
|
40
|
-
false
|
41
|
-
else
|
42
|
-
true
|
43
|
-
end
|
44
|
-
end
|
45
34
|
end
|
46
35
|
end
|
47
36
|
end
|
@@ -186,13 +186,13 @@ module OodCore
|
|
186
186
|
[].tap do |accts|
|
187
187
|
call('sacctmgr', *args).each_line do |line|
|
188
188
|
acct, cluster, queue, qos = line.split('|')
|
189
|
-
next if acct.nil?
|
189
|
+
next if acct.nil? || acct.chomp.empty?
|
190
190
|
|
191
191
|
args = {
|
192
192
|
name: acct,
|
193
193
|
qos: qos.to_s.chomp.split(','),
|
194
194
|
cluster: cluster,
|
195
|
-
queue: queue.empty? ? nil : queue
|
195
|
+
queue: queue.to_s.empty? ? nil : queue
|
196
196
|
}
|
197
197
|
info = OodCore::Job::AccountInfo.new(**args) unless acct.nil?
|
198
198
|
accts << info unless acct.nil?
|
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
# QueueInfo is information about a given queue on a scheduler.
|
4
4
|
class OodCore::Job::QueueInfo
|
5
|
+
|
6
|
+
include OodCore::DataFormatter
|
7
|
+
|
5
8
|
# The name of the queue.
|
6
9
|
attr_reader :name
|
7
10
|
alias to_s name
|
@@ -20,8 +23,17 @@ class OodCore::Job::QueueInfo
|
|
20
23
|
def initialize(**opts)
|
21
24
|
@name = opts.fetch(:name, 'unknown')
|
22
25
|
@qos = opts.fetch(:qos, [])
|
23
|
-
|
24
|
-
|
26
|
+
|
27
|
+
allow_accounts = opts.fetch(:allow_accounts, nil)
|
28
|
+
@allow_accounts = if allow_accounts.nil?
|
29
|
+
nil
|
30
|
+
else
|
31
|
+
allow_accounts.compact.map { |acct| upcase_accounts? ? acct.to_s.upcase : acct }
|
32
|
+
end
|
33
|
+
|
34
|
+
@deny_accounts = opts.fetch(:deny_accounts, []).compact.map do |acct|
|
35
|
+
upcase_accounts? ? acct.to_s.upcase : acct
|
36
|
+
end
|
25
37
|
end
|
26
38
|
|
27
39
|
def to_h
|
data/lib/ood_core/job/script.rb
CHANGED
data/lib/ood_core/version.rb
CHANGED
data/lib/ood_core.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ood_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.23.
|
4
|
+
version: 0.23.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Franz
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-01
|
13
|
+
date: 2023-02-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: ood_support
|
@@ -176,6 +176,7 @@ files:
|
|
176
176
|
- lib/ood_core/batch_connect/templates/vnc_container.rb
|
177
177
|
- lib/ood_core/cluster.rb
|
178
178
|
- lib/ood_core/clusters.rb
|
179
|
+
- lib/ood_core/data_formatter.rb
|
179
180
|
- lib/ood_core/errors.rb
|
180
181
|
- lib/ood_core/invalid_cluster.rb
|
181
182
|
- lib/ood_core/job/account_info.rb
|