Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BBS enabled docker image overwrites normal image #3174

Closed
rblaine95 opened this issue Aug 16, 2024 · 3 comments · Fixed by #3175
Closed

BBS enabled docker image overwrites normal image #3174

rblaine95 opened this issue Aug 16, 2024 · 3 comments · Fixed by #3175

Comments

@rblaine95
Copy link
Contributor

rblaine95 commented Aug 16, 2024

In the Enabling BBS Signatures Support documentation, it's insinuated that 2 docker images are built and published:

  • aries-cloudagent-python - no BBS support, linux/amd64 and linux/arm64 supported
  • aries-cloudagent-bbs - BBS support, linux/amd64 only

However, in the Docker Publish action, the Extended (BBS enabled) image uses the same name and tag as the normal (BBS disabled) image, causing an overwrite as both use the same output of the same meta step:

      - name: Setup Image Metadata
        id: meta
        uses: docker/metadata-action@v5
        with:
          images: |
            ghcr.io/${{ steps.info.outputs.repo-owner }}/aries-cloudagent-python
          tags: |
            type=raw,value=py${{ matrix.python-version }}-${{ inputs.tag || github.event.release.tag_name }}

      - name: Build and Push Image to ghcr.io
        uses: docker/build-push-action@v5
        with:
          push: true
          context: .
          file: docker/Dockerfile
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
          target: main
          build-args: |
            python_version=${{ matrix.python-version }}
            acapy_version=${{ inputs.tag || github.event.release.tag_name }}
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
          platforms: ${{ env.PLATFORMS }}

      - name: Build and Push extended Image to ghcr.io
        uses: docker/build-push-action@v5
        with:
          push: true
          context: .
          file: docker/Dockerfile
          tags: ${{ steps.meta.outputs.tags }} # This causes the previous (non-bbs) image to be overwritten
          labels: ${{ steps.meta.outputs.labels }}
          target: main
          build-args: |
            python_version=${{ matrix.python-version }}
            acapy_name=aries-cloudagent-bbs
            acapy_version=${{ inputs.tag || github.event.release.tag_name }}
            acapy_reqs=[askar,bbs,didcommv2]
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
          # Because of BBS, only linux/amd64 is supported for the extended image
          # https://github.com/hyperledger/aries-cloudagent-python/issues/2124#issuecomment-2293569659
          platforms: linux/amd64

I propose adding a dedicated meta step for the Extended (BBS enabled) image:

      - name: Setup Image Metadata
        id: meta
        uses: docker/metadata-action@v5
        with:
          images: |
            ghcr.io/${{ steps.info.outputs.repo-owner }}/aries-cloudagent-python
          tags: |
            type=raw,value=py${{ matrix.python-version }}-${{ inputs.tag || github.event.release.tag_name }}

      - name: Build and Push Image to ghcr.io
        uses: docker/build-push-action@v5
        with:
          push: true
          context: .
          file: docker/Dockerfile
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
          target: main
          build-args: |
            python_version=${{ matrix.python-version }}
            acapy_version=${{ inputs.tag || github.event.release.tag_name }}
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
          platforms: ${{ env.PLATFORMS }}

      - name: Setup Image Metadata
        id: meta-bbs
        uses: docker/metadata-action@v5
        with:
          images: |
            ghcr.io/${{ steps.info.outputs.repo-owner }}/aries-cloudagent-bbs
          tags: |
            type=raw,value=py${{ matrix.python-version }}-${{ inputs.tag || github.event.release.tag_name }}

      - name: Build and Push extended Image to ghcr.io
        uses: docker/build-push-action@v5
        with:
          push: true
          context: .
          file: docker/Dockerfile
          tags: ${{ steps.meta-bbs.outputs.tags }}
          labels: ${{ steps.meta-bbs.outputs.labels }}
          target: main
          build-args: |
            python_version=${{ matrix.python-version }}
            acapy_name=aries-cloudagent-bbs
            acapy_version=${{ inputs.tag || github.event.release.tag_name }}
            acapy_reqs=[askar,bbs,didcommv2]
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
          # Because of BBS, only linux/amd64 is supported for the extended image
          # https://github.com/hyperledger/aries-cloudagent-python/issues/2124#issuecomment-2293569659
          platforms: linux/amd64

This will actually publish the missing aries-cloudagent-bbs image referenced in the documentation

rblaine95 added a commit to didx-xyz/acapy that referenced this issue Aug 16, 2024
@swcurran
Copy link
Contributor

@jamshale @esune @amanji — see this and the related PR.

@rblaine95
Copy link
Contributor Author

I've cherry-picked the commit from #3175 into the didx-xyz fork and running a quick test build viewable here
https://github.com/didx-xyz/aries-cloudagent-python/actions/runs/10426736689/job/28880244610

@rblaine95
Copy link
Contributor Author

rblaine95 commented Aug 16, 2024

ghcr.io/didx-xyz/aries-cloudagent-python:py3.12-test-bbs-image publishes correctly with the expected architectures
image

ghcr.io/didx-xyz/aries-cloudagent-bbs:py3.12-test-bbs-image publishes with the expected architectures too
image

Edit: The unknown/unknown architecture is from the default Docker Buildx attestations
https://github.com/orgs/community/discussions/45969

rngadam pushed a commit to rngadam/aries-cloudagent-python that referenced this issue Aug 20, 2024
jamshale pushed a commit to jamshale/acapy that referenced this issue Aug 22, 2024
ff137 pushed a commit to didx-xyz/acapy that referenced this issue Aug 29, 2024
darshilnb pushed a commit to Northern-Block/aries-cloudagent-python that referenced this issue Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants