Skip to content

Commit

Permalink
Major updates
Browse files Browse the repository at this point in the history
* Bump to apptainer version 1.3.3
* Drop EL7 and Debian 10 support
* Drop Puppet 6 support
* Add Puppet 8 support
  • Loading branch information
treydock committed Jul 23, 2024
1 parent f705e42 commit 2055d1a
Show file tree
Hide file tree
Showing 25 changed files with 217 additions and 175 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,21 @@ jobs:
fail-fast: false
matrix:
include:
- ruby: 2.5.9
puppet: 6
- ruby: 2.7.8
puppet: 7
fixtures: .fixtures.yml
allow_failure: false
- ruby: 2.7.6
puppet: 7
- ruby: 3.2.3
puppet: 8
fixtures: .fixtures.yml
allow_failure: false
env:
BUNDLE_WITHOUT: system_tests:release
PUPPET_GEM_VERSION: "~> ${{ matrix.puppet }}.0"
FACTER_GEM_VERSION: "< 4.0"
FIXTURES_YML: ${{ matrix.fixtures }}
name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }})
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -49,16 +48,14 @@ jobs:
fail-fast: false
matrix:
set:
- "el7"
- "el8"
- "el9"
- "debian-10"
- "debian-11"
- "ubuntu-2004"
- "ubuntu-2204"
puppet:
- "puppet6"
- "puppet7"
- "puppet8"
env:
BUNDLE_WITHOUT: development:release
BEAKER_debug: true
Expand All @@ -73,9 +70,10 @@ jobs:
run: |
set -x
sudo apt-get remove mysql-server --purge
sudo apt-get update
sudo apt-get install apparmor-profiles
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
Expand Down
5 changes: 5 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ Style/SymbolArray:
EnforcedStyle: brackets
RSpec/ImplicitSubject:
Enabled: false
Lint/BooleanSymbol:
Enabled: false
Naming/MethodParameterName:
AllowedNames:
- is
RSpec/MessageSpies:
EnforcedStyle: receive
Style/Documentation:
Expand Down
7 changes: 4 additions & 3 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
.github/workflows/ci.yaml:
acceptance_matrix:
set:
- el7
- ---el7
- el8
- el9
- debian-10
- debian-11
- ubuntu-2004
- ubuntu-2204
.gitlab-ci.yml:
delete: true
appveyor.yml:
delete: true
spec/acceptance/nodesets/ubuntu-1804.yml:
spec/acceptance/nodesets/el7.yml:
delete: true
spec/acceptance/nodesets/debian-12.yml:
delete: true
25 changes: 7 additions & 18 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,20 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')

group :development do
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-posix-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-lint-param-docs", require: false
gem "faraday", '~> 1.0', require: false
gem "github_changelog_generator", require: false
gem "voxpupuli-test", '7.0.0', require: false
gem "faraday", '~> 1.0', require: false
gem "github_changelog_generator", require: false
gem "puppet-blacksmith", require: false
gem "puppet-strings", require: false
end
group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
gem "puppet-module-win-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 4.29')
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
gem "beaker-pe", require: false
gem "beaker-hostgenerator"
gem "beaker-rspec"
gem "beaker-docker"
gem "beaker-puppet"
gem "beaker-docker", git: 'https://github.com/treydock/beaker-docker.git', branch: 'amazon-2023'
gem "beaker-puppet", git: 'https://github.com/puppetlabs/beaker-puppet.git', ref: '6063d22b6c4449df795731f5853c3c75241240c4'
gem "beaker-puppet_install_helper", require: false
gem "beaker-module_install_helper", require: false
end
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'beaker-rspec/rake_task' if Bundler.rubygems.find_name('beaker-rspec').any?
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any?
require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any?
Expand Down
2 changes: 1 addition & 1 deletion lib/facter/apptainer_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
version = nil
if Facter::Util::Resolution.which('apptainer')
version = Facter::Util::Resolution.exec('apptainer version')
version&.strip!
version = version.strip unless version.nil?
end
version
end
Expand Down
11 changes: 5 additions & 6 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,27 @@

file { 'apptainer.conf':
ensure => 'file',
path => $::apptainer::config_path,
content => template($::apptainer::config_template),
path => $apptainer::config_path,
content => template($apptainer::config_template),
owner => 'root',
group => 'root',
mode => '0644',
}

