ood_core 0.17.0 → 0.17.1

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: 266e24cd2e11c2c712b6128bdc3f82bf9781ae9885f8f0eb21439cb80c889c90
4
- data.tar.gz: 01e682b6313468371076cdfd4ff2df2f3c06c661af9b4d7d7a65b7dcf3e2d836
3
+ metadata.gz: 71272779185c8dee0b38f361c14419b77a9a497d46fc74a30b31735882f2f99b
4
+ data.tar.gz: 827b6d710a0a31f279cc370bd00d49b2d56c3cd31d009d155ee6ad8d2967e552
5
5
  SHA512:
6
- metadata.gz: 22721c9d368ec44533d93914f977576ee77786ad0926976fa24067c7f353104edd32baffac34723b730e7f711c5b7581cf4f72f6232d050c719edcfc1b3cb14f
7
- data.tar.gz: 5d99a3c782aad5e420333653e51073cdb6535b7689053452da7ee7ef234292769e70d4010d751aacd4576daf531700136c2aa0ef7a2efc31edcb29e4c01c8be4
6
+ metadata.gz: e42c8b974608a23ac3973fd68d40042e002e61c0b5a2d17877626578b7ceb178ae94ba3881c26003a8b69800075669410b226cd12c7cfe8350ba21fdd75a9329
7
+ data.tar.gz: 2f149dedb64a5806626a827d43ceab368cdd1f026a789bb9ece6189596e0e7cc2a5009d98053eafdcd090c49befa688fcf8ccc1f70593635a2a3a4bf5535b0e3
data/CHANGELOG.md CHANGED
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.17.1] - 6-14-2021
11
+
12
+ ### Fixed
13
+
14
+ - Fixed [278](https://github.com/OSC/ood_core/pull/278) where unschedulable pods will now show up as
15
+ queued_held status.
16
+
17
+ ### Changed
18
+
19
+ - KUBECONFIG now defaults to /dev/null in the kubernetes adapter in [292](https://github.com/OSC/ood_core/pull/292).
20
+
21
+ ### Added
22
+
23
+ - Sites can now set `batch_connect.ssh_allow` on the cluster to disable the buttons to start
24
+ a shell session to compute nodes in [289](https://github.com/OSC/ood_core/pull/289).
25
+ - `POD_PORT` is now available to jobs in the kubernetes adapter in [290](https://github.com/OSC/ood_core/pull/290).
26
+ - Kubernetes pods now support a startProbe in [291](https://github.com/OSC/ood_core/pull/291).
27
+
10
28
  ## [0.17.0] - 5-26-2021
11
29
 
12
30
  ### Fixed
@@ -336,7 +354,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
336
354
  ### Added
337
355
  - Initial release!
338
356
 
339
- [Unreleased]: https://github.com/OSC/ood_core/compare/v0.16.0...HEAD
357
+ [Unreleased]: https://github.com/OSC/ood_core/compare/v0.17.1...HEAD
358
+ [0.17.1]: https://github.com/OSC/ood_core/compare/v0.17.0...v0.17.1
340
359
  [0.17.0]: https://github.com/OSC/ood_core/compare/v0.16.1...v0.17.0
341
360
  [0.16.1]: https://github.com/OSC/ood_core/compare/v0.16.0...v0.16.1
342
361
  [0.16.0]: https://github.com/OSC/ood_core/compare/v0.15.1...v0.16.0
@@ -148,12 +148,12 @@ module OodCore
148
148
  end
149
149
 
150
150
  # Whether this cluster supports SSH to batch connect nodes
151
- # @return [Boolean] whether cluster supports SSH to batch connect node
151
+ # @return [Boolean, nil] whether cluster supports SSH to batch connect node
152
152
  def batch_connect_ssh_allow?
153
153
  return @batch_connect_ssh_allow if defined?(@batch_connect_ssh_allow)
154
- return @batch_connect_ssh_allow = true if batch_connect_config.nil?
154
+ return @batch_connect_ssh_allow = nil if batch_connect_config.nil?
155
155
 
156
- @batch_connect_ssh_allow = batch_connect_config.fetch(:ssh_allow, true)
156
+ @batch_connect_ssh_allow = batch_connect_config.fetch(:ssh_allow, nil)
157
157
  end
158
158
 
159
159
  # The comparison operator
@@ -183,6 +183,7 @@ class OodCore::Job::Adapters::Kubernetes::Batch
183
183
  HOME: home_dir,
184
184
  GROUP: group,
185
185
  GID: run_as_group,
186
+ KUBECONFIG: '/dev/null',
186
187
  }
187
188
  end
188
189
 
@@ -54,7 +54,8 @@ class OodCore::Job::Adapters::Kubernetes::Helper
54
54
  working_dir: container[:working_dir],
55
55
  restart_policy: container[:restart_policy],
56
56
  image_pull_policy: container[:image_pull_policy],
57
- image_pull_secret: container[:image_pull_secret]
57
+ image_pull_secret: container[:image_pull_secret],
58
+ startup_probe: container[:startup_probe],
58
59
  )
59
60
  end
60
61
 
@@ -239,15 +240,21 @@ class OodCore::Job::Adapters::Kubernetes::Helper
239
240
  def submission_time(json_data)
240
241
  status = json_data.dig(:status)
241
242
  start = status.dig(:startTime)
243
+ creation = json_data.dig(:metadata, :creationTimestamp)
242
244
 
243
- if start.nil?
245
+ if !creation.nil?
246
+ str = creation
247
+ elsif !start.nil?
248
+ str = start
249
+ else
244
250
  # the pod is in some pending state limbo
245
251
  conditions = status.dig(:conditions)
252
+ return nil if conditions.nil?
253
+ return nil if conditions.size == 0
246
254
  # best guess to start time is just the first condition's
247
255
  # transition time
248
256
  str = conditions[0].dig(:lastTransitionTime)
249
- else
250
- str = start
257
+ return nil if str.nil?
251
258
  end
252
259
 
253
260
  DateTime.parse(str).to_time.to_i
@@ -255,11 +262,17 @@ class OodCore::Job::Adapters::Kubernetes::Helper
255
262
 
256
263
  def pod_status_from_json(json_data)
257
264
  phase = json_data.dig(:status, :phase)
265
+ conditions = json_data.dig(:status, :conditions)
266
+ unschedulable = conditions.to_a.any? { |c| c.dig(:reason) == "Unschedulable" }
258
267
  state = case phase
259
268
  when "Running"
260
269
  "running"
261
270
  when "Pending"
262
- "queued"
271
+ if unschedulable
272
+ "queued_held"
273
+ else
274
+ "queued"
275
+ end
263
276
  when "Failed"
264
277
  "suspended"
265
278
  when "Succeeded"
@@ -33,13 +33,36 @@ module OodCore::Job::Adapters::Kubernetes::Resources
33
33
  end
34
34
  end
35
35
 
36
+ class TCPProbe
37
+ attr_accessor :port, :initial_delay_seconds, :failure_threshold, :period_seconds
38
+
39
+ def initialize(port, data)
40
+ data ||= {}
41
+ @port = port
42
+ @initial_delay_seconds = data[:initial_delay_seconds] || 2
43
+ @failure_threshold = data[:failure_threshold] || 5
44
+ @period_seconds = data[:period_seconds] || 5
45
+ end
46
+
47
+ def to_h
48
+ {
49
+ port: port,
50
+ initial_delay_seconds: initial_delay_seconds,
51
+ failure_threshold: failure_threshold,
52
+ period_seconds: period_seconds,
53
+ }
54
+ end
55
+ end
56
+
36
57
  class Container
37
58
  attr_accessor :name, :image, :command, :port, :env, :memory, :cpu, :working_dir,
38
- :restart_policy, :image_pull_policy, :image_pull_secret, :supplemental_groups
59
+ :restart_policy, :image_pull_policy, :image_pull_secret, :supplemental_groups,
60
+ :startup_probe
39
61
 
40
62
  def initialize(
41
63
  name, image, command: [], port: nil, env: {}, memory: "4Gi", cpu: "1",
42
- working_dir: "", restart_policy: "Never", image_pull_policy: nil, image_pull_secret: nil, supplemental_groups: []
64
+ working_dir: "", restart_policy: "Never", image_pull_policy: nil, image_pull_secret: nil, supplemental_groups: [],
65
+ startup_probe: {}
43
66
  )
44
67
  raise ArgumentError, "containers need valid names and images" unless name && image
45
68
 
@@ -55,6 +78,7 @@ module OodCore::Job::Adapters::Kubernetes::Resources
55
78
  @image_pull_policy = image_pull_policy.nil? ? "IfNotPresent" : image_pull_policy
56
79
  @image_pull_secret = image_pull_secret
57
80
  @supplemental_groups = supplemental_groups.nil? ? [] : supplemental_groups
81
+ @startup_probe = TCPProbe.new(@port, startup_probe)
58
82
  end
59
83
 
60
84
  def ==(other)
@@ -69,7 +93,8 @@ module OodCore::Job::Adapters::Kubernetes::Resources
69
93
  restart_policy == other.restart_policy &&
70
94
  image_pull_policy == other.image_pull_policy &&
71
95
  image_pull_secret == other.image_pull_secret &&
72
- supplemental_groups == other.supplemental_groups
96
+ supplemental_groups == other.supplemental_groups &&
97
+ startup_probe.to_h == other.startup_probe.to_h
73
98
  end
74
99
  end
75
100
 
@@ -52,6 +52,10 @@ spec:
52
52
  valueFrom:
53
53
  fieldRef:
54
54
  fieldPath: metadata.namespace
55
+ <%- unless spec.container.port.nil? -%>
56
+ - name: POD_PORT
57
+ value: "<%= spec.container.port %>"
58
+ <%- end -%>
55
59
  <%- spec.container.env.each_pair do |name, value| -%>
56
60
  - name: <%= name %>
57
61
  value: "<%= value %>"
@@ -65,6 +69,12 @@ spec:
65
69
  <%- unless spec.container.port.nil? -%>
66
70
  ports:
67
71
  - containerPort: <%= spec.container.port %>
72
+ startupProbe:
73
+ tcpSocket:
74
+ port: <%= spec.container.startup_probe.port %>
75
+ initialDelaySeconds: <%= spec.container.startup_probe.initial_delay_seconds %>
76
+ failureThreshold: <%= spec.container.startup_probe.failure_threshold %>
77
+ periodSeconds: <%= spec.container.startup_probe.period_seconds %>
68
78
  <%- end -%>
69
79
  <%- if !all_mounts.empty? || (!configmap.nil? && configmap.mounts?) -%>
70
80
  volumeMounts:
@@ -1,4 +1,4 @@
1
1
  module OodCore
2
2
  # The current version of {OodCore}
3
- VERSION = "0.17.0"
3
+ VERSION = "0.17.1"
4
4
  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.17.0
4
+ version: 0.17.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: 2021-05-26 00:00:00.000000000 Z
13
+ date: 2021-06-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ood_support