forked from mushkevych/grazer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.py
95 lines (77 loc) · 2.87 KB
/
settings.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
ENVIRONMENT = '%ENVIRONMENT%'
# folder locations, connection properties etc
settings = dict(
process_prefix='Grazer', # global prefix that is added to every process name started for synergy-data
process_cwd='/mnt/tmp', # daemonized process working directory, where it can create .cache and other folders
mq_timeout_sec=300.0,
mq_queue='default_queue',
mq_routing_key='default_routing_key',
mq_exchange='default_exchange',
mq_durable=True,
mq_exclusive=False,
mq_auto_delete=False,
mq_delivery_mode=2,
mq_no_ack=False,
aws_access_key_id='***AWS_KEY***',
aws_secret_access_key='***AWS_SECRET_KEY***',
aws_s3_bucket='grazer-scrapes',
aws_redshift_grazer_prefix='ext.',
aws_redshift_grazer_suffix='',
aws_redshift_host='REDSHIFT_HOST.redshift.amazonaws.com',
aws_redshift_db='DB_NAME',
aws_redshift_user='DB_USER',
aws_redshift_password='DB_PASSWORD',
aws_redshift_port=5439,
# Hatchery defaults
grazer_worker_size='m1.small', # AWS Instance Type
grazer_worker_ami='ami-9a562df2', # Ubuntu 14.04 LTS
security_groups=['security_group_1', 'security_group_2'], # AWS Security Group strings
aws_ssh_key='aws_ssh_key_string', # SSH key on AWS account with which to provision instance
persist_storage=False, # Bool: Persist EBS storage after instance termination
log_directory='/mnt/logs/grazer/',
pid_directory='/mnt/logs/grazer/',
merge_bulk_threshold=10,
sql_bulk_threshold=1024,
csv_bulk_threshold=16384,
scrape_threads_count=5,
perf_ticker_interval=60, # seconds between performance ticker messages
debug=False, # if True - logger is given additional "console" adapter
under_test=False,
)
amazon_appstore_urls = [
'http://www.amazon.com/gp/mas/dl/android?p=%s',
]
https_proxy_list = ['']
# For now just two level... we can have configs for all deployments
# Need to have a better way for switching these
try:
overrides = __import__('settings_' + ENVIRONMENT)
except:
overrides = __import__('settings_dev')
settings.update(overrides.settings)
# Modules to test and verify (pylint/pep8)
testable_modules = [
'model',
'system',
'workers',
]
test_cases = [
'tests.test_scraper_engines',
'tests.test_scrape_reducer',
]
def enable_test_mode():
if settings['under_test']:
# test mode is already enabled
return
test_settings = dict(
mq_timeout_sec=10.0,
aws_s3_bucket=settings['aws_s3_bucket'] + '_test',
aws_redshift_grazer_suffix='_test',
mq_vhost='/unit_test',
csv_bulk_threshold=64,
debug=True,
under_test=True,
)
settings.update(test_settings)
from tests.ut_context import register_processes
register_processes()