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
This commit is contained in:
Hao Liu 2026-01-09 12:07:23 -05:00 committed by GitHub
parent cfe0b367b5
commit d018096cae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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