1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-27 00:55:06 +03:00

Make supervisor more consistent

Configs go in /etc, sockets in /var/run/supervisor for all invocations.
This commit is contained in:
Bill Nottingham 2020-05-28 17:38:16 -04:00
parent ec2c121762
commit 559d917184
10 changed files with 31 additions and 21 deletions

View File

@ -14,4 +14,4 @@ awx-manage collectstatic --noinput --clear
unset $(cut -d = -f -1 /etc/tower/conf.d/environment.sh) unset $(cut -d = -f -1 /etc/tower/conf.d/environment.sh)
supervisord -c /supervisor.conf supervisord -c /etc/supervisord.conf

View File

@ -1,6 +1,9 @@
[supervisord] [supervisord]
nodaemon = True nodaemon = True
umask = 022 umask = 022
logfile = /dev/stdout
logfile_maxbytes = 0
pidfile = /var/run/supervisor/supervisor.web.pid
[program:nginx] [program:nginx]
command = nginx -g "daemon off;" command = nginx -g "daemon off;"

View File

@ -1,12 +1,13 @@
[supervisord] [supervisord]
nodaemon = True nodaemon = True
umask = 022 umask = 022
logfile = /dev/stdout
logfile_maxbytes = 0
pidfile = /var/run/supervisor/supervisor.pid
[program:dispatcher] [program:dispatcher]
command = awx-manage run_dispatcher command = awx-manage run_dispatcher
directory = /var/lib/awx directory = /var/lib/awx
environment = LANGUAGE="en_US.UTF-8",LANG="en_US.UTF-8",LC_ALL="en_US.UTF-8",LC_CTYPE="en_US.UTF-8"
#user = {{ aw_user }}
autostart = true autostart = true
autorestart = true autorestart = true
stopwaitsecs = 5 stopwaitsecs = 5
@ -42,10 +43,10 @@ events=TICK_60
priority=0 priority=0
[unix_http_server] [unix_http_server]
file=/tmp/supervisor.sock file=/var/run/supervisor/supervisor.sock
[supervisorctl] [supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket serverurl=unix:///var/run/supervisor/supervisor.sock ; use a unix:// URL for a unix socket
[rpcinterface:supervisor] [rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

View File

@ -185,8 +185,8 @@ ADD tools/scripts/awx-python /usr/bin/awx-python
ADD launch_awx.sh /usr/bin/launch_awx.sh ADD launch_awx.sh /usr/bin/launch_awx.sh
ADD launch_awx_task.sh /usr/bin/launch_awx_task.sh ADD launch_awx_task.sh /usr/bin/launch_awx_task.sh
ADD settings.py /etc/tower/settings.py ADD settings.py /etc/tower/settings.py
ADD supervisor.conf /supervisor.conf ADD supervisor.conf /etc/supervisord.conf
ADD supervisor_task.conf /supervisor_task.conf ADD supervisor_task.conf /etc/supervisord_task.conf
ADD config-watcher /usr/bin/config-watcher ADD config-watcher /usr/bin/config-watcher
{% endif %} {% endif %}
@ -198,10 +198,10 @@ RUN for dir in \
/var/run/awx-rsyslog \ /var/run/awx-rsyslog \
/var/log/tower \ /var/log/tower \
/var/log/nginx \ /var/log/nginx \
/var/run/supervisor \
/var/lib/nginx ; \ /var/lib/nginx ; \
do mkdir -m 0775 -p $dir ; chmod g+rw $dir ; chgrp root $dir ; done && \ do mkdir -m 0775 -p $dir ; chmod g+rw $dir ; chgrp root $dir ; done && \
for file in \ for file in \
/supervisord.log \
/etc/passwd ; \ /etc/passwd ; \
do touch $file ; chmod g+rw $file ; chgrp root $file ; done do touch $file ; chmod g+rw $file ; chgrp root $file ; done

View File

@ -26,4 +26,4 @@ awx-manage register_queue --queuename=tower --instance_percent=100
unset $(cut -d = -f -1 /etc/tower/conf.d/environment.sh) unset $(cut -d = -f -1 /etc/tower/conf.d/environment.sh)
supervisord -c /supervisor_task.conf supervisord -c /etc/supervisord_task.conf

View File

@ -144,12 +144,12 @@ spec:
readOnly: true readOnly: true
- name: {{ kubernetes_deployment_name }}-supervisor-web-config - name: {{ kubernetes_deployment_name }}-supervisor-web-config
mountPath: "/supervisor.conf" mountPath: "/etc/supervisord.conf"
subPath: supervisor.conf subPath: supervisor.conf
readOnly: true readOnly: true
- name: {{ kubernetes_deployment_name }}-supervisor-task-config - name: {{ kubernetes_deployment_name }}-supervisor-task-config
mountPath: "/supervisor_task.conf" mountPath: "/etc/supervisord_task.conf"
subPath: supervisor_task.conf subPath: supervisor_task.conf
readOnly: true readOnly: true
@ -220,12 +220,12 @@ spec:
readOnly: true readOnly: true
- name: {{ kubernetes_deployment_name }}-supervisor-web-config - name: {{ kubernetes_deployment_name }}-supervisor-web-config
mountPath: "/supervisor.conf" mountPath: "/etc/supervisord.conf"
subPath: supervisor.conf subPath: supervisor.conf
readOnly: true readOnly: true
- name: {{ kubernetes_deployment_name }}-supervisor-task-config - name: {{ kubernetes_deployment_name }}-supervisor-task-config
mountPath: "/supervisor_task.conf" mountPath: "/etc/supervisord_task.conf"
subPath: supervisor_task.conf subPath: supervisor_task.conf
readOnly: true readOnly: true
@ -241,7 +241,7 @@ spec:
mountPath: "/var/run/memcached" mountPath: "/var/run/memcached"
env: env:
- name: SUPERVISOR_WEB_CONFIG_PATH - name: SUPERVISOR_WEB_CONFIG_PATH
value: "/supervisor.conf" value: "/etc/supervisord.conf"
- name: AWX_SKIP_MIGRATIONS - name: AWX_SKIP_MIGRATIONS
value: "1" value: "1"
- name: MY_POD_UID - name: MY_POD_UID

View File

@ -35,7 +35,7 @@ data:
unset $(cut -d = -f -1 /etc/tower/conf.d/environment.sh) unset $(cut -d = -f -1 /etc/tower/conf.d/environment.sh)
supervisord -c /supervisor_task.conf supervisord -c /etc/supervisord_task.conf
launch-awx-web: | launch-awx-web: |
#!/usr/bin/env bash #!/usr/bin/env bash
@ -54,5 +54,5 @@ data:
unset $(cut -d = -f -1 /etc/tower/conf.d/environment.sh) unset $(cut -d = -f -1 /etc/tower/conf.d/environment.sh)
supervisord -c /supervisor.conf supervisord -c /etc/supervisord.conf

View File

@ -8,6 +8,9 @@ data:
[supervisord] [supervisord]
nodaemon = True nodaemon = True
umask = 022 umask = 022
logfile = /dev/stdout
logfile_maxbytes = 0
pidfile = /var/run/supervisor/supervisor.web.pid
[program:nginx] [program:nginx]
command = nginx -g "daemon off;" command = nginx -g "daemon off;"
@ -93,6 +96,9 @@ data:
[supervisord] [supervisord]
nodaemon = True nodaemon = True
umask = 022 umask = 022
logfile = /dev/stdout
logfile_maxbytes = 0
pidfile = /var/run/supervisor/supervisor.pid
[program:dispatcher] [program:dispatcher]
command = awx-manage run_dispatcher command = awx-manage run_dispatcher
@ -133,10 +139,10 @@ data:
priority=0 priority=0
[unix_http_server] [unix_http_server]
file=/tmp/supervisor.sock file=/var/run/supervisor/supervisor.sock
[supervisorctl] [supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket serverurl=unix:///var/run/supervisor/supervisor.sock ; use a unix:// URL for a unix socket
[rpcinterface:supervisor] [rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

View File

@ -127,7 +127,7 @@ services:
http_proxy: {{ http_proxy | default('') }} http_proxy: {{ http_proxy | default('') }}
https_proxy: {{ https_proxy | default('') }} https_proxy: {{ https_proxy | default('') }}
no_proxy: {{ no_proxy | default('') }} no_proxy: {{ no_proxy | default('') }}
SUPERVISOR_WEB_CONFIG_PATH: '/supervisor.conf' SUPERVISOR_WEB_CONFIG_PATH: '/etc/supervisord.conf'
redis: redis:
image: {{ redis_image }} image: {{ redis_image }}

View File

@ -88,10 +88,10 @@ programs=awx-dispatcher,awx-receiver,awx-uwsgi,awx-daphne,awx-nginx,awx-wsbroadc
priority=5 priority=5
[unix_http_server] [unix_http_server]
file=/tmp/supervisor.sock file=/var/run/supervisor/supervisor.sock
[supervisorctl] [supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket serverurl=unix:///var/run/supervisor/supervisor.sock ; use a unix:// URL for a unix socket
[rpcinterface:supervisor] [rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface