diff --git a/Puppetfile b/Puppetfile index 0f76f6a746..1c7330e662 100644 --- a/Puppetfile +++ b/Puppetfile @@ -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.2.0' +mod 'lsst/anaconda', '0.1.0' mod 'lsst/ccs_daq', '1.1.0' mod 'lsst/ccs_database', '3.1.0' mod 'lsst/ccs_hcu', '3.3.1' diff --git a/hieradata/role/hexrot.yaml b/hieradata/role/hexrot.yaml index 9c674f6a33..b834b91cf9 100644 --- a/hieradata/role/hexrot.yaml +++ b/hieradata/role/hexrot.yaml @@ -1,5 +1,6 @@ --- classes: + - "anaconda" - "mate" - "profile::core::common" - "profile::core::debugutils" @@ -7,6 +8,7 @@ classes: - "profile::core::docker::prune" - "profile::core::ni_packages" - "profile::core::x2go" + - "profile::ts::hexrot" - "profile::ts::nexusctio" files: /rubin: @@ -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" @@ -27,3 +31,20 @@ 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: + pyside2: + channel: "conda-forge" + version: "5.15.8" + qasync: + channel: "conda-forge" + version: "0.23.0" + ts-m2com: + channel: "lsstts" + version: "1.5.2" + ts-m2gui: + channel: "lsstts" + version: "0.7.8" diff --git a/site/profile/manifests/ts/hexrot.pp b/site/profile/manifests/ts/hexrot.pp new file mode 100644 index 0000000000..fcd1142cf9 --- /dev/null +++ b/site/profile/manifests/ts/hexrot.pp @@ -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 => 'develop', + keep_local_changes => false, + } + file { '/etc/profile.d/hexrot_path.sh': + ensure => file, + mode => '0644', + # lint:ignore:strict_indent + content => @(ENV), + export QT_API="PySide2" + export PYTEST_QT_API="PySide2" + 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', + } +} diff --git a/spec/hosts/roles/hexrot_spec.rb b/spec/hosts/roles/hexrot_spec.rb index 800d5ea268..969b040935 100644 --- a/spec/hosts/roles/hexrot_spec.rb +++ b/spec/hosts/roles/hexrot_spec.rb @@ -6,6 +6,8 @@ describe "#{role} role" do on_supported_os.each do |os, os_facts| + next if os =~ %r{almalinux-8-x86_64} + context "on #{os}" do let(:facts) { os_facts } let(:node_params) do @@ -32,16 +34,95 @@ it { is_expected.to contain_class('docker') } %w[ + 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 ].each do |c| it { is_expected.to contain_class(c) } end + 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: 'develop', + keep_local_changes: 'false', + ) + end + + it { is_expected.to contain_class('anaconda').with_anaconda_version('Anaconda3-2023.07-2') } + + it { is_expected.to contain_class('anaconda').with_python_env_name('py311') } + + it { is_expected.to contain_class('anaconda').with_python_env_version('3.11') } + + pkgs = { + 'pyside2' => { + 'channel' => 'conda-forge', + 'version' => '5.15.8', + }, + 'qasync' => { + 'channel' => 'conda-forge', + 'version' => '0.23.0', + }, + 'ts-m2com' => { + 'channel' => 'lsstts', + 'version' => '1.5.2', + }, + 'ts-m2gui' => { + 'channel' => 'lsstts', + 'version' => '0.7.8', + }, + } + + it { is_expected.to contain_class('anaconda').with_conda_packages(pkgs) } + it { is_expected.to contain_package('docker-compose-plugin') } + + 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