Build custom AWX image for production

Hi there! I forked the AWX repo and added support for Bitbucket Cloud webhooks and credentials:

awx-plugins: Added bitbucket_cloud_token to credential plugins by bpmb82 · Pull Request #70 · ansible/awx-plugins · GitHub
ansible-ui: Add bitbucket cloud webhook support by bpmb82 · Pull Request #3076 · ansible/ansible-ui · GitHub
awx: Add support for bitbucket cloud webhook by bpmb82 · Pull Request #15699 · ansible/awx · GitHub

I would like to build a custom image that I can run in production. I ran this command:
make awx-kube-build
and it builds an image but throws errors about a missing django-auth-ldap module when I try to run it. I tried adding this in requirements.txt but it doesn’t appear to work.

I also changed requirements-git.txt to my repos and branches for awx-plugins and exported these 2 environment variables before issueing the make command:

export UI_GIT_REPO=https://github.com/bpmb82/ansible-ui.git
export UI_GIT_BRANCH=add_bitbucket_cloud_webhook_support

How can I build a production image based upon my changes?

try also updating the requirements.in file. Also depending on where in the build your respective packages are required, you may need to make an update to the awx/tools/ansible/roles/dockerfile/templates/Dockerfile.j2 file to add respective system dependencies in order to get the make process to compile the awx-image build successfully.

For example I had an issue with a build for version: 24.6.1 recently, that was complaining about openssl version 3.0.7. I ended up commenting out that specific version and using just openssl, and my build completed successfully.

Phil

@bpmb82 hello, check out the Getting started with EE document.

To build a custom AWX image for production with your changes, I believe this may help:

  1. Fix Missing Dependency: Add django-auth-ldap to requirements_base.txt and requirements_git.txt in your AWX fork. Pin the version for compatibility (e.g., django-auth-ldap==4.0.0).
  2. Set Environment Variables: Export variables for all custom repositories and branches, e.g.:

bash

CopyEdit

export UI_GIT_REPO=https://github.com/bpmb82/ansible-ui.git  
export UI_GIT_BRANCH=add_bitbucket_cloud_webhook_support  
export PLUGINS_GIT_REPO=https://github.com/bpmb82/awx-plugins.git  
export PLUGINS_GIT_BRANCH=add_bitbucket_cloud_token  
  1. Rebuild Image: Run make clean to clear previous builds, then rebuild using make docker-compose-build or make awx-kube-build.
  2. Test Locally: Use docker-compose to test the image and verify that your customizations work.
  3. Deploy to Production: Push the image to a registry and validate in a staging or Kubernetes setup.

Check logs (make V=1) and manually verify dependencies if issues persist.

Much appreciated for all the suggestions here! I have been able to build a new image which also includes the django_auth_ldap module but the problem is that the UWSGI appears to not load the virtual environment correctly. If I login to the awx-web pod and activate the virtual env, I can easily import django_auth_ldap. I lost the logs I’m afraid but I’ll see if I can still get them. Basically, ‘production.py’ and ‘settings.py’ could not import django_auth_ldap (no such module).

Am I missing something?