From 17f5c4b8e6677a20f91732356809944e1337a7e5 Mon Sep 17 00:00:00 2001 From: Hao Liu Date: Wed, 29 Mar 2023 19:06:48 -0400 Subject: [PATCH] Modify dev make target name to clarify intention these make targets are for starting the different daemons within the kube/docker development environment updating the name to make it better reflect their intention also added comments above the make target to describe what they do note: these comments show up when run `make help` --- Makefile | 53 ++++++++++--------- .../templates/supervisor_rsyslog.conf.j2 | 2 +- .../templates/supervisor_task.conf.j2 | 2 +- .../templates/supervisor_web.conf.j2 | 2 +- tools/docker-compose/supervisor.conf | 8 +-- 5 files changed, 35 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index 97071b8f0b..2a7d9b9e03 100644 --- a/Makefile +++ b/Makefile @@ -70,12 +70,6 @@ I18N_FLAG_FILE = .i18n_built VERSION PYTHON_VERSION docker-compose-sources \ .git/hooks/pre-commit github_ci_setup github_ci_runner -cache-clear: - @if [ "$(VENV_BASE)" ]; then \ - . $(VENV_BASE)/awx/bin/activate; \ - fi; \ - $(PYTHON) manage.py run_cache_clear - clean-tmp: rm -rf tmp/ @@ -223,18 +217,6 @@ daphne: fi; \ daphne -b 127.0.0.1 -p 8051 awx.asgi:channel_layer -wsrelay: - @if [ "$(VENV_BASE)" ]; then \ - . $(VENV_BASE)/awx/bin/activate; \ - fi; \ - $(PYTHON) manage.py run_wsrelay - -heartbeet: - @if [ "$(VENV_BASE)" ]; then \ - . $(VENV_BASE)/awx/bin/activate; \ - fi; \ - $(PYTHON) manage.py run_heartbeet - ## Run to start the background task dispatcher for development. dispatcher: @if [ "$(VENV_BASE)" ]; then \ @@ -242,7 +224,6 @@ dispatcher: fi; \ $(PYTHON) manage.py run_dispatcher - ## Run to start the zeromq callback receiver receiver: @if [ "$(VENV_BASE)" ]; then \ @@ -250,12 +231,6 @@ receiver: fi; \ $(PYTHON) manage.py run_callback_receiver -rsyslog-configurer: - @if [ "$(VENV_BASE)" ]; then \ - . $(VENV_BASE)/awx/bin/activate; \ - fi; \ - $(PYTHON) manage.py run_rsyslog_configurer - nginx: nginx -g "daemon off;" @@ -265,6 +240,34 @@ jupyter: fi; \ $(MANAGEMENT_COMMAND) shell_plus --notebook +## Start the rsyslog configurer process in background in development environment. +run-rsyslog-configurer: + @if [ "$(VENV_BASE)" ]; then \ + . $(VENV_BASE)/awx/bin/activate; \ + fi; \ + $(PYTHON) manage.py run_rsyslog_configurer + +## Start cache_clear process in background in development environment. +run-cache-clear: + @if [ "$(VENV_BASE)" ]; then \ + . $(VENV_BASE)/awx/bin/activate; \ + fi; \ + $(PYTHON) manage.py run_cache_clear + +## Start the wsrelay process in background in development environment. +run-wsrelay: + @if [ "$(VENV_BASE)" ]; then \ + . $(VENV_BASE)/awx/bin/activate; \ + fi; \ + $(PYTHON) manage.py run_wsrelay + +## Start the heartbeat process in background in development environment. +run-heartbeet: + @if [ "$(VENV_BASE)" ]; then \ + . $(VENV_BASE)/awx/bin/activate; \ + fi; \ + $(PYTHON) manage.py run_heartbeet + reports: mkdir -p $@ diff --git a/tools/ansible/roles/dockerfile/templates/supervisor_rsyslog.conf.j2 b/tools/ansible/roles/dockerfile/templates/supervisor_rsyslog.conf.j2 index 2f2842f01e..f225b935c5 100644 --- a/tools/ansible/roles/dockerfile/templates/supervisor_rsyslog.conf.j2 +++ b/tools/ansible/roles/dockerfile/templates/supervisor_rsyslog.conf.j2 @@ -18,7 +18,7 @@ stderr_logfile_maxbytes=0 [program:awx-rsyslog-configurer] {% if kube_dev | bool %} -command = make rsyslog-configurer +command = make run-rsyslog-configurer directory = /awx_devel {% else %} command = awx-manage run_rsyslog_configurer diff --git a/tools/ansible/roles/dockerfile/templates/supervisor_task.conf.j2 b/tools/ansible/roles/dockerfile/templates/supervisor_task.conf.j2 index 8c3a46342e..6826611e8b 100644 --- a/tools/ansible/roles/dockerfile/templates/supervisor_task.conf.j2 +++ b/tools/ansible/roles/dockerfile/templates/supervisor_task.conf.j2 @@ -24,7 +24,7 @@ stderr_logfile_maxbytes=0 [program:wsrelay] {% if kube_dev | bool %} -command = make wsrelay +command = make run-wsrelay directory = /awx_devel {% else %} command = awx-manage run_wsrelay diff --git a/tools/ansible/roles/dockerfile/templates/supervisor_web.conf.j2 b/tools/ansible/roles/dockerfile/templates/supervisor_web.conf.j2 index 1ae7dbeec5..75b536cd3f 100644 --- a/tools/ansible/roles/dockerfile/templates/supervisor_web.conf.j2 +++ b/tools/ansible/roles/dockerfile/templates/supervisor_web.conf.j2 @@ -59,7 +59,7 @@ stderr_logfile_maxbytes=0 [program:heartbeet] {% if kube_dev | bool %} -command = make heartbeet +command = make run-heartbeet directory = /awx_devel {% else %} command = awx-manage run_heartbeet diff --git a/tools/docker-compose/supervisor.conf b/tools/docker-compose/supervisor.conf index 768715c62f..e8bb858910 100644 --- a/tools/docker-compose/supervisor.conf +++ b/tools/docker-compose/supervisor.conf @@ -20,7 +20,7 @@ stdout_events_enabled = true stderr_events_enabled = true [program:awx-wsrelay] -command = make wsrelay +command = make run-wsrelay autorestart = true autorestart = true stopasgroup=true @@ -29,7 +29,7 @@ stdout_events_enabled = true stderr_events_enabled = true [program:awx-heartbeet] -command = make heartbeet +command = make run-heartbeet autorestart = true autorestart = true stopasgroup=true @@ -38,7 +38,7 @@ stdout_events_enabled = true stderr_events_enabled = true [program:awx-rsyslog-configurer] -command = make rsyslog-configurer +command = make run-rsyslog-configurer autorestart = true stopasgroup=true killasgroup=true @@ -48,7 +48,7 @@ stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 [program:awx-cache-clear] -command = make cache-clear +command = make run-cache-clear autorestart = true stopasgroup=true killasgroup=true