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

Add issue templates for code synchronization #87

Open
wants to merge 7 commits into
base: master-bad
Choose a base branch
from
Open
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
9 changes: 6 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
name: Bug report
about: Tell us about a problem you are experiencing
title: ''
labels: kind/bug
assignees: ''

---

Expand All @@ -26,7 +29,7 @@ about: Tell us about a problem you are experiencing
- Knative Version:
- KServe Version:
- Kubeflow version:
- Cloud Environment:[k8s_istio/istio_dex/gcp_basic_auth/gcp_iap/aws/aws_cognito/ibm]
- Minikube/Kind version:
- Kubernetes version: (use `kubectl version`):
- Open Data Hub version:
- Deployment Environment:[cloud (aws|gcp|ibm|azure), on prem, edge ]
- OpenShift version: (use `kubectl version`):
- OS (e.g. from `/etc/os-release`):
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
name: Feature enhancement request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

Expand Down
73 changes: 73 additions & 0 deletions .github/ISSUE_TEMPLATE/upstream-sync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
name: Upstream sync
about: Outlines the process to synchonize ODH fork with upstream KServe repositories
title: Synchronization with upstream repositories
labels: ''
assignees: ''

---

This repository is configured with a GitHub App that automatically creates pull requests to incorporate upstream changes into ODH's fork. Because of adaptations to enhance UX with OpenShift, changes need to be reviewed carefully. The most notable points of conflict are:

* ODH fork removes `ClusterServingRuntime` CRD. If new upstream development includes changes that involve this CRD, the code needs to be adapted.
* ODH fork uses OpenShift's Serving Certificates, instead of relying on cert-manager. If new upstream development includes changes that involve cert-manager, the code needs to be adapted.
* Files related to GitHub Actions have some changes because of ODH tooling.

It is important to note that the synchronization should be done both for the `master` branch, and also for `release-*` branches (this ticket should be used to cover both). At the time of writing, only `release-v0.11` was an active release branch.

## Code synchronization

To synchronize ODH's KServe fork with upstream, do the following steps:

