Skip to content

Commit 86204cf

Browse files
Publish amd64 and arm64 awx image on release (#15053)
* Stage multi-arch awx image - change CI to use `make awx-kube-build` instead of build playbook - update staging CI to build and push multiarch awx image - update doc to use `make awx-kube-build` to build awx image - remove build playbook (no longer used)
1 parent 468949b commit 86204cf

File tree

8 files changed

+65
-131
lines changed

8 files changed

+65
-131
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ jobs:
9494
- name: Build AWX image
9595
working-directory: awx
9696
run: |
97-
ansible-playbook -v tools/ansible/build.yml \
98-
-e headless=yes \
99-
-e awx_image=awx \
100-
-e awx_image_tag=ci \
101-
-e ansible_python_interpreter=$(which python3)
97+
VERSION=`make version-for-buildyml` make awx-kube-build
98+
env:
99+
COMPOSE_TAG: ci
100+
DEV_DOCKER_TAG_BASE: local
101+
HEADLESS: yes
102102

103103
- name: Run test deployment with awx-operator
104104
working-directory: awx-operator
@@ -109,7 +109,7 @@ jobs:
109109
make kustomize
110110
KUSTOMIZE_PATH=$(readlink -f bin/kustomize) molecule -v test -s kind -- --skip-tags=replicas
111111
env:
112-
AWX_TEST_IMAGE: awx
112+
AWX_TEST_IMAGE: local/awx
113113
AWX_TEST_VERSION: ci
114114

115115
collection-sanity:

.github/workflows/stage.yml

Lines changed: 57 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -49,71 +49,97 @@ jobs:
4949
with:
5050
path: awx
5151

52-
- name: Get python version from Makefile
53-
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
54-
55-
- name: Install python ${{ env.py_version }}
56-
uses: actions/setup-python@v4
52+
- name: Checkout awx-operator
53+
uses: actions/checkout@v3
5754
with:
58-
python-version: ${{ env.py_version }}
55+
repository: ${{ github.repository_owner }}/awx-operator
56+
path: awx-operator
5957

6058
- name: Checkout awx-logos
6159
uses: actions/checkout@v3
6260
with:
6361
repository: ansible/awx-logos
6462
path: awx-logos
6563

66-
- name: Checkout awx-operator
67-
uses: actions/checkout@v3
64+
- name: Get python version from Makefile
65+
working-directory: awx
66+
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
67+
68+
- name: Install python ${{ env.py_version }}
69+
uses: actions/setup-python@v4
6870
with:
69-
repository: ${{ github.repository_owner }}/awx-operator
70-
path: awx-operator
71+
python-version: ${{ env.py_version }}
7172

7273
- name: Install playbook dependencies
7374
run: |
7475
python3 -m pip install docker
7576
76-
- name: Build and stage AWX
77-
working-directory: awx
78-
run: |
79-
ansible-playbook -v tools/ansible/build.yml \
80-
-e registry=ghcr.io \
81-
-e registry_username=${{ github.actor }} \
82-
-e registry_password=${{ secrets.GITHUB_TOKEN }} \
83-
-e awx_image=${{ github.repository }} \
84-
-e awx_version=${{ github.event.inputs.version }} \
85-
-e ansible_python_interpreter=$(which python3) \
86-
-e push=yes \
87-
-e awx_official=yes
88-
8977
- name: Log into registry ghcr.io
90-
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
78+
uses: docker/login-action@v3
9179
with:
9280
registry: ghcr.io
9381
username: ${{ github.actor }}
9482
password: ${{ secrets.GITHUB_TOKEN }}
9583

96-
- name: Log into registry quay.io
97-
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
84+
- name: Copy logos for inclusion in sdist for official build
85+
working-directory: awx
86+
run: |
87+
cp ../awx-logos/awx/ui/client/assets/* awx/ui/public/static/media/
88+
89+
- name: Setup node and npm
90+
uses: actions/setup-node@v2
9891
with:
99-
registry: quay.io
100-
username: ${{ secrets.QUAY_USER }}
101-
password: ${{ secrets.QUAY_TOKEN }}
92+
node-version: '16.13.1'
93+
94+
- name: Prebuild UI for awx image (to speed up build process)
95+
working-directory: awx
96+
run: |
97+
sudo apt-get install gettext
98+
make ui-release
99+
make ui-next
100+
101+
- name: Set build env variables
102+
run: |
103+
echo "DEV_DOCKER_TAG_BASE=ghcr.io/${OWNER,,}" >> $GITHUB_ENV
104+
echo "COMPOSE_TAG=${{ github.event.inputs.version }}" >> $GITHUB_ENV
105+
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
106+
echo "AWX_TEST_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
107+
echo "AWX_TEST_IMAGE=ghcr.io/${OWNER,,}/awx" >> $GITHUB_ENV
108+
echo "AWX_EE_TEST_IMAGE=ghcr.io/${OWNER,,}/awx-ee:${{ github.event.inputs.version }}" >> $GITHUB_ENV
109+
echo "AWX_OPERATOR_TEST_IMAGE=ghcr.io/${OWNER,,}/awx-operator:${{ github.event.inputs.operator_version }}" >> $GITHUB_ENV
110+
env:
111+
OWNER: ${{ github.repository_owner }}
112+
113+
- name: Build and stage AWX
114+
working-directory: awx
115+
env:
116+
DOCKER_BUILDX_PUSH: true
117+
HEADLESS: false
118+
PLATFORMS: linux/amd64,linux/arm64
119+
run: |
120+
make awx-kube-buildx
102121
103122
- name: tag awx-ee:latest with version input
104123
run: |
105124
docker buildx imagetools create \
106125
quay.io/ansible/awx-ee:latest \
107-
--tag ghcr.io/${{ github.repository_owner }}/awx-ee:${{ github.event.inputs.version }}
126+
--tag ${AWX_EE_TEST_IMAGE}
108127
109128
- name: Stage awx-operator image
110129
working-directory: awx-operator
111130
run: |
112131
BUILD_ARGS="--build-arg DEFAULT_AWX_VERSION=${{ github.event.inputs.version}} \
113132
--build-arg OPERATOR_VERSION=${{ github.event.inputs.operator_version }}" \
114-
IMG=ghcr.io/${{ github.repository_owner }}/awx-operator:${{ github.event.inputs.operator_version }} \
133+
IMG=${AWX_OPERATOR_TEST_IMAGE} \
115134
make docker-buildx
116135
136+
- name: Pulling images for test deployment with awx-operator
137+
# awx operator molecue test expect to kind load image and buildx exports image to registry and not local
138+
run: |
139+
docker pull ${AWX_OPERATOR_TEST_IMAGE}
140+
docker pull ${AWX_EE_TEST_IMAGE}
141+
docker pull ${AWX_TEST_IMAGE}:${AWX_TEST_VERSION}
142+
117143
- name: Run test deployment with awx-operator
118144
working-directory: awx-operator
119145
run: |
@@ -122,10 +148,6 @@ jobs:
122148
sudo rm -f $(which kustomize)
123149
make kustomize
124150
KUSTOMIZE_PATH=$(readlink -f bin/kustomize) molecule test -s kind
125-
env:
126-
AWX_TEST_IMAGE: ${{ github.repository }}
127-
AWX_TEST_VERSION: ${{ github.event.inputs.version }}
128-
AWX_EE_TEST_IMAGE: ghcr.io/${{ github.repository_owner }}/awx-ee:${{ github.event.inputs.version }}
129151
130152
- name: Create draft release for AWX
131153
working-directory: awx

docs/build_awx_image.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
## Build & Push Image
44

5-
To build a custom awx image to use with the awx-operator, use the `build_image` role:
5+
To build a custom awx image to use with the awx-operator:
66

77
```
8-
$ ansible-playbook tools/ansible/build.yml \
9-
-e awx_image=registry.example.com/ansible/awx \
10-
-e awx_image_tag=test -v
8+
make awx-kube-build
119
```
1210

1311
> Note: The development image (`make docker-compose-build`) will not work with the awx-operator, the UI is not built in that image, among other things (see Dockerfile.j2 for more info).

tools/ansible/build.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

tools/ansible/roles/image_build/defaults/main.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

tools/ansible/roles/image_build/tasks/main.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

tools/ansible/roles/image_push/defaults/main.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

tools/ansible/roles/image_push/tasks/main.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)