ood_core 0.23.0 → 0.23.2
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 +20 -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/linux_host/launcher.rb +1 -1
- 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: 9864509d310ba9c2fc6f896595f62e429be829107029a81e91251d10abfd16e7
|
4
|
+
data.tar.gz: 3f71fbe1c5502068d39f2cba7971e5055a1a64818248df3dab486761357a3c4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ae243f303ccd6910a73009538e59c56a071b742f002182a14bc667006831e5993552bfc662363083db8144c34cd0f1310aff947d1db1f158c3c43f54a14be0f
|
7
|
+
data.tar.gz: 61581da1191e92f68fadf2735bb05570be7297ee5e0769f20dafb2d6dceda8a5d644ab2b582fd117f2d028a0db9c45d2015e930aaa8b70420c82d5c1a3e81e06
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.23.2] - 02-02-2023
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
|
14
|
+
- The linux host adapter should correctly extract the full apptainer pid in [794](https://github.com/OSC/ood_core/pull/794).
|
15
|
+
|
16
|
+
|
17
|
+
## [0.23.1] - 02-01-2023
|
18
|
+
|
19
|
+
### Fixed
|
20
|
+
|
21
|
+
- `QueueInfo` objects also upcase accounts when applicable in [792](https://github.com/OSC/ood_core/pull/792).
|
22
|
+
|
23
|
+
### Added
|
24
|
+
|
25
|
+
- `queue_name` has the alias `queue` in [790](https://github.com/OSC/ood_core/pull/790).
|
26
|
+
|
10
27
|
## [0.23.0] - 01-17-2023
|
11
28
|
|
12
29
|
### Added
|
@@ -469,7 +486,9 @@ Functionally the same as [0.17.3] but with some CI updates.
|
|
469
486
|
### Added
|
470
487
|
- Initial release!
|
471
488
|
|
472
|
-
[Unreleased]: https://github.com/OSC/ood_core/compare/v0.23.
|
489
|
+
[Unreleased]: https://github.com/OSC/ood_core/compare/v0.23.2...HEAD
|
490
|
+
[0.23.2]: https://github.com/OSC/ood_core/compare/v0.23.1...v0.23.2
|
491
|
+
[0.23.1]: https://github.com/OSC/ood_core/compare/v0.23.0...v0.23.1
|
473
492
|
[0.23.0]: https://github.com/OSC/ood_core/compare/v0.22.0...v0.23.0
|
474
493
|
[0.22.0]: https://github.com/OSC/ood_core/compare/v0.21.0...v0.22.0
|
475
494
|
[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
|
@@ -73,7 +73,7 @@ class OodCore::Job::Adapters::LinuxHost::Launcher
|
|
73
73
|
# Get the tmux pane PID for the target session
|
74
74
|
pane_pid=$(tmux list-panes -aF '\#{session_name} \#{pane_pid}' | grep '#{session_name}' | cut -f 2 -d ' ')
|
75
75
|
# Find the Singularity sinit PID child of the pane process
|
76
|
-
pane_sinit_pid=$(pstree -p -l "$pane_pid" | egrep -o 'sinit[(][[:digit:]]*|shim-init[(][[:digit:]]|appinit[(][[:digit:]]' | grep -o '[[:digit:]]*')
|
76
|
+
pane_sinit_pid=$(pstree -p -l "$pane_pid" | egrep -o 'sinit[(][[:digit:]]*|shim-init[(][[:digit:]]|appinit[(][[:digit:]]*' | grep -o '[[:digit:]]*')
|
77
77
|
# Kill sinit which stops both Singularity-based processes and the tmux session
|
78
78
|
kill "$pane_sinit_pid"
|
79
79
|
SCRIPT
|
@@ -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.2
|
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-
|
13
|
+
date: 2023-02-02 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
|