Skip to content

Commit

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

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

* Adding multiple architectures in CI for router docker image

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

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

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

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

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

- name: Log into registry
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Push image
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}

- 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 @@ -68,9 +75,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: .
file: router.Dockerfile
push: true
tags: ${{ env.IMAGE_ID }}:${{ env.VERSION }}
2 changes: 1 addition & 1 deletion router.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ COPY pkg/ pkg/
COPY cmd/ cmd/

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

# Copy the inference-router into a thin image
FROM gcr.io/distroless/static:latest
Expand Down

0 comments on commit 4aee669

Please sign in to comment.