PYROS_DOCKER_RUN
2.62 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env bash
# There should be 4 pyros* containers running
if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ]
then
echo "pyros-db or pyros weren't running, starting them..."
./PYROS_DOCKER_START.sh
#./PYROS_DOCKER_START.bat
fi
echo "LOG files :"
#
# 1) Web server
#
# - Display log on current terminal
#docker compose exec pyros python3 pyros.py start webserver $@
# - Save log in file
docker compose exec pyros python3 pyros.py -d start -o tnc -fg webserver > ../../LOG_PYROS_webserver.log 2>&1 &
#docker exec pyros python3 pyros.py -d start -o guitalens webserver >> ../../LOG_PYROS_webserver.log 2>&1 &
#docker exec pyros python3 pyros.py start webserver $@ > ../../LOG_PYROS_webserver.log 2>&1 &
#docker exec pyros python3 pyros.py start -o tnc webserver >> ../../LOG_PYROS_webserver.log 2>&1 &
echo "- Webserver LOG file is ../../LOG_PYROS_webserver.log"
# exit if webserver only
#[[ $1 == "web" ]] && exit
# Go on only if not "web"
if [[ $1 != "web" ]] ; then
#
# 2) PLC simulator
#
# - Display log on current terminal
#docker exec -it pyros bash -c "cd simulators/plc/ ; ./plcSimulator.py"
# - Save log in file
docker exec pyros bash -c "cd simulators/plc/ ; ./plcSimulator.py" > ../../LOG_PYROS_plc_simulator.log 2>&1 &
echo "- PLC simulator LOG file is ../../LOG_PYROS_plc_simulator.log"
#
# 3) AGENTS (according to TNC config)
#
# Agent Monitoring (AgentM)
# - Display log on current terminal
#docker exec -it pyros python3 pyros.py start agentM
# - Save log in file
# NEW-START
docker compose exec pyros python3 pyros.py new-start -o tnc -fg > ../../LOG_PYROS_agents.log 2>&1 &
echo "- PLC simulator LOG file is ../../LOG_PYROS_agents.log"
# START
####docker exec pyros python3 pyros.py -d start agentM -o tnc >> ../../LOG_PYROS_agent_monitoring.log 2>&1 &
#docker exec pyros python3 pyros.py -d start agentM -o "guitalens" >> ../../LOG_PYROS_agent_monitoring.log 2>&1 &
##echo "- Agent Monitoring LOG file is ../../LOG_PYROS_agent_monitoring.log"
fi
# SEE ALL PROCESSES LAUNCHED
sleep 3
./KILL_PYROS_DOCKER_RUN no
# SEE LOGS
echo
echo
echo "Pour voir les logs Pyros :"
echo
echo "tail -f ../logs/pyros.log"
echo "tail -f ../logs/pyroslog_info.log"
echo "tail -f ../logs/pyroslog_error.log"
echo "tail -f ../logs/AgentM/AgentM.log"
echo "tail -f ../logs/guitalens.log"
echo
#cd src/core/pyros_django
#docker exec -it pyros python3 src/core/pyros_django/manage.py runserver 10.121.0.11:8000
#docker exec -it pyros bash -c "cd src/ ; ls -l"
#docker exec -it pyros bash -c "cd src/core/pyros_django/ ; ./manage.py runserver 10.121.0.11:8000"
#docker exec -it pyros python3 manage.py runserver 10.121.0.11:8000 > ../../../../PYROS.log 2>&1 &