Prerequisites
Docker
Prior to starting the development services, you’ll needdocker and docker-compose. On Linux, you can generally find these in your distro’s packaging, but you may find that Docker themselves maintain a separate repo that tracks more closely to the latest releases.
macOS and Windows:
Linux platforms:
Docker Compose
If you’re not using Docker for Mac, or Docker for Windows, you may need, or choose to, install thedocker-compose Python module separately:
Additional Tools
- Ansible: Required for templating configuration files
- OpenSSL: For generating SSL certificates
Building the Development Image
The AWX base container image contains basic OS dependencies and symbolic links into the development environment that make running the services easy.Build the Image
The image will need to be rebuilt if there are any changes to
Dockerfile.j2 or any of the files used by the templated Dockerfile.ansible/awx_devel image in your local image cache:
Customizing the Receptor Image
By default, the development environment will use thedevel image from receptor. The receptor binary is copied into the main awx_devel image.
If you need to create a new receptor image:
Starting the Development Environment
Start the Containers
Run the AWX, PostgreSQL, and Redis containers:The make target assumes that the image you built is tagged with your current branch. You can choose a specific branch by setting
COMPOSE_TAG:Running in Detached Mode
To run docker-compose in detached mode:Disable Color Output
Useful for CI environments:Wait for Migrations
The first time you start the environment, database migrations need to run. Eventually you will see output like:Initial Configuration
Create an Admin User
Before you can log into AWX, you need to create an admin user:Load Demo Data (Optional)
You may also want to load some demo data. This will create a demo project, inventory, and job template:This information will persist in the database running in the
tools_postgres_1 container until the container is removed. You may periodically need to recreate this container if the database schema changes in an upstream commit.Accessing AWX
You can now log into the AWX web interface at:- Web UI: https://localhost:8043
- API: https://localhost:8043/api/v2/
Advanced Configurations
Running a Cluster
Certain features or bugs are only applicable when running a cluster of AWX nodes. To bring up a 3 node cluster:- 1 control node
- 1 hop node (automatically created when execution nodes exist)
- 2 execution nodes
Customized Mesh Node Cluster
For more complex topologies:Start with Minikube
To test container groups with Minikube:Integration with External Services
Splunk Integration
http://<server>:8000/ with credentials admin/splunk_admin.
HashiCorp Vault Integration
Prometheus and Grafana
http://localhost:3001.
OpenTelemetry Integration
Development Workflow
Start a Shell
To runawx-manage commands inside the container:
Start AWX from Container Shell
For more control over the startup process:Building the UI
Prerequisites on your local machine:- npm
- nodejs
Cleanup
Purge Containers and Images
Database Issues
If you encounter the infinitely-repeatingWaiting for postgres to be ready message:
Troubleshooting
Configuration Files
- Inventory file:
tools/docker-compose/inventory- used to configure the AWX development environment - Migration playbook:
tools/docker-compose/ansible/migrate.yml- for migrating data from Local Docker
Tested Operating Systems
The docker-compose development environment is regularly used and should work on x86_64 systems running:- Fedora (maintained versions)
- Ubuntu LTS (18, 20)
- Red Hat Enterprise Linux 8, CentOS Stream 8
- macOS 11
Use on other platforms is untested and may require local changes.