Skip to content

Commit

Permalink
(node/hexrot) profile for hexrot
Browse files Browse the repository at this point in the history
  • Loading branch information
cbarria committed Aug 5, 2024
1 parent 8352686 commit d860977
Show file tree
Hide file tree
Showing 6 changed files with 275 additions and 9 deletions.
1 change: 1 addition & 0 deletions Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ mod 'fervid/snapd', '1.2.1' # 2021-05-31 hreinking: snapd for EAS Raspberry Pi
mod 'jamtur01/httpauth', '0.0.6'
mod 'jcpunk/irqbalance', '1.0.5'
mod 'jhoblitt/ipmi', '5.3.1'
mod 'lsst/anaconda', '0.1.0'
mod 'lsst/ccs_daq', '1.1.0'
mod 'lsst/ccs_database', '3.2.0'
mod 'lsst/ccs_hcu', '3.5.0'
Expand Down
24 changes: 24 additions & 0 deletions hieradata/role/hexrot.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
classes:
- "anaconda"
- "mate"
- "profile::core::common"
- "profile::core::debugutils"
- "profile::core::docker"
- "profile::core::docker::prune"
- "profile::core::ni_packages"
- "profile::core::x2go"
- "profile::ts::hexrot"
- "profile::ts::nexusctio"
files:
/rubin:
Expand All @@ -18,6 +20,8 @@ files:
subscribe:
- "Package[runHexEui]"
- "Package[runRotEui]"
- "Package[runM2Cntlr]"

# / on hexrot.cp was formated with xfs fstype=0 (long, long, long ago) and is
# not compatible with overlayfs[2]
profile::core::docker::storage_driver: "devicemapper"
Expand All @@ -27,3 +31,23 @@ accounts::group_list:
ensure: "present"
gid: 70014
forcelocal: true

anaconda::anaconda_version: "Anaconda3-2023.07-2"
anaconda::python_env_name: "py311"
anaconda::python_env_version: "3.11"
anaconda::conda_packages:
pyside6:
channel: "conda-forge"
version: "6.7.0"
qasync:
channel: "conda-forge"
version: "0.23.0"
qt6-charts:
channel: "conda-forge"
version: "6.7.0"
ts-m2com:
channel: "lsstts"
version: "1.5.4"
ts-m2gui:
channel: "lsstts"
version: "1.0.2"
45 changes: 45 additions & 0 deletions site/profile/manifests/ts/hexrot.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# @summary
# Sets up repos and symlinks for hexrot

class profile::ts::hexrot {
vcsrepo { '/opt/ts_config_mttcs':
ensure => present,
provider => git,
source => 'https://github.com/lsst-ts/ts_config_mttcs.git',
revision => 'v0.12.8',
keep_local_changes => false,
}
file { '/etc/profile.d/hexrot_path.sh':
ensure => file,
mode => '0644',
# lint:ignore:strict_indent
content => @(ENV),
export QT_API="PySide6"
export PYTEST_QT_API="PySide6"
export TS_CONFIG_MTTCS_DIR="/opt/ts_config_mttcs"
| ENV
# lint:endignore
require => Vcsrepo['/opt/ts_config_mttcs'],
}
file { '/rubin/mtm2/python':
ensure => directory,
owner => 73006,
group => 73006,
}
file { '/rubin/mtm2/python/run_m2gui':
ensure => link,
owner => 73006,
group => 73006,
target => '/opt/anaconda/envs/py311/bin/run_m2gui',
}
file { ['/rubin/rotator', '/rubin/hexapod', '/rubin/mtm2']:
ensure => directory,
owner => 73006,
group => 73006,
recurse => true,
}
file { ['/rubin/rotator/log', '/rubin/hexapod/log', '/rubin/mtm2/log']:
ensure => directory,
mode => '0775',
}
}
113 changes: 104 additions & 9 deletions spec/hosts/roles/hexrot_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

describe "#{role} role" do
on_supported_os.each do |os, os_facts|
next unless os =~ %r{almalinux-9-x86_64}

context "on #{os}" do
let(:facts) { os_facts }
let(:node_params) do
Expand All @@ -24,24 +26,117 @@

it { is_expected.to compile.with_all_deps }

include_examples 'debugutils'
include_examples 'common', os_facts: os_facts, site: site
include_examples 'x2go packages', os_facts: os_facts
include_examples 'ni_packages'
include_examples 'nexusctio'
it { is_expected.to contain_class('mate') }

# XXX hexrot uses devicemapper, so the docker example group isn't included
it { is_expected.to contain_class('docker') }
it do
is_expected.to contain_class('docker').with(
package_source: 'docker-ce',
socket_group: 70_014,
socket_override: false,
storage_driver: 'devicemapper',
)
end

it { is_expected.to contain_cron__job('docker_prune') }

it do
is_expected.to contain_vcsrepo('/opt/ts_config_mttcs').with(
ensure: 'present',
provider: 'git',
source: 'https://github.com/lsst-ts/ts_config_mttcs.git',
revision: 'v0.12.8',
keep_local_changes: 'false',
)
end

pkgs = {
'pyside6' => {
'channel' => 'conda-forge',
'version' => '6.7.0',
},
'qasync' => {
'channel' => 'conda-forge',
'version' => '0.23.0',
},
'qt6-charts' => {
'channel' => 'conda-forge',
'version' => '6.7.0',
},
'ts-m2com' => {
'channel' => 'lsstts',
'version' => '1.5.4',
},
'ts-m2gui' => {
'channel' => 'lsstts',
'version' => '1.0.2',
},
}

