Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions .github/workflows/abn-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- samples/abn-sample

jobs:
# A/B/n sample backend HTTP service
build-and-push-backend:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -39,6 +40,8 @@ jobs:
file: samples/abn-sample/backend/Dockerfile
push: true

# A/B/n sample frontend where the backend is a simple HTTP server (see above)
# Sample frontends are provided in both go and node
build-and-push-frontends:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -74,3 +77,121 @@ jobs:
file: samples/abn-sample/frontend/${{ matrix.lang }}/Dockerfile
push: true


# A/B/n sample frontend for modelmesh-serving
# In this case, the backends are models deployed as InferenceServices
# This frontend is implemented omly in go
build-and-push-mm-frontend:
runs-on: ubuntu-latest
strategy:
matrix:
lang: [go]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get version
run: |
tagref=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tagref
echo "VERSION=$(echo $tagref | sed -e 's/^v//')" >> $GITHUB_ENV
echo "MAJOR_MINOR_VERSION=$(echo $tagref | sed -e 's/^v//' -e 's,\([0-9]*\.[0-9]*\)\.\([0-9]*\),\1,')" >> $GITHUB_ENV
- name: Get owner
run: |
ownerrepo=${{ github.repository }}
owner=$(echo $ownerrepo | cut -f1 -d/)
if [[ "$owner" == "iter8-tools" ]]; then
owner=iter8
fi
echo "OWNER=$owner" >> $GITHUB_ENV
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_SECRET }}
- uses: docker/build-push-action@v4
with:
platforms: linux/amd64,linux/arm64
tags: ${{ env.OWNER }}/abn-sample-mm-frontend-${{ matrix.lang }}:${{ env.VERSION }},${{ env.OWNER }}/abn-sample-mm-frontend-${{ matrix.lang }}:${{ env.MAJOR_MINOR_VERSION }},${{ env.OWNER }}/abn-sample-mm-frontend-${{ matrix.lang }}:latest
file: samples/abn-sample/mm-frontend/${{ matrix.lang }}/Dockerfile
context: samples/abn-sample/mm-frontend/${{ matrix.lang }}
push: true

# A/B/n sample frontend for KServe w/ HTTP
# In this case, the backends are models deployed as InferenceServices
# This frontend is implemented omly in go
build-and-push-kserve-http-frontend:
runs-on: ubuntu-latest
strategy:
matrix:
lang: [go]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get version
run: |
tagref=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tagref
echo "VERSION=$(echo $tagref | sed -e 's/^v//')" >> $GITHUB_ENV
echo "MAJOR_MINOR_VERSION=$(echo $tagref | sed -e 's/^v//' -e 's,\([0-9]*\.[0-9]*\)\.\([0-9]*\),\1,')" >> $GITHUB_ENV
- name: Get owner
run: |
ownerrepo=${{ github.repository }}
owner=$(echo $ownerrepo | cut -f1 -d/)
if [[ "$owner" == "iter8-tools" ]]; then
owner=iter8
fi
echo "OWNER=$owner" >> $GITHUB_ENV
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_SECRET }}
- uses: docker/build-push-action@v4
with:
platforms: linux/amd64,linux/arm64
tags: ${{ env.OWNER }}/abn-sample-kserve-http-frontend-${{ matrix.lang }}:${{ env.VERSION }},${{ env.OWNER }}/abn-sample-kserve-http-frontend-${{ matrix.lang }}:${{ env.MAJOR_MINOR_VERSION }},${{ env.OWNER }}/abn-sample-kserve-http-frontend-${{ matrix.lang }}:latest
file: samples/abn-sample/kserve-http-frontend/${{ matrix.lang }}/Dockerfile
context: samples/abn-sample/kserve-http-frontend/${{ matrix.lang }}
push: true

# A/B/n sample frontend for KServe w/ gRPC
# In this case, the backends are models deployed as InferenceServices
# This frontend is implemented omly in go
build-and-push-kserve-grpc-frontend:
runs-on: ubuntu-latest
strategy:
matrix:
lang: [go]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get version
run: |
tagref=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tagref
echo "VERSION=$(echo $tagref | sed -e 's/^v//')" >> $GITHUB_ENV
echo "MAJOR_MINOR_VERSION=$(echo $tagref | sed -e 's/^v//' -e 's,\([0-9]*\.[0-9]*\)\.\([0-9]*\),\1,')" >> $GITHUB_ENV
- name: Get owner
run: |
ownerrepo=${{ github.repository }}
owner=$(echo $ownerrepo | cut -f1 -d/)
if [[ "$owner" == "iter8-tools" ]]; then
owner=iter8
fi
echo "OWNER=$owner" >> $GITHUB_ENV
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_SECRET }}
- uses: docker/build-push-action@v4
with:
platforms: linux/amd64,linux/arm64
tags: ${{ env.OWNER }}/abn-sample-kserve-grpc-frontend-${{ matrix.lang }}:${{ env.VERSION }},${{ env.OWNER }}/abn-sample-kserve-grpc-frontend-${{ matrix.lang }}:${{ env.MAJOR_MINOR_VERSION }},${{ env.OWNER }}/abn-sample-kserve-grpc-frontend-${{ matrix.lang }}:latest
file: samples/abn-sample/kserve-grpc-frontend/${{ matrix.lang }}/Dockerfile
context: samples/abn-sample/kserve-grpc-frontend/${{ matrix.lang }}
push: true

6 changes: 6 additions & 0 deletions go.work
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
go 1.21.0

use ./samples/abn-sample/frontend/go
use ./samples/abn-sample/mm-frontend/go
use ./samples/abn-sample/kserve-http-frontend/go
use ./samples/abn-sample/kserve-grpc-frontend/go
6 changes: 3 additions & 3 deletions samples/abn-sample/frontend/go/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Get Iter8
FROM golang:1.19-buster as builder
FROM golang:1.21-bookworm as builder

# # Install protoc
# RUN apt update && apt install -y protobuf-compiler
Expand All @@ -9,7 +9,7 @@ FROM golang:1.19-buster as builder

# Get source
WORKDIR /
COPY samples/abn-sample/frontend/go .
COPY . ./
# COPY samples/abn-sample/frontend/abn.proto .

# # generate gRPC libraries from abn.proto
Expand All @@ -24,7 +24,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o fe main.go
### New image below

# Small Linux image with Iter8 binary
FROM debian:buster-slim
FROM debian:bookworm-slim
WORKDIR /
COPY --from=builder /fe /frontend

Expand Down
10 changes: 5 additions & 5 deletions samples/abn-sample/frontend/go/go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
module github.com/kalantar/ab-example/frontend/go

go 1.17
go 1.21

require (
github.com/iter8-tools/iter8 v0.16.0
github.com/sirupsen/logrus v1.9.0
google.golang.org/grpc v1.56.2
github.com/iter8-tools/iter8 v0.17.1
github.com/sirupsen/logrus v1.9.3
google.golang.org/grpc v1.58.0
)

require (
github.com/golang/protobuf v1.5.3 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/protobuf v1.31.0 // indirect
)
Loading