From d018096cae990b95c4dcfc2a20886e681cd77ac1 Mon Sep 17 00:00:00 2001 From: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com> Date: Fri, 9 Jan 2026 12:07:23 -0500 Subject: [PATCH] Fix devel awx, awx_devel, awx_kube_devel build (#16219) * Fix ARM64 build failure by upgrading dev container Node.js to 18 Node.js 16.13.1 fails to extract on ARM64 in Docker BuildKit's overlay filesystem during multi-arch builds. Upgrade to Node 18 which is already used by the UI builder stage and has proper ARM64 support. * Fix collectstatic failure by setting AWX_MODE=default AWX_MODE=defaults is an intentionally "invalid" environment name that: 1. Loads only defaults.py - the base settings file without any environment-specific overrides (development_defaults.py, production_defaults.py, etc.) 2. Bypasses production checks - since "production" not in "defaults", it skips the assertion that requires /etc/tower/settings.py to exist 3. Bypasses development mode - since is_development_mode would be false This is perfect for collectstatic during container build because: - No database connection needed - No secret key needed (hence SKIP_SECRET_KEY_CHECK) - No PostgreSQL version check (hence SKIP_PG_VERSION_CHECK) - Just need minimal Django settings to collect static files --- tools/ansible/roles/dockerfile/templates/Dockerfile.j2 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/ansible/roles/dockerfile/templates/Dockerfile.j2 b/tools/ansible/roles/dockerfile/templates/Dockerfile.j2 index 3560b928d3..a2d43cad59 100644 --- a/tools/ansible/roles/dockerfile/templates/Dockerfile.j2 +++ b/tools/ansible/roles/dockerfile/templates/Dockerfile.j2 @@ -102,7 +102,11 @@ COPY --from=ui-builder /tmp/src/awx/ui/build /tmp/src/awx/ui/build RUN make sdist && /var/lib/awx/venv/awx/bin/pip install dist/awx.tar.gz {% if not headless|bool %} -RUN DJANGO_SETTINGS_MODULE=awx.settings.defaults SKIP_SECRET_KEY_CHECK=yes SKIP_PG_VERSION_CHECK=yes /var/lib/awx/venv/awx/bin/awx-manage collectstatic --noinput --clear +RUN AWX_MODE=defaults \ + SKIP_SECRET_KEY_CHECK=yes \ + SKIP_PG_VERSION_CHECK=yes \ + AWX_SKIP_CREDENTIAL_TYPES_DISCOVER=yes \ + /var/lib/awx/venv/awx/bin/awx-manage collectstatic --noinput --clear {% endif %} {% endif %} @@ -179,7 +183,7 @@ RUN dnf -y install \ wget \ diffutils \ unzip && \ - npm install -g n && n 16.13.1 && npm install -g npm@8.5.0 && dnf remove -y nodejs + npm install -g n && n 18 && dnf remove -y nodejs RUN pip3.12 install -vv git+https://github.com/coderanger/supervisor-stdout.git@973ba19967cdaf46d9c1634d1675fc65b9574f6e RUN pip3.12 install -vv black setuptools-scm build