Blame view

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

#if no container is running
e64cdd09   ALEXIS-PC\alexis   improving check a...
4
if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 2 ]
e1e75163   Alexis Koralewski   fixing issue with...
5
then
da7c081d   Alexis Koralewski   remove extension ...
6
    echo "db_pyros or pyros weren't running, starting them..."
e1e75163   Alexis Koralewski   fixing issue with...
7
8
    ./PYROS_DOCKER_START.bat
fi
a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
9

f4659764   Etienne Pallier   new AgentC qui he...
10
11
echo "LOG files :"

a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
12
13
14
15
# 1) Web server
# - Display log on current terminal
#docker exec -it pyros python3 pyros.py start webserver $@
# - Save log in file
7ee2f75f   Etienne Pallier   changed PYROS_DOC...
16
17
docker exec pyros python3 pyros.py -d start -o tnc webserver >> ../../LOG_PYROS_webserver.log 2>&1 &
#docker exec pyros python3 pyros.py -d start -o guitalens webserver >> ../../LOG_PYROS_webserver.log 2>&1 &
0e02606c   Etienne Pallier   Changed version n...
18
#docker exec pyros python3 pyros.py start webserver $@ > ../../LOG_PYROS_webserver.log 2>&1 &
12451fde   Etienne Pallier   Amélioration logging
19
#docker exec pyros python3 pyros.py start -o tnc webserver >> ../../LOG_PYROS_webserver.log 2>&1 &
f4659764   Etienne Pallier   new AgentC qui he...
20
echo "- Webserver LOG file is ../../LOG_PYROS_webserver.log"
a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
21

085e388b   Etienne Pallier   added option web ...
22
23
24
25
26
27
# exit if webserver only
#[[ $1 == "web" ]] && exit

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

a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
28
29
30
31
# 2) PLC simulator
# - Display log on current terminal
#docker exec -it pyros bash -c "cd simulators/plc/ ; ./plcSimulator.py"
# - Save log in file
f4659764   Etienne Pallier   new AgentC qui he...
32
33
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"
a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
34
35
36
37
38

# 3) Agent Monitoring (AgentM)
# - Display log on current terminal
#docker exec -it pyros python3 pyros.py start agentM
# - Save log in file
7ee2f75f   Etienne Pallier   changed PYROS_DOC...
39
40
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 &
f4659764   Etienne Pallier   new AgentC qui he...
41
echo "- Agent Monitoring LOG file is ../../LOG_PYROS_agent_monitoring.log"
a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
42

085e388b   Etienne Pallier   added option web ...
43
44
45
46
fi



bd061de2   Etienne Pallier   bugfix KILL_PYROS...
47
# SEE ALL PROCESSES LAUNCHED
085e388b   Etienne Pallier   added option web ...
48
sleep 3
bd061de2   Etienne Pallier   bugfix KILL_PYROS...
49
50
51
./KILL_PYROS_DOCKER_RUN no


78c90a83   Etienne Pallier   ajout chemin vers...
52
53
54
55
56
# SEE LOGS
echo
echo
echo "Pour voir les logs Pyros :"
echo
c9db1999   Etienne Pallier   ajout commentaire...
57
echo "tail -f ../logs/pyros.log"
78c90a83   Etienne Pallier   ajout chemin vers...
58
59
60
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...
61
62
echo "tail -f ../logs/guitalens.log"

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

a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
65
66
67
68
69
#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...