Skip to content

Commit

Permalink
Support deployment with flowd for SciTags
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Bassi committed Oct 17, 2024
1 parent 2fa53c1 commit 0fad29d
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 2 deletions.
3 changes: 2 additions & 1 deletion data/webdav-defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ storm::webdav::file_buffer_size: 1048576
storm::webdav::voms_trust_store_dir: '/etc/grid-security/vomsdir'
storm::webdav::voms_trust_store_refresh_interval_sec: 43200
storm::webdav::voms_cache_enabled: true
storm::webdav::voms_cache_entry_lifetime_sec: 300
storm::webdav::voms_cache_entry_lifetime_sec: 300
storm::webdav::scitag: false
4 changes: 4 additions & 0 deletions files/etc/storm/flowd.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PLUGIN='np_api'
BACKEND='udp_firefly'
FLOW_MAP_API='https://www.scitags.org/api.json'
IP_DISCOVERY_ENABLED=True
2 changes: 2 additions & 0 deletions manifests/webdav.pp
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@

String $tape_wellknown_source,

Boolean $scitag,

) {
contain storm::webdav::install
contain storm::webdav::config
Expand Down
10 changes: 10 additions & 0 deletions manifests/webdav/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@
notice('Empty storage area list. No storage area has been defined and initialized.')
}

if $storm::webdav::scitag {
file { '/etc/flowd/flowd.cfg' :
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
source => "puppet:///modules/storm/etc/storm/flowd.cfg",
}
}

# Directory '/etc/systemd/system/storm-webdav.service.d' is created by rpm
$service_dir='/etc/systemd/system/storm-webdav.service.d'

Expand Down
14 changes: 14 additions & 0 deletions manifests/webdav/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,18 @@
package { 'storm-webdav':
ensure => '>=1.4.2',
}
if $storm::webdav::scitag {
$el = $facts['os']['distro']['release']['major']
yumrepo { 'scitags-repo':
ensure => present,
descr => 'SciTags stable repo',
enabled => 1,
gpgcheck => 0,
baseurl => "https://linuxsoft.cern.ch/repos/scitags${el}al-stable/x86_64/os/",
}
package { 'python3-scitags':
ensure => 'installed',
require => Yumrepo['scitags-repo'],
}
}
}
6 changes: 6 additions & 0 deletions manifests/webdav/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@
ensure => running,
enable => true,
}
if $storm::webdav::scitag {
service { 'flowd':
ensure => running,
enable => true,
}
}
}
7 changes: 7 additions & 0 deletions spec/classes/storm/storm_webdav_install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
describe 'storm::webdav::install' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:pre_condition) do
<<-EOF
class { 'storm::webdav':
scitag => false,
}
EOF
end
let(:facts) do
facts
end
Expand Down
5 changes: 5 additions & 0 deletions spec/classes/storm/storm_webdav_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
context "on #{os}" do
let(:pre_condition) do
'include storm::webdav::install'
<<-EOF
class { 'storm::webdav':
scitag => false,
}
EOF
end

let(:facts) do
Expand Down
39 changes: 39 additions & 0 deletions spec/classes/storm/storm_webdav_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
'voms_trust_store_refresh_interval_sec' => 43201,
'voms_cache_enabled' => false,
'voms_cache_entry_lifetime_sec' => 301,

'scitag' => false,
}
end

Expand Down Expand Up @@ -302,6 +304,43 @@
)
end
end

context 'Check deployment with SciTag support' do
let(:params) do
{
'scitag' => true,
}
end

case facts[:operatingsystemmajrelease]
when '9'
it 'scitags-repo is installed and enabled' do
is_expected.to contain_yumrepo('scitags-repo').with(
ensure: 'present',
baseurl: 'https://linuxsoft.cern.ch/repos/scitags9al-stable/x86_64/os/',
enabled: 1,
gpgcheck: 0,
)
end
end
it 'check sysconfig file' do
service_file = '/etc/systemd/system/storm-webdav.service.d/storm-webdav.conf'
is_expected.to contain_file(service_file).with(
ensure: 'file',
)
is_expected.to contain_file(service_file).with(content: %r{Environment="STORM_WEBDAV_SCITAG_ENABLED=true"})
end
it 'check flowd configuration files' do
flowd_cfg_file = '/etc/flowd/flowd.cfg'
is_expected.to contain_file(flowd_cfg_file).with(
ensure: 'file',
)
end
it 'check flowd rpm is installed' do
is_expected.to contain_package('python3-scitags')
end
it { is_expected.to contain_service('flowd').with(ensure: 'running') }
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,8 @@ Environment="STORM_WEBDAV_VOMS_CACHE_ENABLE=<%=scope.lookupvar('storm::webdav::v

# Cache entries lifetime, used if caching for VOMS certificate validation is enabled
# Default: 300
Environment="STORM_WEBDAV_VOMS_CACHE_ENTRY_LIFETIME_SEC=<%=scope.lookupvar('storm::webdav::voms_cache_entry_lifetime_sec')%>"
Environment="STORM_WEBDAV_VOMS_CACHE_ENTRY_LIFETIME_SEC=<%=scope.lookupvar('storm::webdav::voms_cache_entry_lifetime_sec')%>"

# Enable SciTags support
# Default: false
Environment="STORM_WEBDAV_SCITAG_ENABLED=<%=scope.lookupvar('storm::webdav::scitag')%>"

0 comments on commit 0fad29d

Please sign in to comment.