Skip to content

Commit

Permalink
Adding multi-arch support for linux-ppc64le for qpext (kserve#2604)
Browse files Browse the repository at this point in the history
* Updating qpext Dockerfile for multi-arch support

Signed-off-by: adilhusain-s <[email protected]>

* Adding support for multiple architectures in CI for qpext docker image

Signed-off-by: adilhusain-s <[email protected]>

Signed-off-by: adilhusain-s <[email protected]>
  • Loading branch information
adilhusain-s authored Dec 23, 2022
1 parent 9221027 commit 2fdf6ad
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
38 changes: 24 additions & 14 deletions .github/workflows/qpext-docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:

env:
IMAGE_NAME: qpext
DOCKER_USER: ${{secrets.DOCKER_USER}}

jobs:
# Run tests.
Expand Down Expand Up @@ -47,17 +48,21 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Build image
run: |
cd qpext
docker build . --file qpext.Dockerfile --tag $IMAGE_NAME
- name: Setup QEMU
uses: docker/setup-qemu-action@v2

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

- name: Log into registry
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Push image
- name: export version variable
run: |
IMAGE_ID=kserve/$IMAGE_NAME
IMAGE_ID=$DOCKER_USER/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
Expand All @@ -71,9 +76,14 @@ jobs:
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
echo VERSION=$VERSION >> $GITHUB_ENV
echo IMAGE_ID=$IMAGE_ID >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v3
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
context: "{{defaultContext}}:qpext"
file: qpext.Dockerfile
push: true
tags: ${{ env.IMAGE_ID }}:${{ env.VERSION }}
2 changes: 1 addition & 1 deletion qpext/qpext.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ COPY cmd/qpext cmd/qpext
COPY logger.go logger.go

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o qpext ./cmd/qpext
RUN CGO_ENABLED=0 go build -a -o qpext ./cmd/qpext

FROM gcr.io/distroless/static:nonroot
WORKDIR /ko-app
Expand Down

0 comments on commit 2fdf6ad

Please sign in to comment.