Puppet Class: profile::analytics::refinery::job::project_namespace_map

Defined in:
modules/profile/manifests/analytics/refinery/job/project_namespace_map.pp

Overview

Class profile::analytics::refinery::job::project_namespace_map

Installs a systemd timer to download the Wikimedia sitematrix project namespace map file so that other refinery jobs know about what wiki projects exist.

Parameters:

  • http_proxy (Any) (defaults to: hiera('profile::analytics::refinery::job::project_namespace_map::http_proxy', undef))
  • monitoring_enabled (Any) (defaults to: hiera('profile::analytics::refinery::job::project_namespace_map::monitoring_enabled', true))


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
# File 'modules/profile/manifests/analytics/refinery/job/project_namespace_map.pp', line 7

class profile::analytics::refinery::job::project_namespace_map(
    $http_proxy = hiera('profile::analytics::refinery::job::project_namespace_map::http_proxy', undef),
    $monitoring_enabled = hiera('profile::analytics::refinery::job::project_namespace_map::monitoring_enabled', true),
  ) {
    require ::profile::analytics::refinery

    $systemd_env = {
        'PYTHONPATH' => "\${PYTHONPATH}:${profile::analytics::refinery::path}/python",
    }

    $output_directory = '/wmf/data/raw/mediawiki/project_namespace_map'

    if $http_proxy {
        $http_proxy_option = "-p ${http_proxy}"
    } else {
        $http_proxy_option = ''
    }

    file { '/usr/local/bin/refinery-download-project-namespace-map':
        content => template('profile/analytics/refinery/job/refinery-download-project-namespace-map.sh.erb'),
        mode    => '0550',
        owner   => 'hdfs',
        group   => 'hdfs',
    }

    systemd::timer::job { 'refinery-download-project-namespace-map':
        description               => "Periodic download of the Wikimedia sitematrix project's namespace map file",
        command                   => '/usr/local/bin/refinery-download-project-namespace-map',
        interval                  => {
            'start'    => 'OnCalendar',
            'interval' => '*-*-01 00:00:00'
        },
        user                      => 'hdfs',
        environment               => $systemd_env,
        monitoring_enabled        => $monitoring_enabled,
        monitoring_contact_groups => 'analytics',
        logging_enabled           => true,
        logfile_basedir           => $::profile::analytics::refinery::log_dir,
        logfile_name              => 'syslog.log',
        logfile_owner             => 'hdfs',
        logfile_group             => 'hdfs',
        logfile_perms             => 'all',
        syslog_force_stop         => true,
        syslog_identifier         => $title,
        require                   => File['/usr/local/bin/refinery-download-project-namespace-map'],
    }

}