Skip to content

Commit

Permalink
(node/hexrot) add conda install ts_m2gui
Browse files Browse the repository at this point in the history
  • Loading branch information
cbarria committed Jun 10, 2024
1 parent 9b38772 commit 0f5936f
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 0 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.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'
Expand Down
21 changes: 21 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,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"
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 => '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',
}
}
81 changes: 81 additions & 0 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 if os =~ %r{almalinux-8-x86_64}

context "on #{os}" do
let(:facts) { os_facts }
let(:node_params) do
Expand All @@ -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
Expand Down

0 comments on commit 0f5936f

Please sign in to comment.