ood_core 0.30.1 → 0.30.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98cdd24e7d7a73ee1d0dff56b013fdc3a924197ae7dc168e0b7c940c134d99ab
4
- data.tar.gz: b22aa4d3199bf0c7865d934aad23c5f5b9a358f19a6eebe77490076234e20461
3
+ metadata.gz: 6c188ef55a7fe689c68f86496f02753ef7c985fa371dce0674a85fe03c0a27b4
4
+ data.tar.gz: 0c52db6c183bb72280eebaf8df073d5cd4c4fcd27b4e3b8cf1683868ef0ce63e
5
5
  SHA512:
6
- metadata.gz: bffd4cbfae260072fc1dfdbef4979932bafcf67946d57ffc9a4afd47e5f21eaf68cb9fecd88e3a1eb1989d5e5274145ddbd025a822e5fb378818c7160702b841
7
- data.tar.gz: 893d3473c5bd0e87ed93ec5e0d131175bb92b78f381d732a14e62ecd4eeef2198db4d3f0574c7261dbd1c637bcc3494473df29f2bc4ceecdbfcf3142084ede1d
6
+ metadata.gz: bd8514abfa7da8ff2d66a13f65b50516c6123946ab8d5a53f792885bb692a86dcd1e82ea9e9e0d765b841e052804afeb6e02dbc4b4a84d06bc552e463feb2885
7
+ data.tar.gz: 22be9eb7a865c2504790298f4fb9658f91fcaba270bf68c614f30f77386333ecd9ba9f07dc8bf27345387f0581a2011fc5ee647ea3cd2f8fc21141ff8b63325d
@@ -97,6 +97,7 @@ class OpenStackCredentials < CredentialsInterface
97
97
  credentials_to_destroy.destroy
98
98
  rescue Excon::Error::Forbidden => e
99
99
  puts "Error destroying application credentials with id #{os_app_credentials['id']} #{e}"
100
+ raise JobAdapterError, e.message
100
101
  end
101
102
  end
102
103
 
@@ -115,4 +116,4 @@ class OpenStackCredentials < CredentialsInterface
115
116
  def find_os_application_credentials(connection, os_app_credentials)
116
117
  connection.application_credentials.find_by_id(os_app_credentials['id'], os_app_credentials['user_id'])
117
118
  end
118
- end
119
+ end
@@ -79,10 +79,7 @@ module OodCore
79
79
  # adapters can get by without populating the entire Info object
80
80
  # @return [Array<Info>] information describing submitted jobs
81
81
  def info_all(attrs: nil)
82
- # TODO - implement info all for namespaces?
83
- batch.method_missing(attrs: attrs)
84
- rescue Batch::Error => e
85
- raise JobAdapterError, e.message
82
+ raise NotImplementedError, 'subclass did not define #info_all'
86
83
  end
87
84
 
88
85
  # Whether the adapter supports job arrays
@@ -125,4 +122,4 @@ module OodCore
125
122
  end
126
123
  end
127
124
  end
128
- end
125
+ end
@@ -121,19 +121,28 @@ module OodCore
121
121
  # Get a ClusterInfo object containing information about the given cluster
122
122
  # @return [ClusterInfo] object containing cluster details
123
123
  def get_cluster_info
124
- node_cpu_info = call("sinfo", "-aho %A/%D/%C").strip.split('/')
124
+ node_cpu_info = call("sinfo", "-aho %F/%C").strip.split('/').map(&:to_i)
125
125
  gres_length = call("sinfo", "-o %G").lines.map(&:strip).map(&:length).max + 2
126
- gres_lines = call("sinfo", "-ahNO ,nodehost,gres:#{gres_length},gresused:#{gres_length}")
127
- .lines.uniq.map(&:split)
128
- ClusterInfo.new(active_nodes: node_cpu_info[0].to_i,
129
- total_nodes: node_cpu_info[2].to_i,
130
- active_processors: node_cpu_info[3].to_i,
131
- total_processors: node_cpu_info[6].to_i,
126
+ gres_lines = call("sinfo", "-ahNO", "nodehost,gres:#{gres_length},gresused:#{gres_length},statelong")
127
+ .lines.uniq.reject { |line| line.match?(/maint|drain|down/i) }.map(&:split)
128
+
129
+ node_info = sinfo_headers.zip(node_cpu_info).to_h
130
+ ClusterInfo.new(active_nodes: node_info['nodes_allocated'],
131
+ total_nodes: node_info['nodes_total'],
132
+ active_processors: node_info['cpus_allocated'],
133
+ total_processors: node_info['cpus_total'],
132
134
  active_gpus: gres_lines.sum { |line| Slurm.gpus_from_gres(line[2]) },
133
135
  total_gpus: gres_lines.sum { |line| Slurm.gpus_from_gres(line[1]) }
134
136
  )
135
137
  end
136
138
 
139
+ def sinfo_headers
140
+ [
141
+ 'nodes_allocated', 'nodes_idle', 'nodes_other', 'nodes_total',
142
+ 'cpus_allocated', 'cpus_idle', 'cpus_other', 'cpus_total'
143
+ ]
144
+ end
145
+
137
146
  # Get a list of hashes detailing each of the jobs on the batch server
138
147
  # @example Status info for all jobs
139
148
  # my_batch.get_jobs
@@ -1,4 +1,4 @@
1
1
  module OodCore
2
2
  # The current version of {OodCore}
3
- VERSION = "0.30.1"
3
+ VERSION = "0.30.2"
4
4
  end
data/ood_core.gemspec CHANGED
@@ -33,5 +33,5 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency "timecop", "~> 0.8"
34
34
  spec.add_development_dependency "climate_control", "~> 1.2.0"
35
35
  spec.add_development_dependency "minitest", "~> 5"
36
- spec.add_development_dependency "mocha", "~> 2.4"
36
+ spec.add_development_dependency "mocha", "~> 3.0"
37
37
  end
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.30.1
4
+ version: 0.30.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: 2025-12-03 00:00:00.000000000 Z
13
+ date: 2026-01-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ood_support
@@ -172,14 +172,14 @@ dependencies:
172
172
  requirements:
173
173
  - - "~>"
174
174
  - !ruby/object:Gem::Version
175
- version: '2.4'
175
+ version: '3.0'
176
176
  type: :development
177
177
  prerelease: false
178
178
  version_requirements: !ruby/object:Gem::Requirement
179
179
  requirements:
180
180
  - - "~>"
181
181
  - !ruby/object:Gem::Version
182
- version: '2.4'
182
+ version: '3.0'
183
183
  description: Open OnDemand core library that provides support for an HPC Center to
184
184
  globally define HPC services that web applications can then take advantage of.
185
185
  email: