Skip to content

Commit

Permalink
Add debug utils (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
pl-buiquang authored Jan 12, 2022
1 parent 9c430d0 commit fbdff01
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
.github
venv
tests
scripts
examples
webapp/node_modules

3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ RUN ln -s /antares-launcher/antareslauncher /antareslauncher
RUN mkdir /conf/antares-launcher
RUN cp /antares-launcher/requirements.txt /conf/antares-launcher/requirements.txt

RUN ./scripts/install-debug.sh

RUN pip3 install --upgrade pip \
&& pip3 install -r /conf/requirements.txt


ENTRYPOINT ./scripts/start.sh
8 changes: 8 additions & 0 deletions scripts/install-debug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -e

python3 -m venv /debug_env
source /debug_env/bin/activate
pip3 install pystack-debugger
deactivate
6 changes: 6 additions & 0 deletions scripts/stacktrace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

source /debug_env/bin/activate
echo "Printing stacktraces"
ps aux | grep python | awk '{print $2}' | xargs -I{} bash -c "echo {}; pystack --include-greenlet {}"
echo "Done"

0 comments on commit fbdff01

Please sign in to comment.