summaryrefslogtreecommitdiffstats
path: root/roles/pdc/backend/templates/pdcupdater.py
blob: b46ddf18d87153fd740e4adc374f2eeeb9aaa84c (plain)
1
2
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
# Configuration for the pdc-updater backend.

config = {
    # Should we turn on the realtime updater?
    'pdcupdater.enabled': True,

    {% if inventory_hostname.startswith('pdc-backend01') %}
    # Use only one thread at a time to handle messages.  If we have more than
    # one, then we can end up POSTing multiple enormous JSON blobs to the PDC
    # web frontend, and we'll send it into OOM death.  One at a time, people..
    "moksha.workers_per_consumer": 1,
    {% else %}
    "moksha.workers_per_consumer": 8,
    {% endif %}

    # Credentials to talk to PDC
    'pdcupdater.pdc': {
        {% if env == 'staging' %}
        'server': 'http://pdc-web01.stg.phx2.fedoraproject.org/rest_api/v1/',
        'token': '{{pdc_updater_api_token_stg }}',
        {% else %}
        'server': 'http://pdc-web01.phx2.fedoraproject.org/rest_api/v1/',
        'token': '{{pdc_updater_api_token_prod }}',
        {% endif %}
    },

    # Credentials to talk to FAS
    'pdcupdater.fas': {
        {% if env == 'staging' %}
        'base_url': 'https://admin.stg.fedoraproject.org/accounts',
        {% else %}
        'base_url': 'https://admin.fedoraproject.org/accounts',
        {% endif %}
        'username': '{{ fedoraDummyUser }}',
        'password': '{{ fedoraDummyUserPassword }}',
    },

    # PkgDB details
    {% if env == 'staging' %}
    'pdcupdater.pkgdb_url': 'https://admin.stg.fedoraproject.org/pkgdb',
    {% else %}
    'pdcupdater.pkgdb_url': 'https://admin.fedoraproject.org/pkgdb',
    {% endif %}

    # Koji details
    {% if env == 'staging' %}
    'pdcupdater.koji_url': 'https://koji.stg.fedoraproject.org/kojihub',
    {% else %}
    'pdcupdater.koji_url': 'http://koji01.phx2.fedoraproject.org/kojihub',
    {% endif %}
    # Use 8 threads to talk to koji in parallel.
    'pdcupdater.koji_io_threads': 8,

    # Where to find composes
    {% if env == 'staging' %}
    'pdcupdater.old_composes_url': 'https://kojipkgs.stg.fedoraproject.org/compose/',
    {% else %}
    'pdcupdater.old_composes_url': 'https://kojipkgs.fedoraproject.org/compose/',
    {% endif %}

    # Where to find the fedora-atomic json definitions.
    'pdcupdater.fedora_atomic_git_url': 'https://pagure.io/fedora-atomic/raw/master/f/',

    # We have an explicit list of these in the config so we can turn them on
    # and off individually in production if one is causing an issue.
    'pdcupdater.handlers': [
        # See CSI information on host for info on the different handlers.
        {% if inventory_hostname.startswith('pdc-backend01') %}
        'pdcupdater.handlers.compose:NewComposeHandler',
        {% elif inventory_hostname.startswith('pdc-backend02') %}
        # For MBS https://fedoraproject.org/wiki/Changes/ModuleBuildService
        'pdcupdater.handlers.modules:ModuleStateChangeHandler',
        # For https://fedoraproject.org/wiki/Changes/ArbitraryBranching
        'pdcupdater.handlers.retirement:RetireComponentHandler',
        {% elif inventory_hostname.startswith('pdc-backend03') %}
        ## https://fedoraproject.org/wiki/User:Ralph/Drafts/Infrastructure/Factory2/ModellingDeps
        #'pdcupdater.handlers.depchain.rpms:NewRPMBuildTimeDepChainHandler',
        #'pdcupdater.handlers.depchain.rpms:NewRPMRunTimeDepChainHandler',
        'pdcupdater.handlers.depchain.containers:ContainerRPMInclusionDepChainHandler',
        {% endif %}
        # This just isn't used for now.. but we can re-enable it if we need it.
        #'pdcupdater.handlers.atomic:AtomicComponentGroupHandler',
    ],

    'logging': dict(
        loggers=dict(
            pdcupdater={
                "level": "DEBUG",
                "propagate": False,
                "handlers": ["console"],
            },
            requests={
                "level": "INFO",
                "propagate": False,
                "handlers": ["console"],
            },
        )
    )
}