forked from dmwm/deployment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
81 lines (66 loc) · 3.31 KB
/
config.py
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
"""
ReqMgr only configuration file.
Everything configurable in ReqMgr is defined here.
"""
import socket
import time
from WMCore.Configuration import Configuration
from os import path
HOST = socket.gethostname().lower()
BASE_URL = "@@BASE_URL@@"
COUCH_URL = "%s/couchdb" % BASE_URL
LOG_DB_URL = "%s/t0_logdb" % COUCH_URL
ROOTDIR = __file__.rsplit('/', 3)[0]
config = Configuration()
main = config.section_("main")
srv = main.section_("server")
srv.thread_pool = 30
main.application = "t0_reqmon"
main.application_dir = "t0_reqmon"
main.port = 8243 # main application port it listens on
main.index = "ui"
# Defaults to allow any CMS authenticated user. Write APIs should require
# additional roles in SiteDB (i.e. "Admin" role for the "ReqMgr" group)
main.authz_defaults = {"role": None, "group": None, "site": None}
sec = main.section_("tools").section_("cms_auth")
sec.key_file = "%s/auth/wmcore-auth/header-auth-key" % ROOTDIR
# this is where the application will be mounted, where the REST API
# is reachable and this features in CMS web frontend rewrite rules
app = config.section_(main.application) # string containing "wmstats"
app.admin = "[email protected]"
app.description = "CMS data operations Request Manager."
app.title = "CMS T0 WMStats (T0ReqMon)"
views = config.section_("views")
# practical to have this kind of configuration values not in
# service related RPM (difficult/impossible to change in CMS web
# deployment) but in the deployment configuration for the service
# redirector for the REST API implemented handlers
data = views.section_("data")
data.object = "WMCore.WMStats.T0.Service.T0RestApiHub.T0RestApiHub"
# The couch host is defined during deployment time.
data.couch_host = COUCH_URL
# main ReqMgr CouchDB database containing all requests with spec files attached
data.couch_reqmgr_db = "t0_request"
# ReqMgr database containing groups, teams, software, etc
data.couch_workload_summary_db = "t0_workloadsummary"
data.couch_wmstats_db = "tier0_wmstats"
data.central_logdb_url = LOG_DB_URL
data.log_reporter = "tier0_wmstats"
extentions = config.section_("extensions")
# wmstats data cache update (This need to be updated for all backend since this is memory cache)
dataCacheTasks = extentions.section_("dataCacheTasks")
dataCacheTasks.object = "WMCore.WMStats.T0.CherryPyThreads.T0DataCacheUpdate.T0DataCacheUpdate"
dataCacheTasks.wmstats_url = "%s/%s" % (data.couch_host, data.couch_wmstats_db)
dataCacheTasks.reqmgrdb_url = "%s/%s" % (data.couch_host, data.couch_reqmgr_db)
dataCacheTasks.dataCacheUpdateDuration = 60 * 5 # every 5 min
dataCacheTasks.log_file = '%s/logs/t0_reqmon/dataCacheTasks-%s.log' % (__file__.rsplit('/', 4)[0], time.strftime("%Y%m%d"))
# Production/testbed instance of logdb, must be a production/testbed back-end
if HOST.startswith("vocms0307") or HOST.startswith("vocms0131"):
# LogDB task (update and clean up)
logDBTasks = extentions.section_("logDBTasks")
logDBTasks.object = "WMCore.WMStats.CherryPyThreads.LogDBTasks.LogDBTasks"
logDBTasks.central_logdb_url = data.central_logdb_url
logDBTasks.log_reporter = data.log_reporter
logDBTasks.logDBCleanDuration = 60 * 60 * 24 * 1 # 1 day
logDBTasks.logDBUpdateDuration = 60 * 10 # every 10 min
logDBTasks.log_file = '%s/logs/t0_reqmon/logDBTasks-%s.log' % (__file__.rsplit('/', 4)[0], time.strftime("%Y%m%d"))