ood_packaging 0.1.4 → 0.4.0

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: 7c70a0f572ecbb2e7e338c08dd43009335d7552750fd5f7717f154bc637d1c1a
4
- data.tar.gz: 7f3e84f57c4f1c245f6d5daec190da5690a310c136efaf8a3732ba89ad2fed59
3
+ metadata.gz: c27c38bf93bd944bc4a2ea6e3e2e3ec1c847380fd63af529a78fbbf24c227b7d
4
+ data.tar.gz: de7ef57ce537716a66c0046d6fa27b89097ce11235516c36e8f94421ea3566e3
5
5
  SHA512:
6
- metadata.gz: 9c458f0bd60de9599fed549de0602785a9a3611fda8ea61f5547aa6201bb260fc935d9ad8adb8d68a50abe7b4a6ae1b8b029b9b711ed7bec4b3ae1309103206e
7
- data.tar.gz: e0af0043f8ee483a2eea671c8849a01c941bdd71eb5ecf296c1079528a847bdf96d441ddbcb7340050303dcaaae6f571d9f96df3d2d60a9366802007f6017df9
6
+ metadata.gz: 2d5d1c157936e25191f5f4ba7a0f852cb110186098f27cb4d9b80ca90247177cbff7731adf8d4e3c5968e97d6753a68c970867529b19cc6a67d51461938e9aa9
7
+ data.tar.gz: 2015d40a9fc63026c601558592d1369590292280bf8e769651c1dd5cba0525f89fdb9d601ca55788506129feb51dc0ba54d02b423f43ef18f226e449e9ec5e74
data/bin/ood_packaging CHANGED
@@ -2,13 +2,9 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'optparse'
5
- begin
6
- require 'ood_packaging'
7
- # If gem is not installed, load from location in git repo
8
- rescue LoadError
9
- $LOAD_PATH.unshift(File.expand_path(File.join(__dir__, '../lib')))
10
- require 'ood_packaging'
11
- end
5
+ libdir = File.expand_path(File.join(__dir__, '../lib'))
6
+ $LOAD_PATH.unshift(libdir) if Dir.exist?(libdir)
7
+ require 'ood_packaging'
12
8
 
13
9
  options = {}
14
10
  OptionParser.new do |opts|
@@ -247,9 +247,13 @@ class OodPackaging::Build
247
247
 
248
248
  def install_deb_dependencies!
249
249
  sh "sudo apt update -y#{cmd_suffix}"
250
+ tool = [
251
+ 'DEBIAN_FRONTEND=noninteractive apt-cudf-get --solver aspcud',
252
+ '-o APT::Get::Assume-Yes=1 -o Debug::pkgProblemResolver=0 -o APT::Install-Recommends=0'
253
+ ]
250
254
  cmd = [
251
255
  'mk-build-deps --install --remove --root-cmd sudo',
252
- "--tool='DEBIAN_FRONTEND=noninteractive apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes'"
256
+ "--tool='#{tool.join(' ')}'"
253
257
  ]
254
258
  Dir.chdir(deb_work_dir) do
255
259
  sh "#{cmd.join(' ')}#{cmd_suffix}"
@@ -17,9 +17,13 @@ RUN rm -f /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo /etc/yum.repos.d/CentOS-SCLo-
17
17
  <% elsif dist =~ /^el/ -%>