1. Search for automatic synchronization pull requests. You can use [this link](https://github.com/opendatahub-io/kserve/pulls/app%2Fpull).
* If there are no PRs, no synchronization should be needed. Although, it is worth to re-check one or two days later, in case the bot hasn't run.
1. Open the found pull request. If there is more than one pull request, it is (most likely) one per branch that needs synchronization, and you need to do the rest of the steps for each pull request.
1. Go to the bottom of the pull request page, where the "Merge pull request" button is located. If you see the "This branch has conflicts that must be resolved" message, you will need to do the synchronization manually (skip to the following set of steps).
1. Verify if there is any failing check. You may need to give approval to run checks: one approval to run openshift-ci and another one for GitHub Actions. Trigger re-tests if needed.
* If some check is giving a true positive, you will need to do a manual sync (as that typically needs code changes/adaptations).
1. Carefully review the new changes, to make sure that no unwanted logic is included (typically, it would be around `ClusterServingRuntimes` and cert-manager stuff).
* If there are unwanted changes, you will need to do a manual sync (as that typically needs code changes/adaptations).
1. If everything is good. Approve the PR and let openshift-ci merge it.
* You can either use GitHub's review/approval feature, or you can leave a comment with both `/approve` and `/lgtm` commands.

If you need to syncrhonize manually, do the following steps:

1. If you haven't done so, create your own fork of ODH's KServe: https://github.com/opendatahub-io/kserve/fork
1. If you haven't done so, checkout your fork of KServe: `git clone [email protected]:{$YOUR_GITHUB_USER}/kserve.git && cd kserve`
* If you already forked ODH's KServe, make sure you fetch the latest code from ODH repositories. Fetch the relevant branch you want to synchronize.
1. Checkout to the branch you want to synchronize.
* e.g. If you want to synchronize `release-v0.11`, do `git branch release-v0.11-sync origin/release-v0.11 && git checkout -b release-v0.11-sync`.
1. If you haven't done so, add upstream as a remote: `git remote add kserve [email protected]:kserve/kserve.git`
1. Fetch latest code from upstream KServe: `git fetch kserve`
1. Do the sync as a merge.
* e.g. If you want to synchronize `release-v0.11`, do `git merge kserve/release-0.11`.
1. If there are any conflicts, or there are any adaptations that need to be done, do them now.
1. Commit any changes to your local branch: `git commit --signoff`.
1. Push the local branch to your fork: `git push origin release-v0.11-sync`.
1. Open a pull request: e.g. go to https://github.com/{$YOUR_GITHUB_USER}/kserve/pull/new/release-v0.11-sync
1. You will need help from one of your peers. Ask somebody to carefully review and test your synchronization PR, and approve it.
1. Once your PR is merged, you can close the automatic PR that the GitHub App (the bot) created.

## Manifests replication to `odh-manifests` repository

At the time of writing, ODH operator is installing components using manifests from `odh-manifests`. There is active work to deprecate that repository and use manifests located on each component repository. While that work finishes, you need to replicate manifests if something changed inside the `config/` folder as part of the syncrhonization.

You need to do manifest syncrhonization **only** for the most recent release branch.

1. If you haven't done so, create your own fork of `odh-manifests` repository: https://github.com/opendatahub-io/odh-manifests/fork
1. If you haven't done so, checkout your fork of `odh-manifests`: `git clone [email protected]:{$YOUR_GITHUB_USER}/odh-manifests.git && cd odh-manifests`
* If you already forked `odh-manifests`, make sure you fetch the latest code from ODH repository `master` branch.
1. Create a branch to do the update: `git branch kserve-manifest-update master && git checkout kserve-manifest-update`
1. Follow the instructions at https://github.com/opendatahub-io/odh-manifests/tree/master/kserve#updating-the-manifests.
* You may need to change the hack/kustomize.yaml file to point to the right `ref`: https://github.com/opendatahub-io/odh-manifests/blob/master/kserve/hack/kustomization.yaml#L5.
1. Run `git diff`, or your favorite diff tool and carefully review the changes.
* There are some patches in the [kserve/base folder](https://github.com/opendatahub-io/odh-manifests/tree/master/kserve/base). As part of reviewing the manifest update changes, check if the patches need to be updated. Updating the patches is a manual process.
1. Review and update the `params.env` file, if image references need to be updated: https://github.com/opendatahub-io/odh-manifests/blob/master/kserve/base/params.env
1. Test that the manifests build correctly: `kustomize build ./kserve/base`.
* You should see the manifests being outputted to the console.
* If you see any errors, you will need to fix them. Usually, no YAML is going to be generated as the result of an error.
1. Commit any changes to your local branch: `git commit --signoff`.
1. Push the local branch to your fork: `git push origin kserve-manifest-update`.
1. Open a pull request: e.g. go to https://github.com/{$YOUR_GITHUB_USER}/odh-manifests/pull/new/kserve-manifest-update
1. You will need help from one of your peers. Ask somebody to carefully review and test your synchronization PR, and approve it. Let openshift-ci to merge your pull request.

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/[email protected]
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
2 changes: 1 addition & 1 deletion config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ kind: Kustomization
resources:
- serving.kserve.io_inferenceservices.yaml
- serving.kserve.io_trainedmodels.yaml
- serving.kserve.io_clusterservingruntimes.yaml
# - serving.kserve.io_clusterservingruntimes.yaml # Not supported in ODH
- serving.kserve.io_servingruntimes.yaml
- serving.kserve.io_inferencegraphs.yaml

Expand Down
2 changes: 1 addition & 1 deletion config/default/cainjection_conversion_webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(kserveNamespace)/serving-cert
service.beta.openshift.io/inject-cabundle: "true"
name: inferenceservices.serving.kserve.io
1 change: 1 addition & 0 deletions config/default/inferenceservice_conversion_webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: inferenceservices.serving.kserve.io
creationTimestamp: null
spec:
preserveUnknownFields: false
conversion:
Expand Down
2 changes: 1 addition & 1 deletion config/default/isvc_mutatingwebhook_cainjection_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: MutatingWebhookConfiguration
metadata:
name: inferenceservice.serving.kserve.io
annotations:
cert-manager.io/inject-ca-from: $(kserveNamespace)/serving-cert
service.beta.openshift.io/inject-cabundle: "true"
webhooks:
- name: inferenceservice.kserve-webhook-server.defaulter
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: ValidatingWebhookConfiguration
metadata:
name: inferenceservice.serving.kserve.io
annotations:
cert-manager.io/inject-ca-from: $(kserveNamespace)/serving-cert
service.beta.openshift.io/inject-cabundle: "true"
webhooks:
- name: inferenceservice.kserve-webhook-server.validator
Loading