Skip to content

Commit 858311f

Browse files
authored
Merge pull request #18 from Jooho/20230605_sync_main
[Sync] kserve/modelmesh-serving-v0.11.0-rc0 to main branch
2 parents 1d95acc + 54c6030 commit 858311f

File tree

26 files changed

+2311
-2357
lines changed

26 files changed

+2311
-2357
lines changed

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
.dockerignore
33
.vscode
44
.DS_Store
5-
Dockerfile
5+
Dockerfile
6+
temp

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

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- "release-[0-9].[0-9]+"
8+
paths-ignore:
9+
- "**.md"
10+
push:
11+
branches:
12+
- main
13+
- "release-[0-9].[0-9]+"
14+
tags:
15+
- "v*"
16+
paths-ignore:
17+
- "**.md"
18+
19+
env:
20+
IMAGE_NAME: "kserve/modelmesh-runtime-adapter"
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
env:
26+
CI: true
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
31+
- name: Setup QEMU
32+
uses: docker/setup-qemu-action@v2
33+
34+
- name: Setup Docker Buildx
35+
uses: docker/setup-buildx-action@v2
36+
37+
- name: Login to DockerHub
38+
if: github.event_name == 'push'
39+
uses: docker/login-action@v2
40+
with:
41+
username: ${{ secrets.DOCKER_USER }}
42+
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
43+
44+
- name: Export docker build args
45+
run: |
46+
# see: scripts/build_docker.sh
47+
48+
# Strip git ref prefix from version
49+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
50+
51+
# Generate PR tag from github.ref == "refs/pull/123/merge"
52+
[ "$VERSION" == "merge" ] && VERSION=$(echo "${{ github.ref }}" | sed -e 's,refs/pull/\(.*\)/merge,pr-\1,')
53+
54+
# Use Docker `latest` tag convention
55+
[ "$VERSION" == "main" ] && VERSION=latest
56+
57+
git_commit_sha="$(git rev-parse HEAD)"
58+
DOCKER_TAG="$(git rev-parse --abbrev-ref HEAD)-$(date -u +"%Y%m%dT%H%M%S%Z")"
59+
60+
echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV
61+
echo "COMMIT_SHA=$git_commit_sha" >> $GITHUB_ENV
62+
echo "IMAGE_VERSION=$DOCKER_TAG" >> $GITHUB_ENV
63+
64+
# print env vars for debugging
65+
cat "$GITHUB_ENV"
66+
67+
- name: Build and push runtime image
68+
uses: docker/build-push-action@v4
69+
with:
70+
# tensorflow not supported on PowerPC (ppc64le) or System Z (s390x)
71+
# https://pypi.org/project/tensorflow/2.12.0/#files
72+
# https://github.com/tensorflow/tensorflow/issues/46181
73+
platforms: linux/amd64,linux/arm64
74+
context: .
75+
target: runtime
76+
push: ${{ github.event_name != 'pull_request' }}
77+
tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
78+
build-args: |
79+
IMAGE_VERSION=${{ env.IMAGE_VERSION }}
80+
COMMIT_SHA=${{ env.COMMIT_SHA }}
81+
cache-from: type=gha
82+
cache-to: type=gha,mode=max

.github/workflows/test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- "release-[0-9].[0-9]+"
8+
paths-ignore:
9+
- "**.md"
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
env:
15+
CI: true
16+
DOCKER_BUILDKIT: 1
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- name: Setup Docker Buildx
22+
uses: docker/setup-buildx-action@v2
23+
24+
- name: Build dev image
25+
run: make build.develop
26+
27+
- name: Run lint
28+
run: ./scripts/develop.sh make fmt
29+
30+
- name: Run unit test
31+
run: ./scripts/develop.sh make test

.github/workflows/unit-test.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)