ood_core 0.23.1 → 0.23.3

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: bd8cb5dc98cf0b2c2120fdb6234e5482fb40cbec59f6688318e0d33b050d0dc4
4
- data.tar.gz: 0fe72b2fe29aa1e4ca2d5e28ca43e8b3f9e0381fe17f4678ea7218a5c062a3e7
3
+ metadata.gz: 5eeeaa19f116b7edd7e4169b49e0ca74f0e43355d756ef3b3eb14edaf1f9de00
4
+ data.tar.gz: aaa6d9a8ef9a2e1a2e1f7396c27eb101faba8c639cf8b088f5a1e62adbe6e97b
5
5
  SHA512:
6
- metadata.gz: 53bd81e896ae96b55e92732b86d9ca364449f8140bedbaba0b6fc9de73d5ffb06e65ea9ba84cc84e621bbf64af5b30a241a803b7fb4944745ebb50cc2a6ba39f
7
- data.tar.gz: 9106dbc505aff7040bedeba9c0531cd539dbcd11e3aac54072e7bc01660f8f07147fb19be325631496215b6c1725bb68ca57968b39e377b0567747ef5569563c
6
+ metadata.gz: f36e3835a742b19e04c699e2913ec09c601c2dd912300615cad119c2ccc71482552690a0050b626f8cf024c13f40510430fb8747942c2bf37e3fa9a5040123d4
7
+ data.tar.gz: 29dfedd6a597f8b794fc5105e74bd0f4a2933ec423a7ad026a5c3ee6f3f531a9cb2b24956140c4afd0606897df22fd34771fbeb6d10fae63e8ba3b778317c6a0
data/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@ 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
+
10
17
  ## [0.23.1] - 02-01-2023
11
18
 
12
19
  ### Fixed
@@ -479,8 +486,9 @@ Functionally the same as [0.17.3] but with some CI updates.
479
486
  ### Added
480
487
  - Initial release!
481
488
 
482
- [Unreleased]: https://github.com/OSC/ood_core/compare/v0.23.1...HEAD
483
- [0.23.1]: https://github.com/OSC/ood_core/compare/v0.22.0...v0.23.0
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
484
492
  [0.23.0]: https://github.com/OSC/ood_core/compare/v0.22.0...v0.23.0
485
493
  [0.22.0]: https://github.com/OSC/ood_core/compare/v0.21.0...v0.22.0
486
494
  [0.21.0]: https://github.com/OSC/ood_core/compare/v0.20.2...v0.21.0
@@ -8,20 +8,21 @@ module OodCore
8
8
  # Build the group acl adapter from a configuration
9
9
  # @param config [#to_h] the configuration for an acl adapter
10
10
  # @option config [Array<#to_s>] :groups The list of groups
11
- # @option config [#to_s] :type ('whitelist') The type of ACL ('whitelist' or 'blacklist')
11
+ # @option config [#to_s] :type ('allowlist') The type of ACL ('allowlist' or 'blocklist')
12
12
  def self.build_group(config)
13
13
  c = config.to_h.symbolize_keys
14
14
 
15
15
  groups = c.fetch(:groups) { raise ArgumentError, "No groups specified. Missing argument: groups" }.map(&:to_s)
16
16
  acl = OodSupport::ACL.new(entries: groups.map { |g| OodSupport::ACLEntry.new principle: g })
17
17
 
18
- type = c.fetch(:type, "whitelist").to_s
19
- if type == "whitelist"
18
+ type = c.fetch(:type, 'allowlist').to_s
19
+ case type
20
+ when 'allowlist', 'whitelist'
20
21
  allow = true
21
- elsif type == "blacklist"
22
+ when 'blocklist', 'blacklist'
22
23
  allow = false
23
24
  else
24
- raise ArgumentError, "Invalid type specified. Valid types: whitelist, blacklist"
25
+ raise ArgumentError, 'Invalid type specified. Valid types: allowlist, blocklist'
25
26
  end
26
27
 
27
28
  Adapters::Group.new(acl: acl, allow: allow)
@@ -90,7 +90,7 @@ module OodCore
90
90
  {
91
91
  adapter: "group",
92
92
  groups: h["data"]["groups"],
93
- type: h["data"]["allow"] ? "whitelist" : "blacklist"
93
+ type: h["data"]["allow"] ? 'allowlist' : 'blocklist'
94
94
  }
95
95
  end
96
96
  end
@@ -26,11 +26,20 @@ module OodCore
26
26
  return cmd, cmd_args if submit_host.to_s.empty?
27
27
 
28
28
  check_host = strict_host_checking ? "yes" : "no"
