-
Notifications
You must be signed in to change notification settings - Fork 26
/
config.py.in
111 lines (102 loc) · 3.14 KB
/
config.py.in
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
100
101
102
103
104
105
106
107
108
109
110
111
# This is a sample configuration file.
#
# Modify it to fit your environment and rename it to something like 'prod.py'
import os
import sentry_sdk
from paddles.hooks import IsolatedTransactionHook, SentryHook
from paddles import models
from paddles.hooks.cors import CorsHook
sentry_dsn = os.environ.get("SENTRY_DSN")
if sentry_dsn:
sentry_sdk.init(
sentry_dsn,
traces_sample_rate=0.1,
)
# Server Specific Configurations
server = {
'port': os.environ.get('PADDLES_SERVER_PORT', '8080'),
'host': os.environ.get('PADDLES_SERVER_HOST', '127.0.0.1')
}
statsd = {
'host': os.environ.get('PADDLES_STATSD_HOST', 'example.com'),
'prefix': os.environ.get('PADDLES_STATSD_PREFIX', 'ceph.test.teuthology.your_lab'),
}
# These values will be specific to your site
address = os.environ.get(
'PADDLES_ADDRESS',
'http://paddles.front.sepia.ceph.com'
)
job_log_href_templ = os.environ.get(
'PADDLES_JOB_LOG_HREF_TEMPL',
'http://qa-proxy.ceph.com/teuthology/{run_name}/{job_id}/teuthology.log'
)
default_latest_runs_count = 25
# Pecan Application Configurations
app = {
'root': 'paddles.controllers.root.RootController',
'modules': ['paddles'],
#'static_root': '%(confdir)s/public',
'template_path': '%(confdir)s/paddles/templates',
'default_renderer': 'json',
'guess_content_type_from_ext': False,
'debug': False,
'hooks': [
IsolatedTransactionHook(
models.start,
models.start_read_only,
models.commit,
models.rollback,
models.clear
),
# Uncomment this if you want more logging
#RequestViewerHook({'blacklist': ['/favicon.ico', '/errors/'],
# 'items':
# ['date', 'path', 'status', 'method', 'controller'],
# }),
CorsHook(),
SentryHook(),
],
}
logging = {
'version': 1,
'disable_existing_loggers': False,
'root': {'level': 'INFO', 'handlers': []},
'loggers': {
'root': {'level': 'INFO', 'handlers': ['console']},
'paddles': {'level': 'DEBUG', 'handlers': ['console']},
'sqlalchemy': {'level': 'WARN', 'handlers': ['console']},
'py.warnings': {'handlers': ['console']},
'gunicorn.error': {
'level': 'INFO',
'handlers': ['console'],
'propagate': False,
'qualname': 'gunicorn.error'
},
'__force_dict__': True
},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple'
}
},
'formatters': {
'simple': {
'format': ('%(asctime)s %(levelname)-5.5s [%(name)s]'
' %(message)s')
}
}
}
def get_sqlalchemy_url():
import subprocess
return subprocess.getoutput("pecan get_secret")
sqlalchemy = {
'url': get_sqlalchemy_url(),
# Uncomment to see SQL queries in logs
#'echo': True,
#'echo_pool': True,
'pool_recycle': 3600,
'encoding': 'utf-8',
'isolation_level': 'SERIALIZABLE', # required for correct job reporting
}