Skip to content

Commit 76a3b38

Browse files
authored
Merge pull request #1657 from lsst-it/IT-5986_hexrot_upgrade
(role/hexrot) add/update conda packages
2 parents 6e0fbbc + 24335e3 commit 76a3b38

File tree

7 files changed

+236
-35
lines changed

7 files changed

+236
-35
lines changed

hieradata/role/hexrot.yaml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ classes:
1010
- "profile::core::x2go"
1111
- "profile::ts::hexrot"
1212
- "profile::ts::nexusctio"
13+
- "profile::util::xfce"
14+
15+
packages:
16+
- "freeglut-devel"
17+
1318
files:
1419
/rubin:
1520
ensure: "directory"
@@ -35,18 +40,39 @@ anaconda::anaconda_version: "Anaconda3-2023.07-2"
3540
anaconda::python_env_name: "py311"
3641
anaconda::python_env_version: "3.11"
3742
anaconda::conda_packages:
43+
numpy:
44+
channel: "conda-forge"
45+
version: "1.26.4"
3846
pyside6:
3947
channel: "conda-forge"
40-
version: "6.7.0"
48+
version: "6.7.2"
4149
qasync:
4250
channel: "conda-forge"
43-
version: "0.23.0"
51+
version: "0.27.1"
4452
qt6-charts:
4553
channel: "conda-forge"
46-
version: "6.7.0"
54+
version: "6.7.2"
55+
ts-guitool:
56+
channel: "lsstts"
57+
version: "0.2.5"
58+
ts-hexgui:
59+
channel: "lsstts"
60+
version: "0.4.1"
61+
ts-hexrotcomm:
62+
channel: "lsstts"
63+
version: "1.3.3"
4764
ts-m2com:
4865
channel: "lsstts"
49-
version: "1.5.6"
66+
version: "1.5.9"
5067
ts-m2gui:
5168
channel: "lsstts"
52-
version: "1.0.3"
69+
version: "1.1.4"
70+
ts-mtdomegui:
71+
channel: "lsstts"
72+
version: "0.4.4"
73+
ts-mtdomecom:
74+
channel: "lsstts"
75+
version: "0.2.4"
76+
ts-rotgui:
77+
channel: "lsstts"
78+
version: "0.4.1"

