diff options
author | Alan Rominger <arominge@redhat.com> | 2025-01-02 22:19:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-02 22:19:59 +0100 |
commit | 2657ea840b8c6eb2890c6866ae0ccfc1713bcfd4 (patch) | |
tree | 8c7e6b829cd915562807c2a679d55f517cca847e | |
parent | Bugfix: adjust incorrectly passed keywords with exclude-strings argument (#15... (diff) | |
download | awx-2657ea840b8c6eb2890c6866ae0ccfc1713bcfd4.tar.xz awx-2657ea840b8c6eb2890c6866ae0ccfc1713bcfd4.zip |
Disable color logs in CI (#15719)
* Disable color logs in CI
* Disable management command color
-rw-r--r-- | .github/actions/run_awx_devel/action.yml | 4 | ||||
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | tools/docker-compose/README.md | 16 | ||||
-rw-r--r-- | tools/docker-compose/ansible/roles/sources/templates/docker-compose.yml.j2 | 3 | ||||
-rwxr-xr-x | tools/docker-compose/launch_awx.sh | 5 |
5 files changed, 20 insertions, 14 deletions
diff --git a/.github/actions/run_awx_devel/action.yml b/.github/actions/run_awx_devel/action.yml index e98e6479e2..b7d11cf17d 100644 --- a/.github/actions/run_awx_devel/action.yml +++ b/.github/actions/run_awx_devel/action.yml @@ -34,7 +34,9 @@ runs: run: | DEV_DOCKER_OWNER=${{ github.repository_owner }} \ COMPOSE_TAG=${{ github.base_ref || github.ref_name }} \ - COMPOSE_UP_OPTS="-d" \ + DJANGO_COLORS=nocolor \ + SUPERVISOR_ARGS="-n -t" \ + COMPOSE_UP_OPTS="-d --no-color" \ make docker-compose - name: Update default AWX password @@ -222,12 +222,6 @@ migrate: dbchange: $(MANAGEMENT_COMMAND) makemigrations -supervisor: - @if [ "$(VENV_BASE)" ]; then \ - . $(VENV_BASE)/awx/bin/activate; \ - fi; \ - supervisord --pidfile=/tmp/supervisor_pid -n - collectstatic: @if [ "$(VENV_BASE)" ]; then \ . $(VENV_BASE)/awx/bin/activate; \ diff --git a/tools/docker-compose/README.md b/tools/docker-compose/README.md index 6b4014a699..499de97ca3 100644 --- a/tools/docker-compose/README.md +++ b/tools/docker-compose/README.md @@ -48,13 +48,21 @@ The docker-compose development environment is regularly used and should work on Use on other platforms is untested, and may require local changes. -## Configuration +### How to Disable Color? -In the [`inventory` file](./inventory), set your `pg_password`, `broadcast_websocket_secret`, `secret_key`, and any other settings you need for your deployment. +There are several layers that might apply color: + - docker compose coloring based on what container log comes from + - supervisord coloring based on what server it comes from + - general coloration from Django management commands -AWX requires access to a PostgreSQL database, and by default, one will be created and deployed in a container, and data will be persisted to a docker volume. When the container is stopped, the database files will still exist in the docker volume. An external database can be used by setting the `pg_host`, `pg_hostname`, and `pg_username`. +These can have color turned off by adding things to the +environment variable to modify the call options. -> If you are coming from a Local Docker installation of AWX, consider migrating your data first, see the [data migration section](#migrating-data-from-local-docker) below. +``` +DJANGO_COLORS=nocolor COMPOSE_UP_OPTS="--no-color" SUPERVISOR_ARGS="-n -t" make docker-compose +``` + +This can be useful if this is ran in CI in any context. ## Starting the Development Environment diff --git a/tools/docker-compose/ansible/roles/sources/templates/docker-compose.yml.j2 b/tools/docker-compose/ansible/roles/sources/templates/docker-compose.yml.j2 index 58bdc6b80d..9f3a9b7815 100644 --- a/tools/docker-compose/ansible/roles/sources/templates/docker-compose.yml.j2 +++ b/tools/docker-compose/ansible/roles/sources/templates/docker-compose.yml.j2 @@ -28,7 +28,7 @@ services: image: "{{ awx_image }}:{{ awx_image_tag }}" container_name: tools_awx_{{ container_postfix }} hostname: awx-{{ container_postfix }} - command: launch_awx.sh + command: launch_awx.sh supervisord --pidfile=/tmp/supervisor_pid ${SUPERVISOR_ARGS:--n} environment: OS: "{{ os_info.stdout }}" SDB_HOST: 0.0.0.0 @@ -41,6 +41,7 @@ services: AWX_LOGGING_MODE: stdout DJANGO_SUPERUSER_PASSWORD: {{ admin_password }} UWSGI_MOUNT_PATH: {{ ingress_path }} + DJANGO_COLORS: "${DJANGO_COLORS:-}" {% if loop.index == 1 %} RUN_MIGRATIONS: 1 {% endif %} diff --git a/tools/docker-compose/launch_awx.sh b/tools/docker-compose/launch_awx.sh index d270cdd3fe..86a9a16fd5 100755 --- a/tools/docker-compose/launch_awx.sh +++ b/tools/docker-compose/launch_awx.sh @@ -4,5 +4,6 @@ set +x bootstrap_development.sh cd /awx_devel -# Start the services -exec make supervisor + +# Run the given command, usually supervisord +exec "$@" |