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

Adding support for ppc64le platform using Multi-arch GitHub Actions flow #638

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions .github/workflows/devel_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,39 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0

# setup qemu and buildx
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Install build dependencies
run: |
pip install build

# we will first build the image for x86 and load it on the host for testing
- name: Build Image
run: |
make container REPO=receptor TAG=devel
export CONTAINERCMD="docker buildx"
export EXTRA_OPTS="--platform linux/amd64 --load"
make container REPO=quay.io/ansible/receptor TAG=devel

- name: Test Image
run: podman run --rm receptor:devel receptor --version
run: docker run --rm quay.io/ansible/receptor:devel receptor --version

- name: Push To Quay
uses: redhat-actions/push-to-registry@v2.1.1
- name: Login To Quay
uses: docker/login-action@v2
with:
image: receptor
tags: devel
registry: quay.io/ansible/
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
registry: quay.io/ansible/receptor

# Since x86 image is built in previous step
# buildx will use cached image, hence overall time will not be affected
- name: Build Multiarch Image & Push To Quay
run: |
export CONTAINERCMD="docker buildx"
export EXTRA_OPTS="--platform linux/amd64,linux/ppc64le --push"
make container REPO=quay.io/ansible/receptor TAG=devel
15 changes: 8 additions & 7 deletions .github/workflows/promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ jobs:
run: |
echo ${{ secrets.QUAY_TOKEN }} | docker login quay.io -u ${{ secrets.QUAY_USER }} --password-stdin

- name: Re-tag and promote awx image
run: |
docker pull ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }}
docker tag ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }} quay.io/${{ github.repository }}:${{ github.event.release.tag_name }}
docker tag ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }} quay.io/${{ github.repository }}:latest
docker push quay.io/${{ github.repository }}:${{ github.event.release.tag_name }}
docker push quay.io/${{ github.repository }}:latest
- name: Copy Image to Quay
uses: akhilerm/[email protected]
with:
src: ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }}
dst: |
quay.io/${{ github.repository }}:${{ github.event.release.tag_name }}
quay.io/${{ github.repository }}:latest


11 changes: 9 additions & 2 deletions .github/workflows/stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,21 @@ jobs:
- name: Install dependencies
run: |
python3 -m pip install build

# setup qemu and buildx
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Build container image
run: |
make container CONTAINERCMD=docker REPO=ghcr.io/${{ github.repository_owner }}/receptor VERSION=v${{ github.event.inputs.version }} LATEST=yes
make container CONTAINERCMD="docker buildx" EXTRA_OPTS="--platform linux/amd64,linux/ppc64le --push" REPO=ghcr.io/${{ github.repository_owner }}/receptor VERSION=v${{ github.event.inputs.version }} LATEST=yes

- name: Stage container image
run: |
Expand All @@ -69,4 +76,4 @@ jobs:
-e version=${{ github.event.inputs.version }} \
-e repo=${{ github.repository_owner }}/receptor \
-e github_token=${{ secrets.GITHUB_TOKEN }} \
-e target_commitish=${{ github.event.inputs.ref }}
-e target_commitish=${{ github.event.inputs.ref }}
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ $(RECEPTOR_PYTHON_WORKER_WHEEL): receptor-python-worker/README.md receptor-pytho
@cd receptor-python-worker && python3 -m build --wheel

# Container command can be docker or podman
CONTAINERCMD := podman
CONTAINERCMD ?= podman

# Repo without tag
REPO := quay.io/ansible/receptor
Expand All @@ -133,12 +133,14 @@ TAG := $(subst +,-,$(VERSION))
# Set this to tag image as :latest in addition to :$(VERSION)
LATEST :=

EXTRA_OPTS ?=

container: .container-flag-$(VERSION)
.container-flag-$(VERSION): $(RECEPTORCTL_WHEEL) $(RECEPTOR_PYTHON_WORKER_WHEEL)
@tar --exclude-vcs-ignores -czf packaging/container/source.tar.gz .
@cp $(RECEPTORCTL_WHEEL) packaging/container
@cp $(RECEPTOR_PYTHON_WORKER_WHEEL) packaging/container
$(CONTAINERCMD) build packaging/container --build-arg VERSION=$(VERSION:v%=%) -t $(REPO):$(TAG) $(if $(LATEST),-t $(REPO):latest,)
$(CONTAINERCMD) build $(EXTRA_OPTS) packaging/container --build-arg VERSION=$(VERSION:v%=%) -t $(REPO):$(TAG) $(if $(LATEST),-t $(REPO):latest,)
@touch .container-flag-$(VERSION)

tc-image: container
Expand Down