Puppet Class: singularity

Defined in:
manifests/init.pp

Summary

Manage Singularity

Overview

Examples:

include ::singularity

Parameters:

  • install_method (Enum['package','source']) (defaults to: 'package')

    Sets how Singularity will be installed

  • package_ensure (String) (defaults to: 'present')

    Package ensure property Only used when install_method=package

  • package_name (String) (defaults to: 'singularity')

    Singularity package name Only used when install_method=package

  • manage_epel (Boolean) (defaults to: true)

    Determines if EPEL repo should be managed Only used when install_method=package on RedHat based systems

  • version (String) (defaults to: '3.7.4')

    Version of Singularity to install Only used when install_method=source

  • source_dependencies (Array) (defaults to: [])

    Packages needed to build from source Only used when install_method=source

  • manage_go (Boolean) (defaults to: true)

    Sets if golang module should be included Only used when install_method=source

  • rebuild_on_go (Boolean) (defaults to: true)

    Sets if Singularity should be rebuilt on updates to Go via golang module Only used when install_method=source and manage_go=true

  • source_base_dir (Stdlib::Absolutepath) (defaults to: '/opt')

    Base directory of where Singularity source will be extracted Only used when install_method=source

  • source_mconfig_path (Stdlib::Absolutepath) (defaults to: '/usr/local/sbin/singularity-mconfig.sh')

    Path to source install mconfig script

  • build_flags (Hash) (defaults to: {})

    Build flags to pass to mconfig when building Singularity Only used when install_method=source

  • build_env (Hash) (defaults to: {})

    Environment variables to use when building from source Only used when install_method=source

  • prefix (Stdlib::Absolutepath) (defaults to: '/usr')

    The –prefix value when building from source Only used when install_method=source

  • localstatedir (Stdlib::Absolutepath) (defaults to: '/var')

    The –localstatedir value when building from source Only used when install_method=source

  • sysconfdir (Stdlib::Absolutepath) (defaults to: '/etc')

    The –sysconfdir value when building from source Only used when install_method=source

  • source_exec_path (String) (defaults to: '/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin')

    Set PATH when building from source Only used when install_method=source

  • plugins (Hash) (defaults to: {})

    Hash to define singularity::plugin resources

  • config_path (Stdlib::Absolutepath) (defaults to: '/etc/singularity/singularity.conf')

    Path to singularity.conf

  • config_template (String) (defaults to: 'singularity/singularity.conf.erb')

    Template used for singularity.conf

  • allow_setuid (Enum['yes','no']) (defaults to: 'yes')

    See singularity.conf: allow setuid

  • max_loop_devices (Integer) (defaults to: 256)

    See singularity.conf: max loop devices

  • allow_pid_ns (Enum['yes','no']) (defaults to: 'yes')

    See singularity.conf: allow pid ns

  • config_passwd (Enum['yes','no']) (defaults to: 'yes')

    See singularity.conf: config passwd

  • config_group (Enum['yes','no']) (defaults to: 'yes')

    See singularity.conf: config group

  • config_resolv_conf (Enum['yes','no']) (defaults to: 'yes')

    See singularity.conf: config resolv conf

  • mount_proc (Enum['yes','no']) (defaults to: 'yes')

    See singularity.conf: mount proc

  • mount_sys (Enum['yes','no']) (defaults to: 'yes')

    See singularity.conf: mount sys

  • mount_dev (Enum['yes','no']) (defaults to: 'yes')

    See singularity.conf: mount dev

  • mount_devpts (Enum['yes','no']) (defaults to: 'yes')

    See singularity.conf: mount devpts

  • mount_home (Enum['yes','no']) (defaults to: 'yes')

    See singularity.conf: mount home

  • mount_tmp (Enum['yes','no']) (defaults to: 'yes')

    See singularity.conf: mount tmp

  • mount_hostfs (Enum['yes','no']) (defaults to: 'no')

    See singularity.conf: mount hostfs

  • bind_paths (Array[Stdlib::Absolutepath]) (defaults to: ['/etc/localtime', '/etc/hosts'])

    See singularity.conf: bind paths

  • user_bind_control (Enum['yes','no']) (defaults to: 'yes')

    See singularity.conf: user bind control

  • enable_fusemount (Enum['yes','no']) (defaults to: 'yes')

    See singularity.conf: enable fusemount

  • enable_overlay (Enum['yes','no','try']) (defaults to: 'try')

    See singularity.conf: enable overlay

  • enable_underlay (Enum['yes','no','try','driver']) (defaults to: 'yes')

    See singularity.conf: enable underlay

  • mount_slave (Enum['yes','no']) (defaults to: 'yes')

    See singularity.conf: mount slave

  • sessiondir_max_size (Integer) (defaults to: 16)

    See singularity.conf: sessiondir max size

  • limit_container_owners (Optional[Array]) (defaults to: undef)

    See singularity.conf: limit container owners

  • limit_container_groups (Optional[Array]) (defaults to: undef)

    See singularity.conf: limit container groups

  • limit_container_paths (Optional[Array]) (defaults to: undef)

    See singularity.conf: limit container paths

  • allow_containers (Hash[String,Enum['yes','no']]) (defaults to: { 'squashfs' => 'yes', 'extfs' => 'yes', 'dir' => 'yes', 'encrypted' => 'yes', })

    See singularity.conf: allow containers

  • allow_net_users (Array) (defaults to: [])

    See singularity.conf: allow net users

  • allow_net_groups (Array) (defaults to: [])

    See singularity.conf: allow net groups

  • allow_net_networks (Array) (defaults to: [])

    See singularity.conf: allow net networks

  • always_use_nv (Enum['yes','no']) (defaults to: 'no')

    See singularity.conf: always use nv

  • always_use_rocm (Enum['yes','no']) (defaults to: 'no')

    See singularity.conf: always use rocm

  • root_default_capabilities (Enum['full','file','default','no']) (defaults to: 'full')

    See singularity.conf: root default capabilities

  • memory_fs_type (Enum['tmpfs','ramfs']) (defaults to: 'tmpfs')

    See singularity.conf: memory fs type

  • cni_configuration_path (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    See singularity.conf: cni configuration path

  • cni_plugin_path (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    See singularity.conf: cni plugin path

  • mksquashfs_path (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    See singularity.conf: mksquashfs path

  • mksquashfs_procs (Integer[0,default]) (defaults to: 0)

    See singularity.conf: mksquashfs procs

  • mksquashfs_mem (Optional[String[1]]) (defaults to: undef)

    See singularity.conf: mksquashfs mem

  • cryptsetup_path (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    See singularity.conf: cryptsetup path

  • shared_loop_devices (Enum['yes','no']) (defaults to: 'no')

    See singularity.conf: shared loop devices

  • image_driver (Optional[String]) (defaults to: undef)

    See singularity.conf: image driver

  • namespace_users (Array) (defaults to: [])

    List of uses to add to /etc/subuid and /etc/subgid to support user namespaces

  • namespace_begin_id (Integer) (defaults to: 65537)

    The beginning ID for /etc/subuid and /etc/subgid. The value is incremented For each user by start + namespace_id_range + 1

  • namespace_id_range (Integer) (defaults to: 65536)

    The range of UIDs/GIDs usable by a user in namespaces

  • subid_template (String) (defaults to: 'singularity/subid.erb')

    The template to use for /etc/subuid and /etc/subgid



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'manifests/init.pp', line 146

class singularity (
  Enum['package','source'] $install_method = 'package',
  # Package install
  String $package_ensure = 'present',
  String $package_name = 'singularity',
  Boolean $manage_epel = true,
  # Source install
  String $version = '3.7.4',
  Array $source_dependencies = [],
  Boolean $manage_go = true,
  Boolean $rebuild_on_go = true,
  Stdlib::Absolutepath $source_base_dir = '/opt',
  Stdlib::Absolutepath $source_mconfig_path = '/usr/local/sbin/singularity-mconfig.sh',
  Hash $build_flags = {},
  Hash $build_env = {},
  Stdlib::Absolutepath $prefix = '/usr',
  Stdlib::Absolutepath $localstatedir = '/var',
  Stdlib::Absolutepath $sysconfdir = '/etc',
  String $source_exec_path = '/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin',
  Hash $plugins = {},
  # Config
  Stdlib::Absolutepath $config_path = '/etc/singularity/singularity.conf',
  String $config_template = 'singularity/singularity.conf.erb',
  Enum['yes','no'] $allow_setuid  = 'yes',
  Integer $max_loop_devices = 256,
  Enum['yes','no'] $allow_pid_ns = 'yes',
  Enum['yes','no'] $config_passwd = 'yes',
  Enum['yes','no'] $config_group = 'yes',
  Enum['yes','no'] $config_resolv_conf = 'yes',
  Enum['yes','no'] $mount_proc = 'yes',
  Enum['yes','no'] $mount_sys = 'yes',
  Enum['yes','no'] $mount_dev = 'yes',
  Enum['yes','no'] $mount_devpts = 'yes',
  Enum['yes','no'] $mount_home = 'yes',
  Enum['yes','no'] $mount_tmp = 'yes',
  Enum['yes','no'] $mount_hostfs = 'no',
  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'] $mount_slave = 'yes',
  Integer $sessiondir_max_size = 16,
  Optional[Array] $limit_container_owners = undef,
  Optional[Array] $limit_container_groups = undef,
  Optional[Array] $limit_container_paths = undef,
  Hash[String,Enum['yes','no']] $allow_containers = {
    'squashfs' => 'yes',
    'extfs' => 'yes',
    'dir' => 'yes',
    'encrypted' => 'yes',
  },
  Array $allow_net_users = [],
  Array $allow_net_groups = [],
  Array $allow_net_networks = [],
  Enum['yes','no'] $always_use_nv = 'no',
  Enum['yes','no'] $always_use_rocm = 'no',
  Enum['full','file','default','no'] $root_default_capabilities = 'full',
  Enum['tmpfs','ramfs'] $memory_fs_type = 'tmpfs',
  Optional[Stdlib::Absolutepath] $cni_configuration_path = undef,
  Optional[Stdlib::Absolutepath] $cni_plugin_path = undef,
  Optional[Stdlib::Absolutepath] $mksquashfs_path = undef,
  Integer[0,default] $mksquashfs_procs = 0,
  Optional[String[1]] $mksquashfs_mem = undef,
  Optional[Stdlib::Absolutepath] $cryptsetup_path = undef,
  Enum['yes','no'] $shared_loop_devices = 'no',
  Optional[String] $image_driver = undef,
  Array $namespace_users = [],
  Integer $namespace_begin_id = 65537,
  Integer $namespace_id_range = 65536,
  String $subid_template = 'singularity/subid.erb',
) {

  contain "singularity::install::${install_method}"
  contain singularity::config

  Class["singularity::install::${install_method}"]
  ->Class['singularity::config']

  $plugins.each |$name, $plugin| {
    singularity::plugin { $name: * => $plugin }
  }
}