Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable color logs in CI #15719

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/actions/run_awx_devel/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've grown kind of tired of this pattern of make-calls-docker, then docker-calls-supervisord-entrpoint, then supervisord-calls-make.

While we could get more explicit about documenting "these targets are ran inside docker" vs "these targets are ran outside docker", in this case it makes more sense to just delete the unnecessary step.


collectstatic:
@if [ "$(VENV_BASE)" ]; then \
. $(VENV_BASE)/awx/bin/activate; \
Expand Down
16 changes: 12 additions & 4 deletions tools/docker-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 %}
Expand Down
5 changes: 3 additions & 2 deletions tools/docker-compose/launch_awx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"
Loading