ood_core 0.17.2 → 0.17.4

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: dca336fb15a08ad68f556b8d33fb76887f5c0370a0eef63685a5770fbf073110
4
- data.tar.gz: 410b08fee5e739b7444ca3054483a2758d43062af964168b3f32318489d19fa0
3
+ metadata.gz: 4c94c6fbf110564ec2cff9d885d2799566a70e1e98759f44fec00fde6eb0cdec
4
+ data.tar.gz: 7ed0326c52582dbd8b15a272706e8aa58e36a2be0555a78c65037bb74517d0a6
5
5
  SHA512:
6
- metadata.gz: e82540895495b9f09c92f413f8f39a894fb700122da195cd4224d68eb5eae30845f8692c6d440462bac2c4f45b0a3270e7bf5219ba4adecfc63baa3884b53d28
7
- data.tar.gz: 39a441ede8e9b91e169b1aff0c1345a56c98aac1f25a1b07d873b20e66833ed46a534b5ef23f392f5d0213b7e5c80e942f62b0031f4fd2065c327116975fdf8b
6
+ metadata.gz: b6af308bf4acb767e6c3128ce753714ebcee4f33a17b5114a1196d73ec7df63be5d5007ad985c752329463e2533ed1bbfa8951426a2a035ef08ce9b3704b5984
7
+ data.tar.gz: 76b07812da52479c3d5c834c51dcb6c5af328721436474197a77bd0423f5061361d333d233c235da7a699e31ac772104eb65902e74ee25afb4640c6e5adc4add
data/CHANGELOG.md CHANGED
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.17.4] - 7-29-2021
11
+
12
+ Functionally the same as [0.17.3] but with some CI updates.
13
+
14
+ ## [0.17.3] - 7-29-2021
15
+
16
+ ### Fixed
17
+
18
+ - Fixed handling of pods in a startup phase in [303](https://github.com/OSC/ood_core/pull/303).
19
+
20
+ ### Added
21
+
22
+ - Enable automatic population of supplemental groups in [305](https://github.com/OSC/ood_core/pull/305).
23
+
10
24
  ## [0.17.2] - 7-14-2021
11
25
 
12
26
  ### Fixed
@@ -360,7 +374,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
360
374
  ### Added
361
375
  - Initial release!
362
376
 
363
- [Unreleased]: https://github.com/OSC/ood_core/compare/v0.17.2...HEAD
377
+ [Unreleased]: https://github.com/OSC/ood_core/compare/v0.17.4...HEAD
378
+ [0.17.4]: https://github.com/OSC/ood_core/compare/v0.17.3...v0.17.4
379
+ [0.17.3]: https://github.com/OSC/ood_core/compare/v0.17.2...v0.17.3
364
380
  [0.17.2]: https://github.com/OSC/ood_core/compare/v0.17.1...v0.17.2
365
381
  [0.17.1]: https://github.com/OSC/ood_core/compare/v0.17.0...v0.17.1
366
382
  [0.17.0]: https://github.com/OSC/ood_core/compare/v0.16.1...v0.17.0
@@ -14,6 +14,7 @@ class OodCore::Job::Adapters::Kubernetes::Batch
14
14
  attr_reader :config_file, :bin, :cluster, :mounts
15
15
  attr_reader :all_namespaces, :using_context, :helper
16
16
  attr_reader :username_prefix, :namespace_prefix
17
+ attr_reader :auto_supplemental_groups
17
18
 
18
19
  def initialize(options = {})
19
20
  options = options.to_h.symbolize_keys
@@ -25,6 +26,7 @@ class OodCore::Job::Adapters::Kubernetes::Batch
25
26
  @all_namespaces = options.fetch(:all_namespaces, false)
26
27
  @username_prefix = options.fetch(:username_prefix, '')
27
28
  @namespace_prefix = options.fetch(:namespace_prefix, '')
29
+ @auto_supplemental_groups = options.fetch(:auto_supplemental_groups, false)
28
30
 
29
31
  @using_context = false
30
32
  @helper = OodCore::Job::Adapters::Kubernetes::Helper.new
@@ -176,6 +178,19 @@ class OodCore::Job::Adapters::Kubernetes::Batch
176
178
  Etc.getgrgid(run_as_group).name
177
179
  end
178
180
 
181
+ def default_supplemental_groups
182
+ OodSupport::User.new.groups.sort_by(&:id).map(&:id).reject { |id| id < 1000 }
183
+ end
184
+
185
+ def supplemental_groups(groups = [])
186
+ sgroups = []
187
+ if auto_supplemental_groups
188
+ sgroups.concat(default_supplemental_groups)
189
+ end
190
+ sgroups.concat(groups.to_a)
191
+ sgroups.uniq.sort
192
+ end
193
+
179
194
  def default_env
180
195
  {
181
196
  USER: username,
@@ -191,6 +206,7 @@ class OodCore::Job::Adapters::Kubernetes::Batch
191
206
  # create an id.
192
207
  def generate_id_yml(script)
193
208
  native_data = script.native
209
+ native_data[:container][:supplemental_groups] = supplemental_groups(native_data[:container][:supplemental_groups])
194
210
  container = helper.container_from_native(native_data[:container], default_env)
195
211
  id = generate_id(container.name)
196
212
  configmap = helper.configmap_from_native(native_data, id, script.content)
@@ -55,6 +55,7 @@ class OodCore::Job::Adapters::Kubernetes::Helper
55
55
  restart_policy: container[:restart_policy],
56
56
  image_pull_policy: container[:image_pull_policy],
57
57
  image_pull_secret: container[:image_pull_secret],
58
+ supplemental_groups: container[:supplemental_groups],
58
59
  startup_probe: container[:startup_probe],
59
60
  )
60
61
  end
@@ -266,7 +267,9 @@ class OodCore::Job::Adapters::Kubernetes::Helper
266
267
  container_statuses = json_data.dig(:status, :containerStatuses)
267
268
  unschedulable = conditions.to_a.any? { |c| c.dig(:reason) == "Unschedulable" }
268
269
  ready = !container_statuses.to_a.empty? && container_statuses.to_a.all? { |s| s.dig(:ready) == true }
270
+ started = !container_statuses.to_a.empty? && container_statuses.to_a.any? { |s| s.fetch(:state, {}).key?(:running) }
269
271
  return "running" if ready
272
+ return "queued" if phase == "Running" && started
270
273
 
271
274
  state = case phase
272
275
  when "Pending"
@@ -20,14 +20,7 @@ spec:
20
20
  runAsUser: <%= run_as_user %>
21
21
  runAsGroup: <%= run_as_group %>
22
22
  runAsNonRoot: true
23
- <%- if spec.container.supplemental_groups.empty? -%>
24
- supplementalGroups: []
25
- <%- else -%>
26
- supplementalGroups:
27
- <%- spec.container.supplemental_groups.each do |supplemental_group| -%>
28
- - "<%= supplemental_group %>"
29
- <%- end -%>
30
- <%- end -%>
23
+ supplementalGroups: <%= spec.container.supplemental_groups %>
31
24
  fsGroup: <%= fs_group %>
32
25
  hostNetwork: false
33
26
  hostIPC: false
@@ -1,4 +1,4 @@
1
1
  module OodCore
2
2
  # The current version of {OodCore}
3
- VERSION = "0.17.2"
3
+ VERSION = "0.17.4"
4
4
  end
data/ood_core.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
  spec.license = "MIT"
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
- f.match(%r{^(test|spec|features)/})
18
+ f.match(%r{^(test|spec|features|.github)/})
19
19
  end
20
20
  spec.bindir = "exe"
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
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.2
4
+ version: 0.17.4
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-07-16 00:00:00.000000000 Z
13
+ date: 2021-07-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ood_support
@@ -160,8 +160,6 @@ executables: []
160
160
  extensions: []
161
161
  extra_rdoc_files: []
162
162
  files:
163
- - ".github/dependabot.yml"
164
- - ".github/workflows/test.yml"
165
163
  - ".gitignore"
166
164
  - ".rspec"
167
165
  - CHANGELOG.md
@@ -1,8 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: bundler
4
- directory: "/"
5
- schedule:
6
- interval: daily
7
- time: "03:30"
8
- open-pull-requests-limit: 10
@@ -1,30 +0,0 @@
1
- name: Unit Tests
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
- pull_request:
8
- branches:
9
- - master
10
-
11
- jobs:
12
- tests:
13
- runs-on: ubuntu-latest
14
-
15
- steps:
16
- - name: checkout
17
- uses: actions/checkout@v2
18
-
19
- - name: Setup Ruby using Bundler
20
- uses: ruby/setup-ruby@v1
21
- with:
22
- ruby-version: "2.7.1"
23
- bundler-cache: true
24
- bundler: "2.1.4"
25
-
26
- - name: install gems
27
- run: bundle install
28
-
29
- - name: test
30
- run: bundle exec rake spec