%w[
profile::core::common
profile::core::debugutils
profile::core::docker
profile::core::docker::prune
profile::core::ni_packages
].each do |c|
it { is_expected.to contain_class(c) }
it do
is_expected.to contain_class('anaconda').with(
anaconda_version: 'Anaconda3-2023.07-2',
python_env_name: 'py311',
python_env_version: '3.11',
conda_packages: pkgs,
)
end

it { is_expected.to contain_package('docker-compose-plugin') }

it do
is_expected.to contain_file('/etc/profile.d/hexrot_path.sh').with(
ensure: 'file',
mode: '0644',
content: <<~CONTENT,
export QT_API="PySide6"
export PYTEST_QT_API="PySide6"
export TS_CONFIG_MTTCS_DIR="/opt/ts_config_mttcs"
CONTENT
)
end

it do
is_expected.to contain_file('/rubin/mtm2/python').with(
ensure: 'directory',
owner: '73006',
group: '73006',
)
end

it do
is_expected.to contain_file('/rubin/mtm2/python/run_m2gui').with(
ensure: 'link',
owner: '73006',
group: '73006',
target: '/opt/anaconda/envs/py311/bin/run_m2gui',
)
end

['/rubin/rotator', '/rubin/hexapod', '/rubin/mtm2'].each do |path|
it do
is_expected.to contain_file(path).with(
ensure: 'directory',
owner: '73006',
group: '73006',
recurse: 'true',
)
end
end

['/rubin/rotator/log', '/rubin/hexapod/log', '/rubin/mtm2/log'].each do |path|
it do
is_expected.to contain_file(path).with(
ensure: 'directory',
mode: '0775',
)
end
end
end # host
end # lsst_sites
end # on os
Expand Down
72 changes: 72 additions & 0 deletions spec/support/spec/nexusctio.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# frozen_string_literal: true

shared_examples 'nexusctio' do
it do
is_expected.to contain_yumrepo('nexus-ctio').with(
'baseurl' => 'http://cagvm3.ctio.noao.edu/nexus/repository/labview-rpm/rubin/',
'gpgcheck' => false,
)
end

it do
is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-MSO').with(
ensure: 'file',
mode: '0644',
content: <<~GPG,
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.22 (GNU/Linux)
mQINBGC3zR8BEACw7AKpnTXmhvjHU5hfdBfbbdOx8azUtW3Oogr6zUcAMd0meTfj
4msB71LePoMX6WskN9RckoIJvxlIjcVPlbCe7euBDLiQL1KhuQXWK5veYIlsBYMx
agL8CA/rHEk1yfvuk9pxS7CqziRQ4laxJPnYbrOaRZevYlumyusDfGQ17x3EbM1D
N3UYvnzhla0lq/YmGSLVNgmqMV8PJSzv+iQku5MbI4ahxSCnVedOvepXdcePQPwf
/IZc/4IwquKjTNXCs+WhlMbM7T/0M1WeYm7h52UwUOlWB2pgN1ryW+iSbLCu0rBd
XJtPw4iERbhKpZmkmZJ6vrpCA+E2OFW2LIFve0N5mAUY0JkliFE34kG+FY6ZtD7z
vlF4U0AxzAOvo4zoIJcxRHjt7u4UsOIpMbBvm+B1rtbX3ZGGiZecpFhe5GONrh++
jvT4kcpKjADY4rSq583iDZ/mWF+XUozyTmqbuHxFVTjAKCNvQE0WyL9+5g9zCH1a
7AtIOSrfVP5YBHfLMiPOXpep8Pf7CaNAbSQb5JxFABYSRsLM6v2+Y3zm61dSIfeU
ZTRIFAsWG0Db5VdtdznBZnZRa5Avs6AUN9KOiVWi/D1KofZeeHU6DSfW+4Wq8vr4
Ekm8YUfQuPP6Fvre5qvytBf17MGg0vKZ7Z/ipdhs2StxFnoO+3yK2BfoKwARAQAB
tF9HUEcgTVNPIChHUEcgTVNPIHNpZ25hdHVyZSBmb3Igc3Rh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v6gAtkP02Qz7Kez8gh0W6VYQcRYOxLnmISaWf3woGx
05/9YPDdeXVApp8JHlmgLKM1nm2a2A8JsIaZpLGhBcawo1xicnU2yMSTvpgouopT
GtqYBCi14V6IEZbVzYeIz1EkT12RP7CtnWYbJN/zyenK3LMowkPigythoAY8tRzL
eO+RKR5uzsEbWmMvQkTP
=vYiw
-----END PGP PUBLIC KEY BLOCK-----
GPG
)
end
end
29 changes: 29 additions & 0 deletions spec/support/spec/ni_packages.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# frozen_string_literal: true

shared_examples 'ni_packages' do
all_packages = [
'runHexEui',
'runRotEui',
'runM2Cntlr',
'git',
'mlocate',
'wget',
'openssl-devel',
'make',
'gcc-c++',
'bzip2-devel',
'libffi-devel',
'libXinerama',
'mesa-libGL',
'libstdc++.i686',
'libXft',
'libXinerama.i686',
'mesa-libGL.i686',
]

all_packages.each do |pkg|
it { is_expected.to contain_package(pkg) }
end

it { is_expected.to contain_host('cagvm3.ctio.noao.edu').with(ip: '139.229.3.76') }
end

0 comments on commit d860977

Please sign in to comment.