if ! empty($::apptainer::namespace_users) {
if ! empty($apptainer::namespace_users) {
file { '/etc/subuid':
ensure => 'file',
content => template($::apptainer::subid_template),
content => template($apptainer::subid_template),
owner => 'root',
group => 'root',
mode => '0644',
}
file { '/etc/subgid':
ensure => 'file',
content => template($::apptainer::subid_template),
content => template($apptainer::subid_template),
owner => 'root',
group => 'root',
mode => '0644',
}
}

}
24 changes: 19 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@
# See apptainer.conf: `limit container paths`
# @param allow_containers
# See apptainer.conf: `allow containers`
# @param allow_setuid_mount_encrypted
# See apptainer.conf `allow setuid-mount encrypted`
# @param allow_setuid_mount_squashfs
# See apptainer.conf `allow setuid-mount squashfs`
# @param allow_setuid_mount_extfs
# See apptainer.conf `allow setuid-mount extfs`
# @param allow_net_users
# See apptainer.conf: `allow net users`
# @param allow_net_groups
Expand Down Expand Up @@ -143,6 +149,10 @@
# See apptainer.conf: `download buffer size`
# @param systemd_cgroups
# See apptainer.conf: `systemd cgroups`
# @param apptheus_socket_path
# See apptainer.conf `apptheus socket path`
# @param allow_monitoring
# See apptainer.conf `allow monitoring`
# @param namespace_users
# List of uses to add to /etc/subuid and /etc/subgid to support user namespaces
# @param namespace_begin_id
Expand All @@ -156,7 +166,7 @@
class apptainer (
Enum['package','source','os'] $install_method = 'package',
Boolean $install_setuid = false,
String $version = '1.1.3',
String $version = '1.3.3',
Boolean $manage_repo = true,
Boolean $remove_singularity = false,
# Package install
Expand Down Expand Up @@ -193,10 +203,10 @@
Array[Stdlib::Absolutepath] $bind_paths = ['/etc/localtime', '/etc/hosts'],
Enum['yes','no'] $user_bind_control = 'yes',
Enum['yes','no'] $enable_fusemount = 'yes',
Enum['yes','no','try'] $enable_overlay = 'try',
Enum['yes','no','try','driver'] $enable_underlay = 'yes',
Enum['yes','no','try','driver'] $enable_overlay = 'yes',
Enum['yes','no','preferred'] $enable_underlay = 'yes',
Enum['yes','no'] $mount_slave = 'yes',
Integer $sessiondir_max_size = 16,
Integer $sessiondir_max_size = 64,
Optional[Array] $limit_container_owners = undef,
Optional[Array] $limit_container_groups = undef,
Optional[Array] $limit_container_paths = undef,
Expand All @@ -207,6 +217,9 @@
'extfs' => 'yes',
'dir' => 'yes',
},
Optional[Enum['yes','no']] $allow_setuid_mount_encrypted = undef,
Optional[Enum['yes','no','iflimited']] $allow_setuid_mount_squashfs = undef,
Optional[Enum['yes','no']] $allow_setuid_mount_extfs = undef,
Array $allow_net_users = [],
Array $allow_net_groups = [],
Array $allow_net_networks = [],
Expand All @@ -226,12 +239,13 @@
Integer[0,default] $download_part_size = 5242880,
Integer[0,default] $download_buffer_size = 32768,
Enum['yes','no'] $systemd_cgroups = 'yes',
Stdlib::Absolutepath $apptheus_socket_path = '/run/apptheus/gateway.sock',
Enum['yes','no'] $allow_monitoring = 'no',
Array $namespace_users = [],
Integer $namespace_begin_id = 65537,
Integer $namespace_id_range = 65536,
String $subid_template = 'apptainer/subid.erb',
) {

if $facts['os']['family'] == 'RedHat' and $manage_repo {
include epel
Class['epel'] -> Class["apptainer::install::${install_method}"]
Expand Down
2 changes: 0 additions & 2 deletions manifests/install/os.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
assert_private()

if $facts['os']['family'] == 'RedHat' {

package { 'apptainer':
ensure => $apptainer::version,
}
Expand All @@ -17,7 +16,6 @@
package { 'apptainer-suid':
ensure => $_suid_ensure,
}

} else {
fail('Module apptainer only supports os installs on RedHat')
}
Expand Down
38 changes: 19 additions & 19 deletions manifests/install/source.pp
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@
$build_env = ($base_build_env + $apptainer::build_env).map |$key, $value| { "${key}=${value}" }

file { 'apptainer-mconfig':
ensure => 'file',
path => $apptainer::source_mconfig_path,
owner => 'root',
group => 'root',
mode => '0755',
content => join([
ensure => 'file',
path => $apptainer::source_mconfig_path,
owner => 'root',
group => 'root',
mode => '0755',
content => join([
'#!/bin/bash',
'# File managed by Puppet, do not edit',
"cd ${source_dir}",
"./mconfig ${build_flags}",
'',
], "\n")
}
], "\n"),
}

file { $source_dir:
ensure => 'directory',
Expand All @@ -64,17 +64,17 @@
mode => '0755',
}
-> archive { 'apptainer-source':
path => "/tmp/apptainer-${apptainer::version}.tar.gz",
source => "https://github.com/apptainer/apptainer/releases/download/v${apptainer::version}/apptainer-${apptainer::version}.tar.gz",
extract => true,
extract_path => $source_dir,
extract_command => 'tar xfz %s --strip-components=1',
creates => "${source_dir}/mconfig",
cleanup => true,
user => 'root',
group => 'root',
notify => Exec['apptainer-mconfig'],
}
path => "/tmp/apptainer-${apptainer::version}.tar.gz",
source => "https://github.com/apptainer/apptainer/releases/download/v${apptainer::version}/apptainer-${apptainer::version}.tar.gz",
extract => true,
extract_path => $source_dir,
extract_command => 'tar xfz %s --strip-components=1',
creates => "${source_dir}/mconfig",
cleanup => true,
user => 'root',
group => 'root',
notify => Exec['apptainer-mconfig'],
}
exec { 'apptainer-mconfig':
path => $apptainer::source_exec_path,
environment => $build_env,
Expand Down
3 changes: 1 addition & 2 deletions manifests/plugin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,4 @@
onlyif => "apptainer plugin list | grep '${name}'",
}
}

}
}
Loading

0 comments on commit 2055d1a

Please sign in to comment.