Skip to content

Commit

Permalink
Adding support for multiple architectures in CI for agent docker image (
Browse files Browse the repository at this point in the history
kserve#2549)

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 35427d1 commit 553300b
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions .github/workflows/agent-docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

env:
IMAGE_NAME: agent

DOCKER_USER: ${{ secrets.DOCKER_USER }}
jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
Expand Down Expand Up @@ -46,15 +46,23 @@ jobs:
steps:
- uses: actions/checkout@v2

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

- 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 @@ -68,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: .
file: agent.Dockerfile
push: true
tags: ${{ env.IMAGE_ID }}:${{ env.VERSION }}

0 comments on commit 553300b

Please sign in to comment.