forked from metabrainz/acousticbrainz-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
consul_config.py.ctmpl
69 lines (56 loc) · 2.75 KB
/
consul_config.py.ctmpl
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
{{- define "KEY" -}}
{{ key (printf "docker-server-configs/AB/config.%s.json/%s" (env "DEPLOY_ENV") .) }}
{{- end -}}
{{- define "KEY_ARRAY" -}}
{{- range $index, $element := (key (printf "docker-server-configs/AB/config.%s.json/%s" (env "DEPLOY_ENV") .) | parseJSON) -}}
"{{.}}",
{{- end -}}
{{- end -}}
import os
DEBUG = False
SECRET_KEY = '''{{template "KEY" "secret_key"}}'''
{{if service "pgbouncer-acousticbrainz"}}
{{with index (service "pgbouncer-acousticbrainz") 0}}
SQLALCHEMY_DATABASE_URI = "postgresql://acousticbrainz:acousticbrainz@{{.Address}}:{{.Port}}/acousticbrainz"
POSTGRES_ADMIN_URI="postgresql://postgres@{{.Address}}:{{.Port}}/template1"
POSTGRES_ADMIN_AB_URI="postgresql://postgres@{{.Address}}:{{.Port}}/acousticbrainz"
{{end}}
{{end}}
{{if service "acousticbrainz-redis"}}
{{with index (service "acousticbrainz-redis") 0}}
REDIS_HOST = "{{.Address}}"
REDIS_PORT = {{.Port}}
REDIS_NAMESPACE = "acousticbrainz"
REDIS_NS_VERSIONS_LOCATION = '/cache_namespaces'
{{end}}
{{end}}
MUSICBRAINZ_USERAGENT = '''{{template "KEY" "musicbrainz_useragent"}}'''
MUSICBRAINZ_HOSTNAME = '''{{template "KEY" "musicbrainz_hostname"}}'''
MUSICBRAINZ_CLIENT_ID = '''{{template "KEY" "musicbrainz/client_id"}}'''
MUSICBRAINZ_CLIENT_SECRET = '''{{template "KEY" "musicbrainz/client_secret"}}'''
# Set to True if Less should be compiled in browser. Set to False if styling is pre-compiled.
COMPILE_LESS = False
LOG_SENTRY = {
'dsn':'''{{template "KEY" "sentry/dsn"}}''',
'environment': '''{{template "KEY" "sentry/environment"}}''',
'level': 'WARN',
'release': os.getenv('GIT_SHA', None),
}
DATASET_DIR = '''{{template "KEY" "dataset_dir"}}'''
FILE_STORAGE_DIR = '''{{template "KEY" "file_storage_dir"}}'''
SIMILARITY_INDEX_DIR = '''{{template "KEY" "similarity/index_dir"}}'''
# How many threads to use when building an annoy index
SIMILARITY_BUILD_NUM_JOBS = {{template "KEY" "similarity/build_n_jobs"}}
#Feature Flags
# Choose a server to perform the evaluation on
FEATURE_EVAL_LOCATION = {{template "KEY" "feature/eval_location"}}
# Choose dataset preprocessing processes
FEATURE_EVAL_FILTERING = {{template "KEY" "feature/eval_filtering"}}
# Choose settings used for model training
FEATURE_EVAL_MODEL_SELECTION = {{template "KEY" "feature/eval_model_selection"}}
# Allow submission of feedback on the quality of similarity results
FEATURE_SIMILARITY_FEEDBACK = {{template "KEY" "feature/similarity_feedback"}}
RATELIMIT_PER_IP = {{template "KEY" "ratelimit_per_ip"}} # number of requests per ip
RATELIMIT_WINDOW = {{template "KEY" "ratelimit_window"}} # window size in seconds
# maximum number of recordings in the dataset for which the download dataset button is shown
DATASET_DOWNLOAD_RECORDINGS_LIMIT = {{template "KEY" "dataset_download_recordings_limit"}}