Skip to content

Commit

Permalink
Revert "Push multi-arch docker image (#76)" (#79)
Browse files Browse the repository at this point in the history
This reverts commit d9892e3.

These changes actually broke our main image build. Unfortunately the actions that run on the PR don't actually build the image. @ckadner is addressing that and then we can reopen this if needed post 0.10 release.

@ddelange it probably only makes sense anyhow if we do this for all the modelmesh images i.e. also including `modelmesh-serving` and `modelmesh-runtime-adapter`

Signed-off-by: Nick Hill <[email protected]>
  • Loading branch information
njhill authored Jan 10, 2023
1 parent d9892e3 commit 38c1385
Showing 1 changed file with 17 additions and 49 deletions.
66 changes: 17 additions & 49 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches: [ main ]
tags:
- v*
pull_request:

jobs:
test:
Expand All @@ -24,57 +23,26 @@ jobs:
build:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'

env:
IMAGE_NAME: modelmesh

IMAGE_NAME: kserve/modelmesh
steps:
- uses: actions/checkout@v2

- name: Setup QEMU
uses: docker/setup-qemu-action@v2

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

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

- name: export version variable
run: |
GIT_COMMIT=$(git rev-parse HEAD)
BUILD_ID=$(date '+%Y%m%d')-$(git rev-parse HEAD | cut -c -5)
IMAGE_ID=kserve/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
- uses: actions/checkout@v2
- name: Build and push runtime image
run: |
GIT_COMMIT=$(git rev-parse HEAD)
BUILD_ID=$(date '+%Y%m%d')-$(git rev-parse HEAD | cut -c -5)
# Strip "v" prefix from tag name
# [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Use Docker `latest` tag convention
[ "$VERSION" == "main" ] && VERSION=latest
# Use Docker `latest` tag convention
[ "$VERSION" == "main" ] && VERSION=latest
echo $VERSION
echo "GIT_COMMIT=$GIT_COMMIT" >> $GITHUB_ENV
echo "BUILD_ID=$BUILD_ID" >> $GITHUB_ENV
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "IMAGE_ID=$IMAGE_ID" >> $GITHUB_ENV
docker build -t ${{ env.IMAGE_NAME }}:$VERSION \
--build-arg imageVersion=$VERSION \
--build-arg buildId=${BUILD_ID} \
--build-arg commitSha=${GIT_COMMIT} .
- name: Build and push
uses: docker/build-push-action@v3
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
push: true
tags: ${{ env.IMAGE_ID }}:${{ env.VERSION }}
build-args: |
imageVersion=${{ env.VERSION }}
buildId=${{ env.BUILD_ID }}
commitSha=${{ env.GIT_COMMIT }}
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_ACCESS_TOKEN }}
docker push ${{ env.IMAGE_NAME }}:$VERSION

0 comments on commit 38c1385

Please sign in to comment.