add supervisor option to development environment

This commit is contained in:
AlanCoding 2017-02-12 16:13:15 -05:00
parent 3f0c42c1f6
commit d1a71fb7be
5 changed files with 88 additions and 1 deletions

1
.gitignore vendored
View File

@ -112,3 +112,4 @@ local/
awx/lib/.deps_built
awx/lib/site-packages
venv/*
use_dev_supervisor.txt

View File

@ -378,6 +378,12 @@ server: server_noattach
servercc: server_noattach
tmux -2 -CC attach-session -t tower
supervisor:
@if [ "$(VENV_BASE)" ]; then \
. $(VENV_BASE)/tower/bin/activate; \
fi; \
supervisord --configuration /supervisor.conf --pidfile=/tmp/supervisor_pid
# Alternate approach to tmux to run all development tasks specified in
# Procfile. https://youtu.be/OPMgaibszjk
honcho:

View File

@ -19,6 +19,7 @@ RUN mkdir -p /etc/tower
RUN mkdir -p /data/db
ADD tools/docker-compose/license /etc/tower/license
RUN pip2 install honcho
RUN pip2 install supervisor
RUN curl -LO https://github.com/Yelp/dumb-init/releases/download/v1.1.3/dumb-init_1.1.3_amd64 && chmod +x ./dumb-init_1.1.3_amd64 && mv ./dumb-init_1.1.3_amd64 /usr/bin/dumb-init
ADD tools/docker-compose/ansible-tower.egg-link /tmp/ansible-tower.egg-link
ADD tools/docker-compose/tower-manage /usr/local/bin/tower-manage

View File

@ -25,6 +25,7 @@ fi
cp -nR /tmp/ansible_tower.egg-info /tower_devel/ || true
cp /tmp/ansible-tower.egg-link /venv/tower/lib/python2.7/site-packages/ansible-tower.egg-link
yes | cp -rf /tower_devel/tools/docker-compose/supervisor.conf /supervisor.conf
# Tower bootstrapping
make version_file
@ -35,4 +36,9 @@ mkdir -p /tower_devel/awx/public/static
mkdir -p /tower_devel/awx/ui/static
# Start the service
make honcho
if [ -f "/tower_devel/tools/docker-compose/use_dev_supervisor.txt" ]; then
make supervisor
else
make honcho
fi

View File

@ -0,0 +1,73 @@
[supervisord]
umask = 022
minfds = 4096
nodaemon=true
[program:celeryd]
command = make celeryd
autostart = true
autorestart = true
redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
[program:receiver]
command = make receiver
autostart = true
autorestart = true
redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
[program:runworker]
command = make runworker
autostart = true
autorestart = true
redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
[program:uwsgi]
command = make uwsgi
autostart = true
autorestart = true
redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
[program:daphne]
command = make daphne
autostart = true
autorestart = true
redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
[program:factcacher]
command = make factcacher
autostart = true
autorestart = true
redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
[program:nginx]
command = make nginx
autostart = true
autorestart = true
redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
[program:flower]
command = make flower
autostart = true
autorestart = true
redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
[group:tower-processes]
programs=celeryd,receiver,runworker,uwsgi,daphne,factcacher,nginx,flower
priority=5