forked from mushkevych/scheduler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.py
111 lines (95 loc) · 3.68 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
ENVIRONMENT = '%ENVIRONMENT%'
from datetime import datetime
# folder locations, connection properties etc
settings = dict(
process_prefix='Synergy', # global prefix that is added to every process name started for synergy-scheduler
process_cwd='/mnt/tmp', # daemonized process working directory, where it can create .cache and other folders
config_file='/etc/synergy-scheduler.conf',
version='%BUILD_NUMBER%-%SVN_REVISION%',
log_directory='/mnt/logs/synergy-scheduler/',
pid_directory='/mnt/logs/synergy-scheduler/',
remote_source_host_list=['[email protected]'],
remote_source_password={'[email protected]': '***SSH_PASSWORD***'},
remote_source_folder='/mnt/remote_folder/',
bash_runnable_count=5,
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,
ds_type='mongo_db',
mongo_db_name='scheduler',
hadoop_command='/usr/bin/hadoop',
pig_command='/usr/bin/pig',
bash_command='/bin/bash',
mx_host='0.0.0.0', # management extension host (0.0.0.0 opens all interfaces)
mx_port=5000, # management extension port
mx_children_limit=168, # maximum number of children at any given level returned by MX
perf_ticker_interval=30, # seconds between performance ticker messages
debug=False, # if True - logger is given additional "console" adapter
under_test=False
)
# 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',
'event_stream_generator',
'mq',
'supervisor',
'scheduler',
'system',
'workers',
]
test_cases = [
'tests.test_regular_pipeline',
#'tests.test_decorator',
'tests.test_publishers_pool',
'tests.test_discrete_pipeline',
'tests.test_garbage_collector',
'tests.test_system_collections',
'tests.test_system_utils',
'tests.test_two_level_tree',
'tests.test_three_level_tree',
'tests.test_four_level_tree',
'tests.test_raw_data',
'tests.test_site_statistics',
'tests.test_single_session',
'tests.test_time_helper',
'tests.test_repeat_timer',
'tests.test_process_context',
'tests.test_site_hourly_aggregator',
'tests.test_tree_node',
'tests.test_event_clock',
]
def enable_test_mode():
if settings['under_test']:
# test mode is already enabled
return
test_settings = dict(
mongo_db_name=settings['mongo_db_name'] + '_test',
mq_vhost='/unit_test',
debug=True,
under_test=True,
synergy_start_timeperiod=datetime.utcnow().strftime('%Y%m%d%H'),
# legacy settings
hadoop_jar='/home/bmushkevych/git/synergy-hadoop/dist/synergy-hadoop-02.jar',
construction_hosts=['https://***REST_INTERFACE_URL***'], # production access
construction_login='***REST_INTERFACE_LOGIN***', # production access ONLY
construction_password='***REST_INTERFACE_PWD***', # production access ONLY
tunnel_host='***SURUS_HOST***',
tunnel_site_port=9988, # SURUS PORTS
bulk_threshold=1024,
)
settings.update(test_settings)
from tests.ut_context import register_processes
register_processes()