Allow customizing the receptor image in the development environment (#11374)

* Allow for customizing the receptor image

* Hook in receptor image to docker-compose template

* Fix missing -e to pass into Dockerfile playbook

* Add some docs
This commit is contained in:
Alan Rominger
2021-11-19 14:00:23 -05:00
committed by GitHub
parent 44237426df
commit 099efb883d
6 changed files with 35 additions and 5 deletions

View File

@@ -6,6 +6,8 @@ dockerfile_dest: '../..'
dockerfile_name: 'Dockerfile'
template_dest: '_build'
receptor_image: quay.io/ansible/receptor:devel
# Helper vars to construct the proper download URL for the current architecture
tini_architecture: '{{ { "x86_64": "amd64", "aarch64": "arm64", "armv7": "arm" }[ansible_facts.architecture] }}'
kubectl_architecture: '{{ { "x86_64": "amd64", "aarch64": "arm64", "armv7": "arm" }[ansible_facts.architecture] }}'

View File

@@ -187,7 +187,7 @@ COPY --from=builder /var/lib/awx /var/lib/awx
RUN ln -s /var/lib/awx/venv/awx/bin/awx-manage /usr/bin/awx-manage
{%if build_dev|bool %}
COPY --from=quay.io/ansible/receptor:devel /usr/bin/receptor /usr/bin/receptor
COPY --from={{ receptor_image }} /usr/bin/receptor /usr/bin/receptor
RUN openssl req -nodes -newkey rsa:2048 -keyout /etc/nginx/nginx.key -out /etc/nginx/nginx.csr \
-subj "/C=US/ST=North Carolina/L=Durham/O=Ansible/OU=AWX Development/CN=awx.localhost" && \
openssl x509 -req -days 365 -in /etc/nginx/nginx.csr -signkey /etc/nginx/nginx.key -out /etc/nginx/nginx.crt && \

View File

@@ -83,6 +83,29 @@ ansible/awx_devel latest ba9ec3e8df74
> By default, this image will be tagged with your branch name. You can specify a custom tag by setting an environment variable, for example: `DEVEL_IMAGE_NAME=quay.io/your_user/awx_devel:17.0.1`
#### Customizing the Receptor Image
By default, the development environment will use the `devel` image from receptor.
This is used directly in `docker-compose.yml` for the hop nodes.
The receptor binary is also copied over to the main awx_devel image, used in all other AWX nodes.
Because of this, the `RECEPTOR_IMAGE` environment variable must be set when running
both docker-compose-build and docker-compose in order to use the correct receptor in all containers.
If you need to create a new receptor image, you can check out receptor and build it like this:
```bash
CONTAINERCMD=docker TAG=quay.io/ansible/receptor:release_1.1 make container
```
Then that can be used by AWX like this:
```bash
export RECEPTOR_IMAGE=quay.io/ansible/receptor:release_1.1
make docker-compose-build
make docker-compose
```
### Run AWX
##### Start the containers

View File

@@ -8,6 +8,7 @@ pg_database: 'awx'
control_plane_node_count: 1
minikube_container_group: false
receptor_socket_file: /var/run/awx-receptor/receptor.sock
receptor_image: quay.io/ansible/receptor:devel
# Keys for signing work
receptor_rsa_bits: 4096

View File

@@ -98,7 +98,7 @@ services:
- "awx_db:/var/lib/postgresql/data"
{% if execution_node_count|int > 0 %}
receptor-hop:
image: quay.io/ansible/receptor:devel
image: {{ receptor_image }}
user: root
container_name: tools_receptor_hop
hostname: receptor-hop