mirror of
https://github.com/ansible/awx.git
synced 2026-02-25 23:16:01 -03:30
Make logs more readable in development environment
This uses https://github.com/coderanger/supervisor-stdout to prefix process names before log messages in the dev env
This commit is contained in:
@@ -119,7 +119,7 @@ RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master
|
|||||||
RUN curl -L -o /usr/bin/tini https://github.com/krallin/tini/releases/download/v0.19.0/tini-{{ tini_architecture | default('amd64') }} && \
|
RUN curl -L -o /usr/bin/tini https://github.com/krallin/tini/releases/download/v0.19.0/tini-{{ tini_architecture | default('amd64') }} && \
|
||||||
chmod +x /usr/bin/tini
|
chmod +x /usr/bin/tini
|
||||||
|
|
||||||
RUN python3.8 -m ensurepip && pip3 install "virtualenv < 20" supervisor {% if build_dev|bool %}black{% endif %}
|
RUN python3.8 -m ensurepip && pip3 install "virtualenv < 20" supervisor
|
||||||
|
|
||||||
RUN rm -rf /root/.cache && rm -rf /tmp/*
|
RUN rm -rf /root/.cache && rm -rf /tmp/*
|
||||||
|
|
||||||
@@ -153,6 +153,8 @@ RUN dnf -y install \
|
|||||||
unzip && \
|
unzip && \
|
||||||
npm install -g n && n 14.15.1 && dnf remove -y nodejs
|
npm install -g n && n 14.15.1 && dnf remove -y nodejs
|
||||||
|
|
||||||
|
RUN pip3 install black git+https://github.com/coderanger/supervisor-stdout
|
||||||
|
|
||||||
# This package randomly fails to download.
|
# This package randomly fails to download.
|
||||||
# It is nice to have in the dev env, but not necessary.
|
# It is nice to have in the dev env, but not necessary.
|
||||||
# Add it back to the list above if the repo ever straighten up.
|
# Add it back to the list above if the repo ever straighten up.
|
||||||
|
|||||||
@@ -12,8 +12,9 @@ stopsignal=KILL
|
|||||||
stopasgroup=true
|
stopasgroup=true
|
||||||
killasgroup=true
|
killasgroup=true
|
||||||
redirect_stderr=true
|
redirect_stderr=true
|
||||||
stdout_logfile=/dev/fd/1
|
stdout_events_enabled = true
|
||||||
stdout_logfile_maxbytes=0
|
stderr_events_enabled = true
|
||||||
|
|
||||||
|
|
||||||
[program:awx-receiver]
|
[program:awx-receiver]
|
||||||
command = make receiver
|
command = make receiver
|
||||||
@@ -24,8 +25,8 @@ stopsignal=KILL
|
|||||||
stopasgroup=true
|
stopasgroup=true
|
||||||
killasgroup=true
|
killasgroup=true
|
||||||
redirect_stderr=true
|
redirect_stderr=true
|
||||||
stdout_logfile=/dev/fd/1
|
stdout_events_enabled = true
|
||||||
stdout_logfile_maxbytes=0
|
stderr_events_enabled = true
|
||||||
|
|
||||||
[program:awx-wsbroadcast]
|
[program:awx-wsbroadcast]
|
||||||
command = make wsbroadcast
|
command = make wsbroadcast
|
||||||
@@ -36,8 +37,8 @@ stopsignal=KILL
|
|||||||
stopasgroup=true
|
stopasgroup=true
|
||||||
killasgroup=true
|
killasgroup=true
|
||||||
redirect_stderr=true
|
redirect_stderr=true
|
||||||
stdout_logfile=/dev/fd/1
|
stdout_events_enabled = true
|
||||||
stdout_logfile_maxbytes=0
|
stderr_events_enabled = true
|
||||||
|
|
||||||
[program:awx-uwsgi]
|
[program:awx-uwsgi]
|
||||||
command = make uwsgi
|
command = make uwsgi
|
||||||
@@ -48,8 +49,8 @@ stopwaitsecs = 1
|
|||||||
stopsignal=KILL
|
stopsignal=KILL
|
||||||
stopasgroup=true
|
stopasgroup=true
|
||||||
killasgroup=true
|
killasgroup=true
|
||||||
stdout_logfile=/dev/fd/1
|
stdout_events_enabled = true
|
||||||
stdout_logfile_maxbytes=0
|
stderr_events_enabled = true
|
||||||
|
|
||||||
[program:awx-daphne]
|
[program:awx-daphne]
|
||||||
command = make daphne
|
command = make daphne
|
||||||
@@ -60,16 +61,16 @@ stopwaitsecs = 1
|
|||||||
stopsignal=KILL
|
stopsignal=KILL
|
||||||
stopasgroup=true
|
stopasgroup=true
|
||||||
killasgroup=true
|
killasgroup=true
|
||||||
stdout_logfile=/dev/fd/1
|
stdout_events_enabled = true
|
||||||
stdout_logfile_maxbytes=0
|
stderr_events_enabled = true
|
||||||
|
|
||||||
[program:awx-nginx]
|
[program:awx-nginx]
|
||||||
command = make nginx
|
command = make nginx
|
||||||
autostart = true
|
autostart = true
|
||||||
autorestart = true
|
autorestart = true
|
||||||
redirect_stderr=true
|
redirect_stderr=true
|
||||||
stdout_logfile=/dev/fd/1
|
stdout_events_enabled = true
|
||||||
stdout_logfile_maxbytes=0
|
stderr_events_enabled = true
|
||||||
|
|
||||||
[program:awx-rsyslogd]
|
[program:awx-rsyslogd]
|
||||||
command = rsyslogd -n -i /var/run/awx-rsyslog/rsyslog.pid -f /var/lib/awx/rsyslog/rsyslog.conf
|
command = rsyslogd -n -i /var/run/awx-rsyslog/rsyslog.pid -f /var/lib/awx/rsyslog/rsyslog.conf
|
||||||
@@ -80,8 +81,8 @@ stopsignal=TERM
|
|||||||
stopasgroup=true
|
stopasgroup=true
|
||||||
killasgroup=true
|
killasgroup=true
|
||||||
redirect_stderr=true
|
redirect_stderr=true
|
||||||
stdout_logfile=/dev/fd/1
|
stdout_events_enabled = true
|
||||||
stdout_logfile_maxbytes=0
|
stderr_events_enabled = true
|
||||||
|
|
||||||
[program:awx-receptor]
|
[program:awx-receptor]
|
||||||
command = receptor --config /etc/receptor/receptor.conf
|
command = receptor --config /etc/receptor/receptor.conf
|
||||||
@@ -91,8 +92,8 @@ stopsignal = KILL
|
|||||||
stopasgroup = true
|
stopasgroup = true
|
||||||
killasgroup = true
|
killasgroup = true
|
||||||
redirect_stderr=true
|
redirect_stderr=true
|
||||||
stdout_logfile=/dev/fd/1
|
stdout_events_enabled = true
|
||||||
stdout_logfile_maxbytes=0
|
stderr_events_enabled = true
|
||||||
|
|
||||||
[group:tower-processes]
|
[group:tower-processes]
|
||||||
programs=awx-dispatcher,awx-receiver,awx-uwsgi,awx-daphne,awx-nginx,awx-wsbroadcast,awx-rsyslogd
|
programs=awx-dispatcher,awx-receiver,awx-uwsgi,awx-daphne,awx-nginx,awx-wsbroadcast,awx-rsyslogd
|
||||||
@@ -106,3 +107,9 @@ serverurl=unix:///var/run/supervisor/supervisor.sock ; use a unix:// URL for a
|
|||||||
|
|
||||||
[rpcinterface:supervisor]
|
[rpcinterface:supervisor]
|
||||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||||
|
|
||||||
|
[eventlistener:stdout]
|
||||||
|
command = supervisor_stdout
|
||||||
|
buffer_size = 100
|
||||||
|
events = PROCESS_LOG
|
||||||
|
result_handler = supervisor_stdout:event_handler
|
||||||
|
|||||||
Reference in New Issue
Block a user