Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt GH-workflows to correctly push to ODH container repositories #28

Merged
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
25 changes: 16 additions & 9 deletions .github/workflows/agent-docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
# Publish `master` as Docker `latest` image.
branches:
- master
- release-*

# Publish `v1.2.3` tags as releases.
tags:
Expand All @@ -14,7 +15,7 @@ on:
pull_request:

env:
IMAGE_NAME: agent
IMAGE_NAME: kserve-agent

jobs:
# Run tests.
Expand Down Expand Up @@ -54,15 +55,16 @@ jobs:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
- name: Login to Quay
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: quay.io
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: export version variable
run: |
IMAGE_ID=kserve/$IMAGE_NAME
IMAGE_ID=quay.io/${{ vars.QUAY_OWNER }}/$IMAGE_NAME

# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
Expand All @@ -75,9 +77,14 @@ jobs:

# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest

echo VERSION=$VERSION >> $GITHUB_ENV
echo IMAGE_ID=$IMAGE_ID >> $GITHUB_ENV
[[ "$VERSION" =~ ^release- ]] && VERSION=$(echo $VERSION | sed 's/^release-//')-latest

TAGS=$IMAGE_ID:$VERSION

# If a vX.Y.Z release is being built, also update the vX.Y tag.
[[ "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && TAGS=$TAGS,$IMAGE_ID:$(echo $VERSION | sed 's/\(.*\)\.[[:digit:]]\+$/\1/')

echo CONTAINER_TAGS=$TAGS >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v3
Expand All @@ -86,4 +93,4 @@ jobs:
context: .
file: agent.Dockerfile
push: true
tags: ${{ env.IMAGE_ID }}:${{ env.VERSION }}
tags: ${{ env.CONTAINER_TAGS }}
4 changes: 3 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ jobs:
echo "Coverage output is ${{ steps.test.outputs.coverage }}"

- name: Update coverage badge
if: github.ref == 'refs/heads/master'
# Disabling, because this tries to update a Gist owned by KServe.
# More info: https://github.com/opendatahub-io/kserve/issues/29
if: false # github.ref == 'refs/heads/master'
uses: schneegans/dynamic-badges-action@v1.4.0
with:
auth: ${{ secrets.GIST_SECRET }}
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/kserve-controller-docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
# Publish `master` as Docker `latest` image.
branches:
- master
- release-*

# Publish `v1.2.3` tags as releases.
tags:
Expand Down Expand Up @@ -52,15 +53,16 @@ jobs:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
- name: Login to Quay
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: quay.io
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: export version variable
run: |
IMAGE_ID=kserve/$IMAGE_NAME
IMAGE_ID=quay.io/${{ vars.QUAY_OWNER }}/$IMAGE_NAME

# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
Expand All @@ -73,9 +75,14 @@ jobs:

# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
[[ "$VERSION" =~ ^release- ]] && VERSION=$(echo $VERSION | sed 's/^release-//')-latest

echo VERSION=$VERSION >> $GITHUB_ENV
echo IMAGE_ID=$IMAGE_ID >> $GITHUB_ENV
TAGS=$IMAGE_ID:$VERSION

# If a vX.Y.Z release is being built, also update the vX.Y tag.
[[ "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && TAGS=$TAGS,$IMAGE_ID:$(echo $VERSION | sed 's/\(.*\)\.[[:digit:]]\+$/\1/')

echo CONTAINER_TAGS=$TAGS >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v3
Expand All @@ -84,4 +91,4 @@ jobs:
context: .
file: Dockerfile
push: true
tags: ${{ env.IMAGE_ID }}:${{ env.VERSION }}
tags: ${{ env.CONTAINER_TAGS }}
25 changes: 16 additions & 9 deletions .github/workflows/router-docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
# Publish `master` as Docker `latest` image.
branches:
- master
- release-*

# Publish `v1.2.3` tags as releases.
tags:
Expand All @@ -14,7 +15,7 @@ on:
pull_request:

env:
IMAGE_NAME: router
IMAGE_NAME: kserve-router

jobs:
# Run tests.
Expand Down Expand Up @@ -52,15 +53,16 @@ jobs:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
- name: Login to Quay
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: quay.io
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: export version variable
run: |
IMAGE_ID=kserve/$IMAGE_NAME
IMAGE_ID=quay.io/${{ vars.QUAY_OWNER }}/$IMAGE_NAME

# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
Expand All @@ -73,9 +75,14 @@ jobs:

# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest

echo VERSION=$VERSION >> $GITHUB_ENV
echo IMAGE_ID=$IMAGE_ID >> $GITHUB_ENV
[[ "$VERSION" =~ ^release- ]] && VERSION=$(echo $VERSION | sed 's/^release-//')-latest

TAGS=$IMAGE_ID:$VERSION

# If a vX.Y.Z release is being built, also update the vX.Y tag.
[[ "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && TAGS=$TAGS,$IMAGE_ID:$(echo $VERSION | sed 's/\(.*\)\.[[:digit:]]\+$/\1/')

echo CONTAINER_TAGS=$TAGS >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v3
Expand All @@ -84,4 +91,4 @@ jobs:
context: .
file: router.Dockerfile
push: true
tags: ${{ env.IMAGE_ID }}:${{ env.VERSION }}
tags: ${{ env.CONTAINER_TAGS }}
14 changes: 10 additions & 4 deletions .github/workflows/storage-initializer-docker-publisher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
# Publish `master` as Docker `latest` image.
branches:
- master
- release-*

# Publish `v1.2.3` tags as releases.
tags:
Expand All @@ -14,7 +15,7 @@ on:
pull_request:

env:
IMAGE_NAME: storage-initializer
IMAGE_NAME: kserve-storage-initializer

jobs:
# Run tests.
Expand Down Expand Up @@ -53,11 +54,11 @@ jobs:
docker buildx build . --file storage-initializer.Dockerfile --tag $IMAGE_NAME

- name: Log into registry
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
run: docker login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_PASSWORD }} quay.io

- name: Push image
run: |
IMAGE_ID=kserve/$IMAGE_NAME
IMAGE_ID=quay.io/${{ vars.QUAY_OWNER }}/$IMAGE_NAME

# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
Expand All @@ -70,10 +71,15 @@ jobs:

# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
[[ "$VERSION" =~ ^release- ]] && VERSION=$(echo $VERSION | sed 's/^release-//')-latest

echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION

docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION


# If a vX.Y.Z release is being built, also update the vX.Y tag.
[[ "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && MINOR_VERSION=$(echo $VERSION | sed 's/\(.*\)\.[[:digit:]]\+$/\1/')
[ ! -z "$MINOR_VERSION" ] && docker tag $IMAGE_NAME $IMAGE_ID:$MINOR_VERSION
[ ! -z "$MINOR_VERSION" ] && docker push $IMAGE_ID:$MINOR_VERSION || true
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# KServe
[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/github.com/kserve/kserve)
[![Coverage Status](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/andyi2it/5174bd748ac63a6e4803afea902e9810/raw/coverage.json)](https://github.com/kserve/kserve/actions/workflows/go.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/kserve/kserve)](https://goreportcard.com/report/github.com/kserve/kserve)
[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6643/badge)](https://bestpractices.coreinfrastructure.org/projects/6643)
[![Releases](https://img.shields.io/github/release-pre/kserve/kserve.svg?sort=semver)](https://github.com/kserve/kserve/releases)
[![LICENSE](https://img.shields.io/github/license/kserve/kserve.svg)](https://github.com/kserve/kserve/blob/master/LICENSE)
[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/github.com/opendatahub-io/kserve)
[![Go Report Card](https://goreportcard.com/badge/github.com/opendatahub-io/kserve)](https://goreportcard.com/report/github.com/opendatahub-io/kserve)
[![Releases](https://img.shields.io/github/release-pre/opendatahub-io/kserve.svg?sort=semver)](https://github.com/opendatahub-io/kserve/releases)
[![LICENSE](https://img.shields.io/github/license/opendatahub-io/kserve.svg)](https://github.com/opendatahub-io/kserve/blob/master/LICENSE)
[![Slack Status](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social)](https://kubeflow.slack.com/archives/CH6E58LNP)

KServe provides a Kubernetes [Custom Resource Definition](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) for serving machine learning (ML) models on arbitrary frameworks. It aims to solve production model serving use cases by providing performant, high abstraction interfaces for common ML frameworks like Tensorflow, XGBoost, ScikitLearn, PyTorch, and ONNX.
Expand Down
Loading