Skip to content

Commit 2657ea8

Browse files
authored
Disable color logs in CI (ansible#15719)
* Disable color logs in CI * Disable management command color
1 parent 7835e39 commit 2657ea8

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

.github/actions/run_awx_devel/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ runs:
3434
run: |
3535
DEV_DOCKER_OWNER=${{ github.repository_owner }} \
3636
COMPOSE_TAG=${{ github.base_ref || github.ref_name }} \
37-
COMPOSE_UP_OPTS="-d" \
37+
DJANGO_COLORS=nocolor \
38+
SUPERVISOR_ARGS="-n -t" \
39+
COMPOSE_UP_OPTS="-d --no-color" \
3840
make docker-compose
3941
4042
- name: Update default AWX password

Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,6 @@ migrate:
222222
dbchange:
223223
$(MANAGEMENT_COMMAND) makemigrations
224224

225-
supervisor:
226-
@if [ "$(VENV_BASE)" ]; then \
227-
. $(VENV_BASE)/awx/bin/activate; \
228-
fi; \
229-
supervisord --pidfile=/tmp/supervisor_pid -n
230-
231225
collectstatic:
232226
@if [ "$(VENV_BASE)" ]; then \
233227
. $(VENV_BASE)/awx/bin/activate; \

tools/docker-compose/README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,21 @@ The docker-compose development environment is regularly used and should work on
4848

4949
Use on other platforms is untested, and may require local changes.
5050

51-
## Configuration
51+
### How to Disable Color?
5252

53-
In the [`inventory` file](./inventory), set your `pg_password`, `broadcast_websocket_secret`, `secret_key`, and any other settings you need for your deployment.
53+
There are several layers that might apply color:
54+
- docker compose coloring based on what container log comes from
55+
- supervisord coloring based on what server it comes from
56+
- general coloration from Django management commands
5457

55-
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`.
58+
These can have color turned off by adding things to the
59+
environment variable to modify the call options.
5660

57-
> 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.
61+
```
62+
DJANGO_COLORS=nocolor COMPOSE_UP_OPTS="--no-color" SUPERVISOR_ARGS="-n -t" make docker-compose
63+
```
64+
65+
This can be useful if this is ran in CI in any context.
5866

5967
## Starting the Development Environment
6068

tools/docker-compose/ansible/roles/sources/templates/docker-compose.yml.j2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ services:
2828
image: "{{ awx_image }}:{{ awx_image_tag }}"
2929
container_name: tools_awx_{{ container_postfix }}
3030
hostname: awx-{{ container_postfix }}
31-
command: launch_awx.sh
31+
command: launch_awx.sh supervisord --pidfile=/tmp/supervisor_pid ${SUPERVISOR_ARGS:--n}
3232
environment:
3333
OS: "{{ os_info.stdout }}"
3434
SDB_HOST: 0.0.0.0
@@ -41,6 +41,7 @@ services:
4141
AWX_LOGGING_MODE: stdout
4242
DJANGO_SUPERUSER_PASSWORD: {{ admin_password }}
4343
UWSGI_MOUNT_PATH: {{ ingress_path }}
44+
DJANGO_COLORS: "${DJANGO_COLORS:-}"
4445
{% if loop.index == 1 %}
4546
RUN_MIGRATIONS: 1
4647
{% endif %}

tools/docker-compose/launch_awx.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ set +x
44
bootstrap_development.sh
55

66
cd /awx_devel
7-
# Start the services
8-
exec make supervisor
7+
8+
# Run the given command, usually supervisord
9+
exec "$@"

0 commit comments

Comments
 (0)