Blame view

docker/PYROS_DOCKER_RUN 2.68 KB
e64cdd09   ALEXIS-PC\alexis   improving check a...
1
#!/usr/bin/env bash
e1e75163   Alexis Koralewski   fixing issue with...
2

a1cd846d   Alexis Koralewski   add export on pyr...
3
4
5
export CURRENT_UID=$(id -u)
export COMPUTER_HOSTNAME=$HOSTNAME

6dc9142b   Etienne Pallier   legeres adaptations
6
# There should be 4 pyros* containers running
e1d22a59   Alexis Koralewski   Change redis cont...
7
if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ]
e1e75163   Alexis Koralewski   fixing issue with...
8
then
ec4214ff   Alexis Koralewski   Renaming pyros co...
9
    echo "pyros-db or pyros weren't running, starting them..."
b1e4e4dd   Etienne Pallier   Renamed scripts P...
10
    ./PYROS_DOCKER_START
2da110b4   Etienne Pallier   fix call to START...
11
    #./PYROS_DOCKER_START.bat
e1e75163   Alexis Koralewski   fixing issue with...
12
fi
a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
13

f4659764   Etienne Pallier   new AgentC qui he...
14
15
echo "LOG files :"

6dc9142b   Etienne Pallier   legeres adaptations
16
#
a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
17
# 1) Web server
6dc9142b   Etienne Pallier   legeres adaptations
18
#
a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
19
# - Display log on current terminal
1b11a72f   Alexis Koralewski   Update docker scr...
20
#docker compose exec pyros python3 pyros.py start webserver $@
a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
21
# - Save log in file
23a61124   Alexis Koralewski   Change obsconfig ...
22
docker compose exec pyros python3 pyros.py -d start -o tnc -fg webserver > ../../LOG_PYROS_webserver.log 2>&1 &
7ee2f75f   Etienne Pallier   changed PYROS_DOC...
23
#docker exec pyros python3 pyros.py -d start -o guitalens webserver >> ../../LOG_PYROS_webserver.log 2>&1 &
0e02606c   Etienne Pallier   Changed version n...
24
#docker exec pyros python3 pyros.py start webserver $@ > ../../LOG_PYROS_webserver.log 2>&1 &
12451fde   Etienne Pallier   Amélioration logging
25
#docker exec pyros python3 pyros.py start -o tnc webserver >> ../../LOG_PYROS_webserver.log 2>&1 &
f4659764   Etienne Pallier   new AgentC qui he...
26
echo "- Webserver LOG file is ../../LOG_PYROS_webserver.log"
a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
27

085e388b   Etienne Pallier   added option web ...
28
29
30
31
32
33
# exit if webserver only
#[[ $1 == "web" ]] && exit

# Go on only if not "web"
if [[ $1 != "web" ]] ; then

6dc9142b   Etienne Pallier   legeres adaptations
34
#
a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
35
# 2) PLC simulator
6dc9142b   Etienne Pallier   legeres adaptations
36
#
a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
37
38
39
# - Display log on current terminal
#docker exec -it pyros bash -c "cd simulators/plc/ ; ./plcSimulator.py"
# - Save log in file
6dc9142b   Etienne Pallier   legeres adaptations
40
docker exec pyros bash -c "cd simulators/plc/ ; ./plcSimulator.py" > ../../LOG_PYROS_plc_simulator.log 2>&1 &
f4659764   Etienne Pallier   new AgentC qui he...
41
echo "- PLC simulator LOG file is ../../LOG_PYROS_plc_simulator.log"
a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
42

6dc9142b   Etienne Pallier   legeres adaptations
43
44
45
46
#
# 3) AGENTS (according to TNC config)
#
# Agent Monitoring (AgentM)
a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
47
48
49
# - Display log on current terminal
#docker exec -it pyros python3 pyros.py start agentM
# - Save log in file
4e617db5   Etienne Pallier   added computer fo...
50
# NEW-START
23a61124   Alexis Koralewski   Change obsconfig ...
51
docker compose exec pyros python3 pyros.py new-start -o tnc -fg > ../../LOG_PYROS_agents.log 2>&1 &
ed0f85e2   Etienne Pallier   bugfix KILL_PYROS no
52
echo "- PLC simulator LOG file is ../../LOG_PYROS_agents.log"
4e617db5   Etienne Pallier   added computer fo...
53
54
# START
####docker exec pyros python3 pyros.py -d start agentM -o tnc >> ../../LOG_PYROS_agent_monitoring.log 2>&1 &
7ee2f75f   Etienne Pallier   changed PYROS_DOC...
55
#docker exec pyros python3 pyros.py -d start agentM -o "guitalens" >> ../../LOG_PYROS_agent_monitoring.log 2>&1 &
6dc9142b   Etienne Pallier   legeres adaptations
56
##echo "- Agent Monitoring LOG file is ../../LOG_PYROS_agent_monitoring.log"
a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
57

085e388b   Etienne Pallier   added option web ...
58
59
60
61
fi



bd061de2   Etienne Pallier   bugfix KILL_PYROS...
62
# SEE ALL PROCESSES LAUNCHED
085e388b   Etienne Pallier   added option web ...
63
sleep 3
bd061de2   Etienne Pallier   bugfix KILL_PYROS...
64
65
66
./KILL_PYROS_DOCKER_RUN no


78c90a83   Etienne Pallier   ajout chemin vers...
67
68
69
70
71
# SEE LOGS
echo
echo
echo "Pour voir les logs Pyros :"
echo
c9db1999   Etienne Pallier   ajout commentaire...
72
echo "tail -f ../logs/pyros.log"
78c90a83   Etienne Pallier   ajout chemin vers...
73
74
75
echo "tail -f ../logs/pyroslog_info.log"
echo "tail -f ../logs/pyroslog_error.log"
echo "tail -f ../logs/AgentM/AgentM.log"
c9db1999   Etienne Pallier   ajout commentaire...
76
77
echo "tail -f ../logs/guitalens.log"

78c90a83   Etienne Pallier   ajout chemin vers...
78
echo
bd061de2   Etienne Pallier   bugfix KILL_PYROS...
79

a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
80
81
82
83
84
#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 &
e1e75163   Alexis Koralewski   fixing issue with...