From 618f5ca44bc412a51459a06a69888b44b04c14d4 Mon Sep 17 00:00:00 2001 From: Guy Owen Date: Fri, 19 Jan 2024 16:33:56 +1100 Subject: [PATCH] [DDS-1845] Updated awx-ee independent workflow. For speed comparison. --- .github/workflows/build-deploy-awx-ee.yml | 24 ++++++++++++++--------- images/awx-ee/docker-bake.hcl | 4 ++-- images/awx-ee/execution-environment.yml | 8 +++++--- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-deploy-awx-ee.yml b/.github/workflows/build-deploy-awx-ee.yml index 740ad85d..c29ef1b4 100644 --- a/.github/workflows/build-deploy-awx-ee.yml +++ b/.github/workflows/build-deploy-awx-ee.yml @@ -46,24 +46,30 @@ jobs: type=ref,event=pr,enable=${{ github.event.pull_request.merged == false }} type=raw,value=${{ github.event.pull_request.base.ref }},enable=${{ github.event.pull_request.merged == true }} type=ref,event=branch,enable=${{ contains(fromJson('["schedule", "workflow_dispatch"]'), github.event_name) }} - labels: | - maintainer=Digital Transformation - repository=${{ github.repositoryUrl }} - org.opencontainers.image.authors=Digital Victoria - org.opencontainers.image.source=https://github.com/${{ github.repository }}/tree/${{ (contains(fromJson('["opened","synchronize"]'), github.event.action)) && github.head_ref || github.event.action == 'closed' && github.base_ref || github.ref_name }}/images/${{ matrix.images }}/Dockerfile - org.opencontainers.image.title=AWX Execution Environment image. - org.opencontainers.image.description=AWX Execution Environment image. - name: Create context and build instruction file run: | pip install --upgrade ansible-builder ansible-builder build \ - --container-runtime=docker \ + --container-runtime docker \ + --tag ${{ steps.meta.outputs.tags }} --build-arg PKGMGR="/usr/bin/apt-get" \ --build-arg PYCMD="/usr/local/bin/python3" \ - --output-filename Dockerfile \ --verbosity 3 + + # Refactored to use bake but it's substantially slower so we'll do a push instead + # see https://github.com/docker/build-push-action/issues/538#issuecomment-1869681934 + # However this approach may be at the cost of multi-arch support. + - name: Test + run: | + docker images + + - name: Push + run: | + docker push --all-tags ${{ env.REGISTRY }}/${{ github.repository }}/awx-ee + + # - name: Build and push the AWX-EE image # uses: docker/bake-action@v4 # with: diff --git a/images/awx-ee/docker-bake.hcl b/images/awx-ee/docker-bake.hcl index c707b696..363fbfd8 100644 --- a/images/awx-ee/docker-bake.hcl +++ b/images/awx-ee/docker-bake.hcl @@ -7,12 +7,12 @@ variable "IMAGE_TAG" { } group "default" { - targets = ["ee"] + targets = ["awx-ee"] } target "docker-metadata-action" {} -target "ee" { +target "awx-ee" { inherits = ["docker-metadata-action"] context = "./context" platforms = ["linux/amd64", "linux/arm64"] diff --git a/images/awx-ee/execution-environment.yml b/images/awx-ee/execution-environment.yml index 4f755747..27c3dcfa 100644 --- a/images/awx-ee/execution-environment.yml +++ b/images/awx-ee/execution-environment.yml @@ -19,9 +19,11 @@ additional_build_steps: append_base: [] prepend_final: - - LABEL org.opencontainers.image.authors="Digital Victoria" - - LABEL org.opencontainers.image.description="Provides an AWX execution environment image optimised for use with SDP." - - LABEL org.opencontainers.image.source="https://github.com/dpc-sdp/bay/blob/6.x/images/awx-ee/context/Dockerfile" + - LABEL maintainer=Digital Transformation + - LABEL org.opencontainers.image.authors=Digital Transformation + - LABEL org.opencontainers.image.title=SDP AWX Execution Environment image. + - LABEL org.opencontainers.image.description="Provides an AWX execution environment image optimised for use with SDP. Built with ansible-builder." + - LABEL org.opencontainers.image.source="https://github.com/dpc-sdp/bay/blob/6.x/images/awx-ee/" - ARG LAGOON_CLI_VERSION=v0.15.4 - ARG NVM_INSTALL_VERSION=v0.39.1 - ARG NODE_VERSION=v14.15.1