ood_core 0.23.0 → 0.23.2

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
  SHA256:
3
- metadata.gz: 379d230153e94bdbeca027f601afc89a525b328d8e200cc1a6a18754b3370b88
4
- data.tar.gz: 5544e85c81b6e955a63144a056eee24d6bd5ec062de4d17a535d9df78eb5a817
3
+ metadata.gz: 9864509d310ba9c2fc6f896595f62e429be829107029a81e91251d10abfd16e7
4
+ data.tar.gz: 3f71fbe1c5502068d39f2cba7971e5055a1a64818248df3dab486761357a3c4c
5
5
  SHA512:
6
- metadata.gz: 972cabe2a634f50b730e29d31a54e34c2784ea707fd562b867c8f8731e4d612bd39fd8bcacb84b49585a08131d4f9e3770195f2c1c6036fde52ff4e3d4f7124c
7
- data.tar.gz: 4a0997de2400017ad8a921358b76341706cd4e58034c881dd8b9dfe63e9d9b7c559c42ed711a13051cd5168dde6703164714d22ee1e8ae2d7980fa33d2da3e4c
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.0...HEAD
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 = OodCore::Job::Adapters::Helper.upcase_accounts? ? orig_name.upcase : orig_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
- @allow_accounts = opts.fetch(:allow_accounts, nil)
24
- @deny_accounts = opts.fetch(:deny_accounts, [])
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
@@ -77,6 +77,7 @@ module OodCore
77
77
  # Name of the queue the job should be submitted to
78
78
  # @return [String, nil] queue name
79
79
  attr_reader :queue_name
80
+ alias queue queue_name
80
81
 
81
82
  # The scheduling priority for the job
82
83
  # @return [Integer, nil] scheduling priority
@@ -1,4 +1,4 @@
1
1
  module OodCore
2
2
  # The current version of {OodCore}
3
- VERSION = "0.23.0"
3
+ VERSION = "0.23.2"
4
4
  end
data/lib/ood_core.rb CHANGED
@@ -3,6 +3,7 @@ require "ood_core/errors"
3
3
  require "ood_core/cluster"
4
4
  require "ood_core/clusters"
5
5
  require "ood_core/invalid_cluster"
6
+ require "ood_core/data_formatter"
6
7
 
7
8
  # The main namespace for ood_core
8
9
  module OodCore
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.0
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-01-18 00:00:00.000000000 Z
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