forked from CEduStartup/Pyxis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
processes.py
65 lines (49 loc) · 1.41 KB
/
processes.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
# This file contains processes definition for system launcher.
import os
from shared.Utils import port_randomizer
class process:
pid = None
command = None
depends_on = []
cwd = None
debug = 0
def __init__(self):
pass
def set_debug(self, debug):
self.debug = debug
if self.debug:
self._handle_debug()
def _handle_debug(self):
pass
class services(process):
pid = 'services'
command = 'python'
params = '%s/services/services_launcher.py' %os.environ['PYXIS_ROOT']
class _logger_console_manager(process):
pid = 'logger'
command = 'python'
params = '%s/logger/manager.py' %os.environ['PYXIS_ROOT']
class _logger_web_manager(process):
pid = 'logger'
command = 'python'
params = ['%s/logger/server.py' %os.environ['PYXIS_ROOT'], str(9997 + port_randomizer())]
class collector(process):
pid = 'collector'
command = 'python'
params = '%s/collector/collector.py' %os.environ['PYXIS_ROOT']
depends_on = [services]
class webui(process):
pid = 'webui'
command = 'python'
params = ['manage.py', 'runserver', '0.0.0.0:%s' %
(8000 + port_randomizer(),),]
cwd = '%s/webui/' % os.environ['PYXIS_ROOT']
def _handle_debug(self):
self.params.append('--settings=settings_debug')
logger = _logger_web_manager
processes = (
services(),
logger(),
webui(),
collector()
)