Skip to content

Commit 38c1385

Browse files
authored
Revert "Push multi-arch docker image (opendatahub-io#76)" (opendatahub-io#79)
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]>
1 parent d9892e3 commit 38c1385

File tree

1 file changed

+17
-49
lines changed

1 file changed

+17
-49
lines changed

.github/workflows/build-and-push.yml

Lines changed: 17 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
branches: [ main ]
66
tags:
77
- v*
8-
pull_request:
98

109
jobs:
1110
test:
@@ -24,57 +23,26 @@ jobs:
2423
build:
2524
needs: test
2625
runs-on: ubuntu-latest
27-
if: github.event_name == 'push'
28-
2926
env:
30-
IMAGE_NAME: modelmesh
31-
27+
IMAGE_NAME: kserve/modelmesh
3228
steps:
33-
- uses: actions/checkout@v2
34-
35-
- name: Setup QEMU
36-
uses: docker/setup-qemu-action@v2
37-
38-
- name: Setup Docker Buildx
39-
uses: docker/setup-buildx-action@v2
40-
41-
- name: Login to DockerHub
42-
uses: docker/login-action@v2
43-
with:
44-
username: ${{ secrets.DOCKER_USER }}
45-
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
46-
47-
- name: export version variable
48-
run: |
49-
GIT_COMMIT=$(git rev-parse HEAD)
50-
BUILD_ID=$(date '+%Y%m%d')-$(git rev-parse HEAD | cut -c -5)
51-
52-
IMAGE_ID=kserve/$IMAGE_NAME
53-
54-
# Change all uppercase to lowercase
55-
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
56-
57-
# Strip git ref prefix from version
58-
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
29+
- uses: actions/checkout@v2
30+
- name: Build and push runtime image
31+
run: |
32+
GIT_COMMIT=$(git rev-parse HEAD)
33+
BUILD_ID=$(date '+%Y%m%d')-$(git rev-parse HEAD | cut -c -5)
5934
60-
# Strip "v" prefix from tag name
61-
# [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
35+
# Strip git ref prefix from version
36+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
6237
63-
# Use Docker `latest` tag convention
64-
[ "$VERSION" == "main" ] && VERSION=latest
38+
# Use Docker `latest` tag convention
39+
[ "$VERSION" == "main" ] && VERSION=latest
40+
echo $VERSION
6541
66-
echo "GIT_COMMIT=$GIT_COMMIT" >> $GITHUB_ENV
67-
echo "BUILD_ID=$BUILD_ID" >> $GITHUB_ENV
68-
echo "VERSION=$VERSION" >> $GITHUB_ENV
69-
echo "IMAGE_ID=$IMAGE_ID" >> $GITHUB_ENV
42+
docker build -t ${{ env.IMAGE_NAME }}:$VERSION \
43+
--build-arg imageVersion=$VERSION \
44+
--build-arg buildId=${BUILD_ID} \
45+
--build-arg commitSha=${GIT_COMMIT} .
7046
71-
- name: Build and push
72-
uses: docker/build-push-action@v3
73-
with:
74-
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
75-
push: true
76-
tags: ${{ env.IMAGE_ID }}:${{ env.VERSION }}
77-
build-args: |
78-
imageVersion=${{ env.VERSION }}
79-
buildId=${{ env.BUILD_ID }}
80-
commitSha=${{ env.GIT_COMMIT }}
47+
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_ACCESS_TOKEN }}
48+
docker push ${{ env.IMAGE_NAME }}:$VERSION

0 commit comments

Comments
 (0)