29
- args = ['-o', 'BatchMode=yes', '-o', 'UserKnownHostsFile=/dev/null', '-o', "StrictHostKeyChecking=#{check_host}", "#{submit_host}"]
29
+
30
+ # Have to OodCore::Job::Adapters::Helper.ssh_port instead of self.ssh_port due to test failure
31
+ args = ['-p', OodCore::Job::Adapters::Helper.ssh_port, '-o', 'BatchMode=yes', '-o', 'UserKnownHostsFile=/dev/null', '-o', "StrictHostKeyChecking=#{check_host}", "#{submit_host}"]
30
32
  env.each{|key, value| args.push("export #{key}=#{value};")}
31
33
 
32
34
  return 'ssh', args + [cmd] + cmd_args
33
35
  end
36
+
37
+ # Allows for Non-Standard Port usage in ssh commands
38
+ # To set ENV["OOD_SSH_PORT"], add assignment in /etc/ood/config/nginx_stage.yml
39
+ def self.ssh_port
40
+ return ENV["OOD_SSH_PORT"].nil? ? "22" : "#{ENV['OOD_SSH_PORT'].to_i.to_s}"
41
+ end
42
+
34
43
  end
35
44
  end
36
45
  end
@@ -58,7 +58,6 @@ class OodCore::Job::Adapters::LinuxHost::Launcher
58
58
  # @param script [OodCore::Job::Script] The script object defining the work
59
59
  def start_remote_session(script)
60
60
  cmd = ssh_cmd(submit_host(script), ['/usr/bin/env', 'bash'])
61
-
62
61
  session_name = unique_session_name
63
62
  output = call(*cmd, stdin: wrapped_script(script, session_name))
64
63
  hostname = parse_hostname(output)
@@ -73,7 +72,7 @@ class OodCore::Job::Adapters::LinuxHost::Launcher
73
72
  # Get the tmux pane PID for the target session
74
73
  pane_pid=$(tmux list-panes -aF '\#{session_name} \#{pane_pid}' | grep '#{session_name}' | cut -f 2 -d ' ')
75
74
  # 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:]]*')
75
+ pane_sinit_pid=$(pstree -p -l "$pane_pid" | egrep -o 'sinit[(][[:digit:]]*|shim-init[(][[:digit:]]|appinit[(][[:digit:]]*' | grep -o '[[:digit:]]*')
77
76
  # Kill sinit which stops both Singularity-based processes and the tmux session
78
77
  kill "$pane_sinit_pid"
79
78
  SCRIPT
@@ -122,15 +121,18 @@ class OodCore::Job::Adapters::LinuxHost::Launcher
122
121
  # @param destination_host [#to_s] the destination host you wish to ssh into
123
122
  # @param cmd [Array<#to_s>] the command to be executed on the destination host
124
123
  def ssh_cmd(destination_host, cmd)
124
+
125
125
  if strict_host_checking
126
126
  [
127
127
  'ssh', '-t',
128
+ '-p', OodCore::Job::Adapters::Helper.ssh_port,
128
129
  '-o', 'BatchMode=yes',
129
130
  "#{username}@#{destination_host}"
130
131
  ].concat(cmd)
131
132
  else
132
133
  [
133
134
  'ssh', '-t',
135
+ '-p', OodCore::Job::Adapters::Helper.ssh_port,
134
136
  '-o', 'BatchMode=yes',
135
137
  '-o', 'UserKnownHostsFile=/dev/null',
136
138
  '-o', 'StrictHostKeyChecking=no',
@@ -291,4 +293,5 @@ class OodCore::Job::Adapters::LinuxHost::Launcher
291
293
  line.match(/^(([\w+]|[a-zA-Z0-9][\w*-]*\.))*$/)
292
294
  end.compact.last.to_s
293
295
  end
296
+
294
297
  end
@@ -104,12 +104,14 @@ class OodCore::Job::Adapters::LinuxSystemd::Launcher
104
104
  if strict_host_checking
105
105
  [
106
106
  'ssh', '-t',
107
+ '-p', OodCore::Job::Adapters::Helper.ssh_port,
107
108
  '-o', 'BatchMode=yes',
108
109
  "#{username}@#{destination_host}"
109
110
  ].concat(cmd)
110
111
  else
111
112
  [
112
113
  'ssh', '-t',
114
+ '-p', OodCore::Job::Adapters::Helper.ssh_port,
113
115
  '-o', 'BatchMode=yes',
114
116
  '-o', 'UserKnownHostsFile=/dev/null',
115
117
  '-o', 'StrictHostKeyChecking=no',
@@ -1,4 +1,4 @@
1
1
  module OodCore
2
2
  # The current version of {OodCore}
3
- VERSION = "0.23.1"
3
+ VERSION = "0.23.3"
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.23.1
4
+ version: 0.23.3
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-02-01 00:00:00.000000000 Z
13
+ date: 2023-02-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ood_support