18
18
  RUN dnf update -y && dnf clean all && rm -rf /var/cache/dnf/*
19
19
  RUN dnf install -y dnf-utils epel-release langpacks-en glibc-all-langpacks && dnf clean all && rm -rf /var/cache/dnf/*
20
+ <% if dist == 'el8' -%>
20
21
  RUN dnf config-manager --set-enabled powertools && dnf clean all && rm -rf /var/cache/dnf/*
21
22
  RUN dnf module enable -y ruby:<%= ruby_version %> nodejs:<%= nodejs_version %> && dnf clean all && rm -rf /var/cache/dnf/*
22
- RUN dnf install -y systemd ruby sudo which wget \
23
+ <% else -%>
24
+ RUN dnf config-manager --set-enabled crb && dnf clean all && rm -rf /var/cache/dnf/*
25
+ <% end -%>
26
+ RUN dnf install -y systemd ruby nodejs sudo which wget \
23
27
  gcc-c++ gcc make patch \
24
28
  rpm-build rpmdevtools rpm-sign scl-utils-build && \
25
29
  dnf clean all && rm -rf /var/cache/dnf/*
@@ -29,7 +33,7 @@ RUN apt update -y && apt upgrade -y && apt clean all -y
29
33
  RUN apt update -y && apt install -y locales && locale-gen $LANG && \
30
34
  apt clean all -y
31
35
  RUN apt update -y && apt install -y apt-transport-https ca-certificates \
32
- init debhelper devscripts dh-make build-essential lintian equivs \
36
+ init debhelper devscripts dh-make build-essential apt-cudf lintian equivs \
33
37
  sudo rake wget curl ruby bundler && \
34
38
  apt clean all -y
35
39
  RUN echo "deb https://deb.nodesource.com/node_<%= nodejs_version %>.x <%= codename %> main" > /etc/apt/sources.list.d/nodesource.list
@@ -0,0 +1,64 @@
1
+ -----BEGIN PGP PUBLIC KEY BLOCK-----
2
+
3
+ mQINBGKraI8BEACzsh07SFbz9B1mo8IzTBUu1ky0vbabaPv8opxpyTKoYJrxozhV
4
+ rOOg0wbRywRRFAvqXlSQ8lpQebJ55hR4A9UvpP5X2XoH0BJ7nkiHyndSAPVYJgh8
5
+ u0sZ2Jk2tkePEBszIkMe0gm8RUUdh/pMwkIMwGJGH2MMp/UhVxw+xvRWn5BBWalZ
6
+ QInbQ5pzMW8LR/j6eLqOCrG2PgPosxBss93ZH5bIcAUyQwlVROyhOQLow9XKVlwm
7
+ rb1wa4WMH6j2cZZPvzb40BJP1EmuXGzlbaG7VhMf1lJH71kE3woz3HviQnM/tcAf
8
+ qdqdyNARJnMgTlIQQj8vZnp4TRvhXzjeQPjyLQAk6u3xC0NcDTxgxDcRSC70kRVt
9
+ oChx35ICVWYchgsKc10do6Twll2w9PmriFFXRyY948XjJ1W/QqfBz2tPZSNurBDH
10
+ 4PCrrJ6Z/IPq5GkE6PGfD1ayoAGUgNZ8cDat5xpFmdzrei08ETUsw7tD6sLl1q+L
11
+ QGSU60z9o8u2joFYujNKemYZ/faAPfbKb0Fj4rUpEvMw8TN3lsisRkwQTgSEzSAS
12
+ cjPLjulRDWk5n7nUaofI2gT841qlIcHaoxZXfnz1h80aSJVxp0WLySNDTGBecyik
13
+ +yVYPe25ZQ1z/43H+Fdu9joHoteSnBVYM2o4QaHreWP0Rj7bSa8gAj3xuQARAQAB
14
+ tDhPbkRlbWFuZCBSZWxlYXNlIFNpZ25pbmcgS2V5IChTSEE1MTIpIDxwYWNrYWdl
15
+ c0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kK73mEKYz2XKtqgBHHp+OkpzvgrUhxuyfHmlRy34dw
62
+ WAS7M0V6x6GPiX+zI1M=
63
+ =wRIy
64
+ -----END PGP PUBLIC KEY BLOCK-----
@@ -24,7 +24,11 @@ baseurl=https://yum.osc.edu/ondemand/build/<%= ondemand_repo_version %>/web/el\$
24
24
  enabled=1
25
25
  gpgcheck=0
26
26
  EOF
27
+ <% if legacy_gpg? -%>
27
28
  run rpm --import /build/RPM-GPG-KEY-ondemand
29
+ <% else -%>
30
+ run rpm --import /build/RPM-GPG-KEY-ondemand-SHA512
31
+ <% end -%>
28
32
  <% end -%>
29
33
 
30
34
  header "Creating users"
@@ -72,7 +76,7 @@ echo "allow-loopback-pinentry" >> <%= ctr_gpg_dir %>/gpg-agent.conf
72
76
  <%- end -%>
73
77
 
74
78
  header "Install ood_packaging gem"
75
- <%- if rpm? && !dnf? -%>
79
+ <%- if scl? -%>
76
80
  run scl enable <%= scl_ruby %> -- gem install --no-doc --bindir <%= ctr_scripts_dir %> --install-dir <%= ctr_gems_dir %> /build/*.gem
77
81
  <%- else -%>
78
82
  run gem install --no-doc --bindir <%= ctr_scripts_dir %> --install-dir <%= ctr_gems_dir %> /build/*.gem
@@ -12,6 +12,7 @@ class OodPackaging::BuildBox
12
12
  BASE_IMAGES = {
13
13
  'el7' => 'centos:7',
14
14
  'el8' => 'rockylinux/rockylinux:8',
15
+ 'el9' => 'almalinux:9',
15
16
  'ubuntu-20.04' => 'ubuntu:20.04',
16
17
  'ubuntu-22.04' => 'ubuntu:22.04'
17
18
  }.freeze
@@ -57,6 +58,12 @@ class OodPackaging::BuildBox
57
58
  false
58
59
  end
59
60
 
61
+ def legacy_gpg?
62
+ return true if ['el7', 'el8'].include?(dist)
63
+
64
+ false
65
+ end
66
+
60
67
  def package_manager
61
68
  return 'apt' if deb?
62
69
  return 'dnf' if dnf?
@@ -135,6 +142,10 @@ class OodPackaging::BuildBox
135
142
  sh [container_runtime, 'push', image_tag].join(' ')
136
143
  end
137
144
 
145
+ def pull!
146
+ sh [container_runtime, 'pull', image_tag].join(' ')
147
+ end
148
+
138
149
  def save!(path)
139
150
  sh [container_runtime, 'save', image_tag, '| gzip >', path].join(' ')
140
151
  end
@@ -21,8 +21,6 @@ class OodPackaging::Package
21
21
  @config = config
22
22
  @config[:dist] = 'el8' if tar_only?
23
23
  @build_box = OodPackaging::BuildBox.new(config)
24
- @clean_work_dir = config[:clean_work_dir].nil? ? true : config[:clean_work_dir]
25
- @clean_output_dir = config[:clean_output_dir].nil? ? true : config[:clean_output_dir]
26
24
  raise ArgumentError, 'Package is required' if package.nil?
27
25
  raise ArgumentError, 'Version is required' if version.nil?
28
26
  raise ArgumentError, "Package #{package} is not a directory" unless Dir.exist?(package)
@@ -33,12 +31,18 @@ class OodPackaging::Package
33
31
  @container_name ||= SecureRandom.uuid
34
32
  end
35
33
 
36
- def debug
34
+ def debug?
37
35
  return true if ENV['OOD_PACKAGING_DEBUG'] == 'true'
38
36
 
39
37
  @config[:debug].nil? ? false : @config[:debug]
40
38
  end
41
39
 
40
+ def cmd_suffix
41
+ return '' if debug?
42
+
43
+ ' 2>/dev/null 1>/dev/null'
44
+ end
45
+
42
46
  def attach?
43
47
  return true if ENV['OOD_PACKAGING_ATTACH'] == 'true'
44
48
 
@@ -49,10 +53,22 @@ class OodPackaging::Package
49
53
  @work_dir ||= File.expand_path(@config[:work_dir])
50
54
  end
51
55
 
56
+ def clean_work_dir
57
+ return false if ENV['OOD_PACKAGING_CLEAN_WORK_DIR'] == 'false'
58
+
59
+ @config[:clean_work_dir].nil? ? true : @config[:clean_work_dir]
60
+ end
61
+
52
62
  def output_dir
53
63
  @output_dir ||= File.expand_path(@config[:output_dir])
54
64
  end
55
65
 
66
+ def clean_output_dir
67
+ return false if ENV['OOD_PACKAGING_CLEAN_OUTPUT_DIR'] == 'false'
68
+
69
+ @config[:clean_output_dir].nil? ? true : @config[:clean_output_dir]
70
+ end
71
+
56
72
  def package
57
73
  @config[:package]
58
74
  end
@@ -90,8 +106,6 @@ class OodPackaging::Package
90
106
 
91
107
  def gpg_files
92
108
  [
93
- OpenStruct.new(private_key: File.join(proj_root, 'ondemand.sec'), passphrase: File.join(proj_root, '.gpgpass')),
94
- OpenStruct.new(private_key: File.join(package, 'ondemand.sec'), passphrase: File.join(package, '.gpgpass')),
95
109
  OpenStruct.new(private_key: @config[:gpg_private_key], passphrase: @config[:gpg_passphrase]),
96
110
  OpenStruct.new(private_key: ENV['OOD_PACKAGING_GPG_PRIVATE_KEY'],
97
111
  passphrase: ENV['OOD_PACKAGING_GPG_PASSPHRASE'])
@@ -109,8 +123,14 @@ class OodPackaging::Package
109
123
  !gpg_files.nil?
110
124
  end
111
125
 
126
+ def default_gpg_name
127
+ return 'OnDemand Release Signing Key' if build_box.legacy_gpg?
128
+
129
+ 'OnDemand Release Signing Key (SHA512)'
130
+ end
131
+
112
132
  def gpg_name
113
- @config[:gpg_name].nil? ? 'OnDemand Release Signing Key' : @config[:gpg_name]
133
+ @config[:gpg_name].nil? ? default_gpg_name : @config[:gpg_name]
114
134
  end
115
135
 
116
136
  def container_init
@@ -174,7 +194,7 @@ class OodPackaging::Package
174
194
  cmd.concat exec_launchers if docker_runtime?
175
195
  cmd.concat ['scl', 'enable', scl_ruby, '--'] if podman_runtime? && build_box.scl?
176
196
  cmd.concat [File.join(ctr_scripts_dir, 'rake')]
177
- cmd.concat ['-q'] unless debug
197
+ cmd.concat ['-q'] unless debug?
178
198
  cmd.concat ['-f', File.join(ctr_scripts_dir, 'Rakefile'), 'ood_packaging:package:build']
179
199
  cmd
180
200
  end
@@ -200,13 +220,13 @@ class OodPackaging::Package
200
220
  end
201
221
 
202
222
  def clean!
203
- sh "rm -rf #{work_dir}", verbose: debug if @clean_work_dir
204
- sh "rm -rf #{output_dir}", verbose: debug if @clean_output_dir
223
+ sh "rm -rf #{work_dir}", verbose: debug? if clean_work_dir
224
+ sh "rm -rf #{output_dir}", verbose: debug? if clean_output_dir
205
225
  end
206
226
 
207
227
  def bootstrap!
208
- sh "mkdir -p #{work_dir}", verbose: debug
209
- sh "mkdir -p #{output_dir}", verbose: debug
228
+ sh "mkdir -p #{work_dir}", verbose: debug?
229
+ sh "mkdir -p #{output_dir}", verbose: debug?
210
230
  end
211
231
 
212
232
  def tar!
@@ -224,7 +244,7 @@ class OodPackaging::Package
224
244
  sh "rm #{tar_file}" if File.exist?(tar_file)
225
245
  puts "Create tar archive #{tar_file}".blue
226
246
  Dir.chdir(tar_path) do
227
- sh cmd.join(' '), verbose: debug
247
+ sh cmd.join(' '), verbose: debug?
228
248
  end
229
249
  end
230
250
 
@@ -238,19 +258,19 @@ class OodPackaging::Package
238
258
  tar! if tar?
239
259
  container_start!
240
260
  container_exec!(exec_rake)
261
+ puts "Build SUCCESS: package=#{package} dist=#{build_box.dist}".green
241
262
  rescue RuntimeError
242
- # ret = 1
243
263
  puts "Build FAILED package=#{package} dist=#{build_box.dist}".red
244
264
  raise
245
- else
246
- puts "Build SUCCESS: package=#{package} dist=#{build_box.dist}".green
247
265
  ensure
248
266
  container_exec!(exec_attach, ['-i', '-t']) if attach?
249
- container_kill! if container_running?
267
+ container_kill! if container_running? && !attach?
250
268
  end
251
269
 
252
270
  def container_running?
253
- `#{container_runtime} inspect #{container_name} 2>/dev/null 1>/dev/null`
271
+ cmd = "#{container_runtime} inspect #{container_name} 2>/dev/null 1>/dev/null"
272
+ puts cmd if debug?
273
+ `#{cmd}`
254
274
  $CHILD_STATUS.success?
255
275
  end
256
276
 
@@ -261,9 +281,9 @@ class OodPackaging::Package
261
281
  cmd.concat container_mounts
262
282
  cmd.concat [build_box.image_tag]
263
283
  cmd.concat [container_init]
264
- cmd.concat ['1>/dev/null'] unless debug
284
+ cmd.concat ['1>/dev/null'] unless debug?
265
285
  puts "Starting container #{container_name} using image #{build_box.image_tag}".blue
266
- sh cmd.join(' '), verbose: debug
286
+ sh cmd.join(' '), verbose: debug?
267
287
  end
268
288
 
269
289
  def container_exec!(exec_cmd, extra_args = [])
@@ -275,14 +295,18 @@ class OodPackaging::Package
275
295
  cmd.concat [container_name]
276
296
  cmd.concat exec_cmd
277
297
  puts "Build STARTED: package=#{package} dist=#{build_box.dist} exec=#{exec_cmd[-1]}".blue
278
- sh cmd.join(' '), verbose: debug
298
+ sh cmd.join(' '), verbose: debug?
299
+ true
300
+ rescue RuntimeError
301
+ container_kill! if container_running? && !attach?
302
+ raise
279
303
  end
280
304
 
281
305
  def container_kill!
282
306
  puts "Killing container #{container_name}".blue
283
307
  cmd = [container_runtime, 'kill', container_name]
284
- cmd.concat ['1>/dev/null', '2>/dev/null'] unless debug
285
- sh cmd.join(' '), verbose: debug
308
+ cmd.concat [cmd_suffix] unless debug?
309
+ sh cmd.join(' '), verbose: debug?
286
310
  end
287
311
 
288
312
  def container_env
@@ -296,7 +320,7 @@ class OodPackaging::Package
296
320
  'SKIP_DOWNLOAD' => @config[:skip_download],
297
321
  'OOD_UID' => Process.uid,
298
322
  'OOD_GID' => Process.gid,
299
- 'DEBUG' => debug
323
+ 'DEBUG' => debug?
300
324
  }
301
325
  env['GPG_PUBKEY'] = '/gpg.pub' if @config[:gpg_pubkey]
302
326
  env
@@ -28,6 +28,12 @@ namespace :ood_packaging do
28
28
  @build_box.push!
29
29
  end
30
30
 
31
+ desc 'Pull buildbox image'
32
+ task :pull, [:dist] do |_task, args|
33
+ @build_box = OodPackaging::BuildBox.new(args)
34
+ @build_box.pull!
35
+ end
36
+
31
37
  desc 'Save buildbox image'
32
38
  task :save, [:dist, :path] do |_task, args|
33
39
  @build_box = OodPackaging::BuildBox.new(args)
@@ -44,8 +50,9 @@ namespace :ood_packaging do
44
50
  OodPackaging::RakeTask.new(:internal, [:package, :dist]) do |t, args|
45
51
  name = args[:package].split(':').last
46
52
  t.package = File.join(proj_root, 'packages', name)
47
- t.dist = args[:dist] || ENV['OOD_PACKAGING_DIST']
48
- t.version = OodPackaging.package_version(name, args[:dist])
53
+ dist = args[:dist] || ENV['OOD_PACKAGING_DIST']
54
+ t.dist = dist
55
+ t.version = OodPackaging.package_version(name, dist)
49
56
  t.work_dir = File.join(proj_root, 'tmp/work')
50
57
  t.output_dir = File.join(proj_root, 'tmp/output')
51
58
  end
@@ -59,7 +59,7 @@ module OodPackaging::Utils
59
59
  end
60
60
 
61
61
  def ruby_version
62
- '2.7'
62
+ '3.0'
63
63
  end
64
64
 
65
65
  def scl_ruby
@@ -2,17 +2,17 @@
2
2
 
3
3
  # Version code for OodPackaging
4
4
  module OodPackaging
5
- VERSION = '0.1.4'
5
+ VERSION = '0.4.0'
6
6
  PACKAGE_VERSION = {
7
7
  'ondemand-release' => {
8
8
  '(ubuntu|debian)' => '2.1.0',
9
- 'default' => '2.1'
9
+ 'default' => '2.1.0'
10
10
  },
11
11
  'ondemand-release-latest' => {
12
12
  '(ubuntu|debian)' => '1',
13
- 'default' => '1-6'
13
+ 'default' => '1-7'
14
14
  },
15
- 'ondemand-runtime' => '2.1',
15
+ 'ondemand-runtime' => '2.1.1',
16
16
  'passenger' => '6.0.14',
17
17
  'cjose' => '0.6.1',
18
18
  'mod_auth_openidc' => '2.4.5',
@@ -20,9 +20,9 @@ module OodPackaging
20
20
  'ondemand_exporter' => '0.9.0',
21
21
  'ondemand-compute' => {
22
22
  '(ubuntu|debian)' => '2.1.0',
23
- 'default' => '2.1'
23
+ 'default' => '2.1.0'
24
24
  },
25
- 'python-websockify' => '0.8.0',
25
+ 'python-websockify' => '0.10.0',
26
26
  'turbovnc' => '2.2.5'
27
27
  }.freeze
28
28
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ood_packaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trey Dockendorf
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-05-24 00:00:00.000000000 Z
12
+ date: 2022-06-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -83,6 +83,7 @@ files:
83
83
  - lib/ood_packaging/build_box.rb
84
84
  - lib/ood_packaging/build_box/docker-image/Dockerfile.erb
85
85
  - lib/ood_packaging/build_box/docker-image/RPM-GPG-KEY-ondemand
86
+ - lib/ood_packaging/build_box/docker-image/RPM-GPG-KEY-ondemand-SHA512
86
87
  - lib/ood_packaging/build_box/docker-image/Rakefile
87
88
  - lib/ood_packaging/build_box/docker-image/inituidgid.sh.erb
88
89
  - lib/ood_packaging/build_box/docker-image/install.sh.erb
@@ -113,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
114
  - !ruby/object:Gem::Version
114
115
  version: '0'
115
116
  requirements: []
116
- rubygems_version: 3.1.2
117
+ rubygems_version: 3.2.33
117
118
  signing_key:
118
119
  specification_version: 4
119
120
  summary: Open OnDemand packaging library