diff options
author | Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com> | 2024-04-09 15:50:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-09 15:50:09 +0200 |
commit | 86204cf23bd5645cece25f0cf3791f3c0367e52f (patch) | |
tree | 1427abd61e8ede887f7bc3bd81ff7ddc3b6d91d3 /.github | |
parent | Remove uneeded drf_reverse overwrite (diff) | |
download | awx-86204cf23bd5645cece25f0cf3791f3c0367e52f.tar.xz awx-86204cf23bd5645cece25f0cf3791f3c0367e52f.zip |
Publish amd64 and arm64 awx image on release (#15053)24.2.0
* 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)
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/ci.yml | 12 | ||||
-rw-r--r-- | .github/workflows/stage.yml | 92 |
2 files changed, 63 insertions, 41 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b487c73e6c..e2d205a1dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,11 +94,11 @@ jobs: - name: Build AWX image working-directory: awx run: | - ansible-playbook -v tools/ansible/build.yml \ - -e headless=yes \ - -e awx_image=awx \ - -e awx_image_tag=ci \ - -e ansible_python_interpreter=$(which python3) + VERSION=`make version-for-buildyml` make awx-kube-build + env: + COMPOSE_TAG: ci + DEV_DOCKER_TAG_BASE: local + HEADLESS: yes - name: Run test deployment with awx-operator working-directory: awx-operator @@ -109,7 +109,7 @@ jobs: make kustomize KUSTOMIZE_PATH=$(readlink -f bin/kustomize) molecule -v test -s kind -- --skip-tags=replicas env: - AWX_TEST_IMAGE: awx + AWX_TEST_IMAGE: local/awx AWX_TEST_VERSION: ci collection-sanity: diff --git a/.github/workflows/stage.yml b/.github/workflows/stage.yml index 26eedf7747..ddf4d9c6ee 100644 --- a/.github/workflows/stage.yml +++ b/.github/workflows/stage.yml @@ -49,13 +49,11 @@ jobs: with: path: awx - - name: Get python version from Makefile - run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV - - - name: Install python ${{ env.py_version }} - uses: actions/setup-python@v4 + - name: Checkout awx-operator + uses: actions/checkout@v3 with: - python-version: ${{ env.py_version }} + repository: ${{ github.repository_owner }}/awx-operator + path: awx-operator - name: Checkout awx-logos uses: actions/checkout@v3 @@ -63,57 +61,85 @@ jobs: repository: ansible/awx-logos path: awx-logos - - name: Checkout awx-operator - uses: actions/checkout@v3 + - name: Get python version from Makefile + working-directory: awx + run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV + + - name: Install python ${{ env.py_version }} + uses: actions/setup-python@v4 with: - repository: ${{ github.repository_owner }}/awx-operator - path: awx-operator + python-version: ${{ env.py_version }} - name: Install playbook dependencies run: | python3 -m pip install docker - - name: Build and stage AWX - working-directory: awx - run: | - ansible-playbook -v tools/ansible/build.yml \ - -e registry=ghcr.io \ - -e registry_username=${{ github.actor }} \ - -e registry_password=${{ secrets.GITHUB_TOKEN }} \ - -e awx_image=${{ github.repository }} \ - -e awx_version=${{ github.event.inputs.version }} \ - -e ansible_python_interpreter=$(which python3) \ - -e push=yes \ - -e awx_official=yes - - name: Log into registry ghcr.io - uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Log into registry quay.io - uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 + - name: Copy logos for inclusion in sdist for official build + working-directory: awx + run: | + cp ../awx-logos/awx/ui/client/assets/* awx/ui/public/static/media/ + + - name: Setup node and npm + uses: actions/setup-node@v2 with: - registry: quay.io - username: ${{ secrets.QUAY_USER }} - password: ${{ secrets.QUAY_TOKEN }} + node-version: '16.13.1' + + - name: Prebuild UI for awx image (to speed up build process) + working-directory: awx + run: | + sudo apt-get install gettext + make ui-release + make ui-next + + - name: Set build env variables + run: | + echo "DEV_DOCKER_TAG_BASE=ghcr.io/${OWNER,,}" >> $GITHUB_ENV + echo "COMPOSE_TAG=${{ github.event.inputs.version }}" >> $GITHUB_ENV + echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + echo "AWX_TEST_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + echo "AWX_TEST_IMAGE=ghcr.io/${OWNER,,}/awx" >> $GITHUB_ENV + echo "AWX_EE_TEST_IMAGE=ghcr.io/${OWNER,,}/awx-ee:${{ github.event.inputs.version }}" >> $GITHUB_ENV + echo "AWX_OPERATOR_TEST_IMAGE=ghcr.io/${OWNER,,}/awx-operator:${{ github.event.inputs.operator_version }}" >> $GITHUB_ENV + env: + OWNER: ${{ github.repository_owner }} + + - name: Build and stage AWX + working-directory: awx + env: + DOCKER_BUILDX_PUSH: true + HEADLESS: false + PLATFORMS: linux/amd64,linux/arm64 + run: | + make awx-kube-buildx - name: tag awx-ee:latest with version input run: | docker buildx imagetools create \ quay.io/ansible/awx-ee:latest \ - --tag ghcr.io/${{ github.repository_owner }}/awx-ee:${{ github.event.inputs.version }} + --tag ${AWX_EE_TEST_IMAGE} - name: Stage awx-operator image working-directory: awx-operator run: | BUILD_ARGS="--build-arg DEFAULT_AWX_VERSION=${{ github.event.inputs.version}} \ --build-arg OPERATOR_VERSION=${{ github.event.inputs.operator_version }}" \ - IMG=ghcr.io/${{ github.repository_owner }}/awx-operator:${{ github.event.inputs.operator_version }} \ + IMG=${AWX_OPERATOR_TEST_IMAGE} \ make docker-buildx + - name: Pulling images for test deployment with awx-operator + # awx operator molecue test expect to kind load image and buildx exports image to registry and not local + run: | + docker pull ${AWX_OPERATOR_TEST_IMAGE} + docker pull ${AWX_EE_TEST_IMAGE} + docker pull ${AWX_TEST_IMAGE}:${AWX_TEST_VERSION} + - name: Run test deployment with awx-operator working-directory: awx-operator run: | @@ -122,10 +148,6 @@ jobs: sudo rm -f $(which kustomize) make kustomize KUSTOMIZE_PATH=$(readlink -f bin/kustomize) molecule test -s kind - env: - AWX_TEST_IMAGE: ${{ github.repository }} - AWX_TEST_VERSION: ${{ github.event.inputs.version }} - AWX_EE_TEST_IMAGE: ghcr.io/${{ github.repository_owner }}/awx-ee:${{ github.event.inputs.version }} - name: Create draft release for AWX working-directory: awx |