-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmain.py
More file actions
62 lines (51 loc) · 2.01 KB
/
Copy pathmain.py
File metadata and controls
62 lines (51 loc) · 2.01 KB
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
"""
The main entry point for the application
"""
import os
import server as srv
import action as act
import orchestrators as orc
import visualizer as viz
import subprocess
helao_root = os.path.dirname(os.path.realpath(__file__))
def launcher(apis, server, action, orchestrator, visualizer, process):
for api in apis:
if api == "server":
for s in server:
cmd = [
"python", f"{api}/{s}.py"]
print(f"Starting {api}/{s}")
subprocess.Popen(cmd, cwd=helao_root, shell=True)
#ppid = p.pid
elif api == "action":
for a in action:
cmd = [
"python", f"{api}/{a}.py"]
print(f"Starting {api}/{a}")
subprocess.Popen(cmd, cwd=helao_root)
elif api == "orchestrator":
for o in orchestrator:
cmd = [
"python", f"{api}/{o}.py"]
print(f"Starting {api}/{o}.py")
subprocess.Popen(cmd, cwd=helao_root)
elif api == "visualizer":
for v in visualizer:
cmd = ["bokeh", "serve", "--show", f"{api}/{v}.py",
"--args", confPrefix, server]
subprocess.Popen(cmd, cwd=helao_root)
elif api == "process":
for p in process:
cmd = [
"python", f"{p}.py"]
subprocess.Popen(cmd, cwd=helao_root)
print(f"Starting {o}.py")
#return ppid
if __name__ == '__main__':
LAUNCH_ORDER = ["server", "action", "orchestrators", "visualizer", "process"]
server = ["autolab_server", "megsv_server", "minipump_server", "pump_server", "lang_server"]
action = ["echem", "lang_action", "minipumping", "pump_server", "pumping", "sensing_megsv"]
orchestrator = ["mischbares"]
visualizer = ["autolab_visualizer"]
process = ["process"]
launcher(LAUNCH_ORDER, server, action, orchestrator, visualizer, process)