site/profile/manifests/core/ni_packages.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
$hexrot_packages = [
66
'runHexEui',
77
'runRotEui',
8+
'labview-2023-rte',
89
]
910
$packages = [
1011
'git',

site/profile/manifests/ts/hexrot.pp

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
ensure => present,
77
provider => git,
88
source => 'https://github.com/lsst-ts/ts_config_mttcs.git',
9-
revision => 'v0.12.8',
9+
revision => 'v0.16.4',
1010
keep_local_changes => false,
1111
}
1212
file { '/etc/profile.d/hexrot_path.sh':
@@ -21,24 +21,35 @@
2121
# lint:endignore
2222
require => Vcsrepo['/opt/ts_config_mttcs'],
2323
}
24-
file { '/rubin/mtm2/python':
24+
file { ['/rubin/mtm2/python', '/rubin/rotator/python', '/rubin/hexapod/python', '/rubin/dome/python']:
2525
ensure => directory,
2626
owner => 73006,
2727
group => 73006,
2828
}
29-
file { '/rubin/mtm2/python/run_m2gui':
30-
ensure => link,
31-
owner => 73006,
32-
group => 73006,
33-
target => '/opt/anaconda/envs/py311/bin/run_m2gui',
29+
30+
$symlinks = {
31+
'/rubin/mtm2/python/run_m2gui' => '/opt/anaconda/envs/py311/bin/run_m2gui',
32+
'/rubin/hexapod/python/run_hexgui' => '/opt/anaconda/envs/py311/bin/run_hexgui',
33+
'/rubin/dome/python/run_mtdomegui' => '/opt/anaconda/envs/py311/bin/run_mtdomegui',
34+
'/rubin/rotator/python/run_rotgui' => '/opt/anaconda/envs/py311/bin/run_rotgui',
3435
}
35-
file { ['/rubin/rotator', '/rubin/hexapod', '/rubin/mtm2']:
36+
37+
$symlinks.each |$source, $target| {
38+
file { $source:
39+
ensure => link,
40+
owner => 73006,
41+
group => 73006,
42+
target => $target,
43+
}
44+
}
45+
46+
file { ['/rubin/rotator', '/rubin/hexapod', '/rubin/mtm2', '/rubin/dome']:
3647
ensure => directory,
3748
owner => 73006,
3849
group => 73006,
3950
recurse => true,
4051
}
41-
file { ['/rubin/rotator/log', '/rubin/hexapod/log', '/rubin/mtm2/log']:
52+
file { ['/rubin/rotator/log', '/rubin/hexapod/log', '/rubin/mtm2/log', '/rubin/dome/log']:
4253
ensure => directory,
4354
owner => 73006,
4455
group => 73006,
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# @summary
2+
# Installs and sets Xfce
3+
#
4+
# @param wayland
5+
# Use wayland, false by default.
6+
#
7+
# @param graphical
8+
# sets systemd for graphical or text login.
9+
#
10+
class profile::util::xfce (
11+
Boolean $wayland = false,
12+
Boolean $graphical = true,
13+
) {
14+
include yum
15+
16+
yum::group { 'Xfce':
17+
ensure => present,
18+
timeout => 600,
19+
}
20+
21+
if $wayland == false {
22+
file_line { 'disable_wayland':
23+
path => '/etc/gdm/custom.conf',
24+
match => '^#?WaylandEnable=',
25+
line => 'WaylandEnable=false',
26+
}
27+
} else {
28+
file_line { 'enable_wayland':
29+
path => '/etc/gdm/custom.conf',
30+
match => '^#?WaylandEnable=',
31+
line => 'WaylandEnable=true',
32+
}
33+
}
34+
35+
if $graphical {
36+
$target = 'graphical.target'
37+
} else {
38+
$target = 'multi-user.target'
39+
}
40+
41+
exec { "set_systemd_${target}":
42+
command => "systemctl set-default ${target}",
43+
unless => "systemctl get-default | grep -q ${target}",
44+
path => ['/bin', '/usr/bin', '/sbin', '/usr/sbin'],
45+
}
46+
}

spec/classes/util/xfce_spec.rb

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# frozen_string_literal: true
2+
3+
require 'spec_helper'
4+
5+
describe 'profile::util::xfce' do
6+
on_supported_os.each do |os, os_facts|
7+
next unless os =~ %r{almalinux-9-x86_64}
8+
9+
context "on #{os}" do
10+
let(:facts) { os_facts }
11+
12+
it { is_expected.to compile.with_all_deps }
13+
14+
it {
15+
is_expected.to contain_yum__group('Xfce')
16+
.with(
17+
ensure: 'present',
18+
timeout: 600
19+
)
20+
}
21+
22+
context 'when wayland is false' do
23+
let(:params) { { wayland: false } }
24+
25+
it {
26+
is_expected.to contain_file_line('disable_wayland')
27+
.with(
28+
path: '/etc/gdm/custom.conf',
29+
match: '^#?WaylandEnable=',
30+
line: 'WaylandEnable=false'
31+
)
32+
}
33+
end
34+
35+
context 'when wayland is true' do
36+
let(:params) { { wayland: true } }
37+
38+
it {
39+
is_expected.to contain_file_line('enable_wayland')
40+
.with(
41+
path: '/etc/gdm/custom.conf',
42+
match: '^#?WaylandEnable=',
43+
line: 'WaylandEnable=true'
44+
)
45+
}
46+
end
47+
48+
context 'when graphical is true' do
49+
let(:params) { { graphical: true } }
50+
51+
it {
52+
is_expected.to contain_exec('set_systemd_graphical.target')
53+
.with(
54+
command: 'systemctl set-default graphical.target',
55+
unless: 'systemctl get-default | grep -q graphical.target',
56+
path: ['/bin', '/usr/bin', '/sbin', '/usr/sbin']
57+
)
58+
}
59+
end
60+
61+
context 'when graphical is false' do
62+
let(:params) { { graphical: false } }
63+
64+
it {
65+
is_expected.to contain_exec('set_systemd_multi-user.target')
66+
.with(
67+
command: 'systemctl set-default multi-user.target',
68+
unless: 'systemctl get-default | grep -q multi-user.target',
69+
path: ['/bin', '/usr/bin', '/sbin', '/usr/sbin']
70+
)
71+
}
72+
end
73+
end
74+
end
75+
end

spec/hosts/roles/hexrot_spec.rb

Lines changed: 62 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
include_examples 'ni_packages'
2828
include_examples 'nexusctio'
2929
it { is_expected.to contain_class('mate') }
30+
it { is_expected.to contain_class('profile::util::xfce') }
31+
it { is_expected.to contain_package('freeglut-devel') } # missing opengl lib
3032

3133
# XXX hexrot uses devicemapper, so the docker example group isn't included
3234
it do
@@ -45,31 +47,59 @@
4547
ensure: 'present',
4648
provider: 'git',
4749
source: 'https://github.com/lsst-ts/ts_config_mttcs.git',
48-
revision: 'v0.12.8',
50+
revision: 'v0.16.4',
4951
keep_local_changes: 'false'
5052
)
5153
end
5254

5355
pkgs = {
56+
'numpy' => {
57+
'channel' => 'conda-forge',
58+
'version' => '1.26.4',
59+
},
5460
'pyside6' => {
5561
'channel' => 'conda-forge',
56-
'version' => '6.7.0',
62+
'version' => '6.7.2',
5763
},
5864
'qasync' => {
5965
'channel' => 'conda-forge',
60-
'version' => '0.23.0',
66+
'version' => '0.27.1',
6167
},
6268
'qt6-charts' => {
6369
'channel' => 'conda-forge',
64-
'version' => '6.7.0',
70+
'version' => '6.7.2',
71+
},
72+
'ts-guitool' => {
73+
'channel' => 'lsstts',
74+
'version' => '0.2.5',
75+
},
76+
'ts-hexgui' => {
77+
'channel' => 'lsstts',
78+
'version' => '0.4.1',
79+
},
80+
'ts-hexrotcomm' => {
81+
'channel' => 'lsstts',
82+
'version' => '1.3.3',
6583
},
6684
'ts-m2com' => {
6785
'channel' => 'lsstts',
68-
'version' => '1.5.6',
86+
'version' => '1.5.9',
6987
},
7088
'ts-m2gui' => {
7189
'channel' => 'lsstts',
72-
'version' => '1.0.3',
90+
'version' => '1.1.4',
91+
},
92+
'ts-mtdomecom' => {
93+
'channel' => 'lsstts',
94+
'version' => '0.2.4',
95+
},
96+
'ts-mtdomegui' => {
97+
'channel' => 'lsstts',
98+
'version' => '0.4.4',
99+
},
100+
'ts-rotgui' => {
101+
'channel' => 'lsstts',
102+
'version' => '0.4.1',
73103
},
74104
}
75105

@@ -96,24 +126,35 @@
96126
)
97127
end
98128

99-
it do
100-
is_expected.to contain_file('/rubin/mtm2/python').with(
101-
ensure: 'directory',
102-
owner: '73006',
103-
group: '73006'
104-
)
129+
['/rubin/mtm2/python', '/rubin/rotator/python', '/rubin/hexapod/python', '/rubin/mtm2/python'].each do |path|
130+
it do
131+
is_expected.to contain_file(path).with(
132+
ensure: 'directory',
133+
owner: '73006',
134+
group: '73006'
135+
)
136+
end
105137
end
106138

107-
it do
108-
is_expected.to contain_file('/rubin/mtm2/python/run_m2gui').with(
109-
ensure: 'link',
110-
owner: '73006',
111-
group: '73006',
112-
target: '/opt/anaconda/envs/py311/bin/run_m2gui'
113-
)
139+
symlinks = {
140+
'/rubin/mtm2/python/run_m2gui' => '/opt/anaconda/envs/py311/bin/run_m2gui',
141+
'/rubin/hexapod/python/run_hexgui' => '/opt/anaconda/envs/py311/bin/run_hexgui',
142+
'/rubin/dome/python/run_mtdomegui' => '/opt/anaconda/envs/py311/bin/run_mtdomegui',
143+
'/rubin/rotator/python/run_rotgui' => '/opt/anaconda/envs/py311/bin/run_rotgui'
144+
}
145+
146+
symlinks.each do |source, dst|
147+
it do
148+
is_expected.to contain_file(source).with(
149+
ensure: 'link',
150+
owner: '73006',
151+
group: '73006',
152+
target: dst
153+
)
154+
end
114155
end
115156

116-
['/rubin/rotator', '/rubin/hexapod', '/rubin/mtm2'].each do |path|
157+
['/rubin/rotator', '/rubin/hexapod', '/rubin/mtm2', '/rubin/dome'].each do |path|
117158
it do
118159
is_expected.to contain_file(path).with(
119160
ensure: 'directory',
@@ -124,7 +165,7 @@
124165
end
125166
end
126167

127-
['/rubin/rotator/log', '/rubin/hexapod/log', '/rubin/mtm2/log'].each do |path|
168+
['/rubin/rotator/log', '/rubin/hexapod/log', '/rubin/mtm2/log', '/rubin/dome/log'].each do |path|
128169
it do
129170
is_expected.to contain_file(path).with(
130171
ensure: 'directory',

spec/support/spec/ni_packages.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
all_packages = [
55
'runHexEui',
66
'runRotEui',
7+
'labview-2023-rte',
78
'git',
89
'mlocate',
910
'wget',

0 commit comments

Comments
 (0)