Puppet Class: profile::toolforge::grid::master

Defined in:
modules/profile/manifests/toolforge/grid/master.pp

Overview

Parameters:

  • etcdir (Any) (defaults to: hiera('profile::toolforge::etcdir'))
  • sge_root (Any) (defaults to: lookup('profile::toolforge::grid::base::sge_root'))
  • geconf (Any) (defaults to: lookup('profile::toolforge::grid::base::geconf'))
  • collectors (Any) (defaults to: lookup('profile::toolforge::grid::base::collectors'))


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'modules/profile/manifests/toolforge/grid/master.pp', line 3

class profile::toolforge::grid::master (
    $etcdir = hiera('profile::toolforge::etcdir'),
    $sge_root = lookup('profile::toolforge::grid::base::sge_root'),
    $geconf = lookup('profile::toolforge::grid::base::geconf'),
    $collectors = lookup('profile::toolforge::grid::base::collectors'),
){
    include profile::openstack::eqiad1::clientpackages::vms
    include profile::openstack::eqiad1::observerenv
    include profile::toolforge::infrastructure

    $hostlist = '@general'

    class { '::prometheus::node_sge': }

    sonofgridengine::queue { 'task':
        config => 'profile/toolforge/grid/queue-task.erb',
    }

    sonofgridengine::queue { 'continuous':
        config => 'profile/toolforge/grid/queue-continuous.erb',
    }

    sonofgridengine::checkpoint { 'continuousckpt':
        config => 'profile/toolforge/grid/ckpt-continuous.erb',
    }

    file { "${collectors}/hostgroups":
        ensure => directory,
        owner  => 'root',
        group  => 'root',
        mode   => '0755',
    }

    file { "${collectors}/queues":
        ensure => directory,
        owner  => 'root',
        group  => 'root',
        mode   => '0755',
    }

    sonofgridengine::collectors::hostgroups { '@general':
        store => "${collectors}/hostgroups",
    }

    sonofgridengine::collectors::queues { 'webgrid-lighttpd':
        store  => "${collectors}/queues",
        config => 'profile/toolforge/grid/queue-webgrid.erb',
    }

    sonofgridengine::collectors::queues { 'webgrid-generic':
        store  => "${collectors}/queues",
        config => 'profile/toolforge/grid/queue-webgrid.erb',
    }

    # These things are done on the grid master because they
    # need to be done exactly once per project (they live on the
    # shared filesystem), and there can only be exactly one
    # gridmaster in this setup.  They could have been done on
    # any singleton instance.

    file { '/usr/local/bin/dequeugridnodes.sh':
        ensure => file,
        owner  => 'root',
        group  => 'root',
        mode   => '0555',
        source => 'puppet:///modules/profile/toolforge/gridscripts/dequeuegridnodes.sh',
    }
    file { '/usr/local/bin/requeugridnodes.sh':
        ensure => file,
        owner  => 'root',
        group  => 'root',
        mode   => '0555',
        source => 'puppet:///modules/profile/toolforge/gridscripts/requeuegridnodes.sh',
    }
    file { '/usr/local/bin/runninggridtasks.py':
        ensure => file,
        owner  => 'root',
        group  => 'root',
        mode   => '0555',
        source => 'puppet:///modules/profile/toolforge/gridscripts/runninggridtasks.py',
    }
    file { '/usr/local/bin/runninggridjobsmail.py':
        ensure => file,
        owner  => 'root',
        group  => 'root',
        mode   => '0555',
        source => 'puppet:///modules/profile/toolforge/gridscripts/runninggridjobsmail.py',
    }

    file { "${geconf}/spool":
        ensure  => directory,
        owner   => 'sgeadmin',
        group   => 'sgeadmin',
        require => File[$geconf],
    }

    file { '/var/spool/gridengine':
        ensure  => link,
        target  => "${geconf}/spool",
        force   => true,
        require => File["${geconf}/spool"],
    }

    file { '/var/spool/gridengine/qmaster':
        ensure  => directory,
        owner   => 'sgeadmin',
        group   => 'sgeadmin',
        require => File[$geconf],
    }

    file { '/var/spool/gridengine/spooldb':
        ensure  => directory,
        owner   => 'sgeadmin',
        group   => 'sgeadmin',
        require => File[$geconf],
    }

    class { '::sonofgridengine::master':
        etcdir  => $etcdir,
    }

    file { "${geconf}/default/common/shadow_masters":
        ensure => present,
        owner  => 'sgeadmin',
        group  => 'sgeadmin',
        mode   => '0555',
    } -> file_line { 'shadow_masters':
        ensure => present,
        line   => $facts['fqdn'],
        path   => "${geconf}/default/common/shadow_masters",
    }

    file { "${etcdir}/config/global":
        ensure => file,
        owner  => 'sgeadmin',
        group  => 'sgeadmin',
        mode   => '0664',
        source => 'puppet:///modules/profile/toolforge/grid-global-config',
    }

    file { "${etcdir}/config/scheduler":
        ensure => file,
        owner  => 'sgeadmin',
        group  => 'sgeadmin',
        mode   => '0664',
        source => 'puppet:///modules/profile/toolforge/grid-scheduler-config',
    }

    file { '/usr/local/sbin/exec-manage':
        ensure => file,
        owner  => 'root',
        group  => 'root',
        mode   => '0655',
        source => 'puppet:///modules/profile/toolforge/exec-manage',
    }

    exec { 'update-global-config':
        command     => "/usr/bin/qconf -Mconf ${etcdir}/config/global",
        subscribe   => File["${etcdir}/config/global"],
        refreshonly => true,
    }

    exec { 'update-scheduler-config':
        command     => "/usr/bin/qconf -Msconf ${etcdir}/config/scheduler",
        subscribe   => File["${etcdir}/config/scheduler"],
        refreshonly => true,
    }

    class { 'sonofgridengine::logrotate':
        ensure   => 'present',
        sge_root => $sge_root,
    }
}