Skip to content

Commit

Permalink
Merge branch 'community-master' into odh-master
Browse files Browse the repository at this point in the history
  • Loading branch information
spolti committed Jan 3, 2024
2 parents 4825c74 + fff1802 commit d1dd94d
Show file tree
Hide file tree
Showing 253 changed files with 102,937 additions and 18,939 deletions.
35 changes: 16 additions & 19 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"

- name: Setup Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -277,7 +277,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"

- name: Setup Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -349,7 +349,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"
- uses: actions/setup-python@v4
with:
python-version: "3.9"
Expand Down Expand Up @@ -407,7 +407,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"
- uses: actions/setup-python@v4
with:
python-version: "3.9"
Expand Down Expand Up @@ -460,7 +460,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"
- uses: actions/setup-python@v4
with:
python-version: "3.9"
Expand Down Expand Up @@ -498,7 +498,7 @@ jobs:
- name: Run E2E tests
timeout-minutes: 40
run: |
./test/scripts/gh-actions/run-e2e-tests.sh "transformer or mms" "2"
./test/scripts/gh-actions/run-e2e-tests.sh "transformer or mms or collocation" "2"
- name: Check system status
if: always()
Expand All @@ -512,7 +512,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"
- uses: actions/setup-python@v4
with:
python-version: "3.9"
Expand All @@ -524,14 +524,6 @@ jobs:
run: |
./test/scripts/gh-actions/build-qpext-image.sh
docker image ls
- name: Upload qpext image
uses: ishworkh/docker-image-artifact-upload@v1
with:
image: "kserve/qpext:${{ github.sha }}"
- name: Download qpext image
uses: ishworkh/docker-image-artifact-download@v1
with:
image: "kserve/qpext:${{ github.sha }}"
- name: Download sklearn server image
uses: ishworkh/docker-image-artifact-download@v1
with:
Expand Down Expand Up @@ -565,7 +557,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"
- uses: actions/setup-python@v4
with:
python-version: "3.9"
Expand Down Expand Up @@ -627,7 +619,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"
- uses: actions/setup-python@v4
with:
python-version: "3.9"
Expand Down Expand Up @@ -666,7 +658,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"
- uses: actions/setup-python@v4
with:
python-version: "3.9"
Expand All @@ -681,6 +673,11 @@ jobs:
with:
image: "kserve/sklearnserver:${{ github.sha }}"

- name: Download transformer image
uses: ishworkh/docker-image-artifact-download@v1
with:
image: "kserve/image-transformer:${{ github.sha }}"

- name: Install Poetry and version plugin
run: ./test/scripts/gh-actions/setup-poetry.sh

Expand Down Expand Up @@ -709,7 +706,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.20"
go-version: "1.21"
- uses: actions/setup-python@v4
with:
python-version: "3.9"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: "1.20"
go-version: "1.21"
id: go

- name: Check out code into the Go module directory
Expand Down
26 changes: 24 additions & 2 deletions .github/workflows/helm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,41 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write
packages: write

jobs:
upload-helm-charts:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: azure/setup-helm@v3

- uses: azure/setup-helm@v1
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Package helm charts
run: for dir in ./*/; do helm package $dir; done
working-directory: ${{ env.HELM_CHARTS_PATH }}

- name: Push Charts to GHCR
working-directory: ${{ env.HELM_CHARTS_PATH }}
run: |
for pkg in *.tgz; do
if [ -z "${pkg:-}" ]; then
break
fi
helm push "${pkg}" oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts
done
- name: Rename helm chart archives
run: for filename in *.tgz; do mv "$filename" "helm-chart-$filename"; done
working-directory: ${{ env.HELM_CHARTS_PATH }}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/qpext-docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ jobs:
docker-compose --file docker-compose.test.yml build
docker-compose --file docker-compose.test.yml run sut
else
cd qpext
docker buildx build . --file qpext.Dockerfile
docker buildx build . --file qpext/qpext.Dockerfile
fi
# Push image to GitHub Packages.
Expand Down Expand Up @@ -86,7 +85,7 @@ jobs:
uses: docker/build-push-action@v3
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
context: "{{defaultContext}}:qpext"
file: qpext.Dockerfile
context: "."
file: qpext/qpext.Dockerfile
push: true
tags: ${{ env.IMAGE_ID }}:${{ env.VERSION }}
5 changes: 3 additions & 2 deletions .github/workflows/verify-codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: 1.21

- name: Checkout source code
uses: actions/checkout@v3
Expand All @@ -33,6 +33,7 @@ jobs:
cp -a . $KSERVE_PATH
cd $KSERVE_PATH
make generate
make manifests
- name: Verify
shell: bash
Expand All @@ -50,7 +51,7 @@ jobs:
# Reset these files to avoid false triggers due to those changes.
git checkout -- python/kserve/test/__init__.py python/kserve/kserve/api_client.py
if [ -z "$(git status --porcelain ./pkg ./python)" ]; then
if [ -z "$(git status --porcelain ./pkg ./python ./config)" ]; then
echo "${{ github.repository }} up to date."
else
echo "Found diffs in: $(git diff-index --name-only HEAD -- ./pkg ./python)"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.20 as builder
FROM golang:1.21 as builder

# Copy in the go src
WORKDIR /go/src/github.com/kserve/kserve
Expand Down
75 changes: 35 additions & 40 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ALIBI_IMG ?= alibi-explainer
AIF_IMG ?= aiffairness
ART_IMG ?= art-explainer
STORAGE_INIT_IMG ?= storage-initializer
QPEXT_IMG ?= qpext
QPEXT_IMG ?= qpext:latest
CRD_OPTIONS ?= "crd:maxDescLen=0"
KSERVE_ENABLE_SELF_SIGNED_CA ?= false
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
Expand All @@ -35,12 +35,10 @@ $(LOCALBIN):
mkdir -p $(LOCALBIN)

## Tool Binaries
KUSTOMIZE ?= $(LOCALBIN)/kustomize
ENVTEST ?= $(LOCALBIN)/setup-envtest
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen

## Tool Versions
KUSTOMIZE_VERSION ?= v5.0.3
CONTROLLER_TOOLS_VERSION ?= v0.12.0

# CPU/Memory limits for controller-manager
Expand Down Expand Up @@ -75,35 +73,35 @@ run: generate fmt vet lint
deploy: manifests
# Remove the certmanager certificate if KSERVE_ENABLE_SELF_SIGNED_CA is not false
cd config/default && if [ ${KSERVE_ENABLE_SELF_SIGNED_CA} != false ]; then \
${KUSTOMIZE} edit remove resource ../certmanager; \
else ${KUSTOMIZE} edit add resource ../certmanager; fi;
${KUSTOMIZE} build config/default | kubectl apply -f -
echo > ../certmanager/certificate.yaml; \
else git checkout HEAD -- ../certmanager/certificate.yaml; fi;
kubectl apply -k config/default
if [ ${KSERVE_ENABLE_SELF_SIGNED_CA} != false ]; then ./hack/self-signed-ca.sh; fi;
kubectl wait --for=condition=ready pod -l control-plane=kserve-controller-manager -n kserve --timeout=300s
sleep 2
${KUSTOMIZE} build config/clusterresources | kubectl apply -f -
kubectl apply -k config/clusterresources
git checkout HEAD -- config/certmanager/certificate.yaml


deploy-dev: manifests
./hack/image_patch_dev.sh development
# Remove the certmanager certificate if KSERVE_ENABLE_SELF_SIGNED_CA is not false
cd config/default && if [ ${KSERVE_ENABLE_SELF_SIGNED_CA} != false ]; then \
${KUSTOMIZE} edit remove resource ../certmanager; \
else ${KUSTOMIZE} edit add resource ../certmanager; fi;
${KUSTOMIZE} build config/overlays/development | kubectl apply -f -
echo > ../certmanager/certificate.yaml; \
else git checkout HEAD -- ../certmanager/certificate.yaml; fi;
kubectl apply -k config/overlays/development
if [ ${KSERVE_ENABLE_SELF_SIGNED_CA} != false ]; then ./hack/self-signed-ca.sh; fi;
# TODO: Add runtimes as part of default deployment
kubectl wait --for=condition=ready pod -l control-plane=kserve-controller-manager -n kserve --timeout=300s
sleep 2
${KUSTOMIZE} build config/clusterresources | kubectl apply -f -
kubectl apply -k config/clusterresources
git checkout HEAD -- config/certmanager/certificate.yaml

deploy-dev-sklearn: docker-push-sklearn kustomize
deploy-dev-sklearn: docker-push-sklearn
./hack/serving_runtime_image_patch.sh "kserve-sklearnserver.yaml" "${KO_DOCKER_REPO}/${SKLEARN_IMG}"

deploy-dev-xgb: docker-push-xgb kustomize
deploy-dev-xgb: docker-push-xgb
./hack/serving_runtime_image_patch.sh "kserve-xgbserver.yaml" "${KO_DOCKER_REPO}/${XGB_IMG}"

deploy-dev-lgb: docker-push-lgb kustomize
deploy-dev-lgb: docker-push-lgb
./hack/serving_runtime_image_patch.sh "kserve-lgbserver.yaml" "${KO_DOCKER_REPO}/${LGB_IMG}"

deploy-dev-pmml : docker-push-pmml
Expand All @@ -112,13 +110,13 @@ deploy-dev-pmml : docker-push-pmml
deploy-dev-paddle: docker-push-paddle
./hack/serving_runtime_image_patch.sh "kserve-paddleserver.yaml" "${KO_DOCKER_REPO}/${PADDLE_IMG}"

deploy-dev-alibi: docker-push-alibi kustomize
deploy-dev-alibi: docker-push-alibi
./hack/alibi_patch_dev.sh ${KO_DOCKER_REPO}/${ALIBI_IMG}
${KUSTOMIZE} build config/overlays/dev-image-config | kubectl apply -f -
kubectl apply -k config/overlays/dev-image-config

deploy-dev-storageInitializer: docker-push-storageInitializer kustomize
deploy-dev-storageInitializer: docker-push-storageInitializer
./hack/storageInitializer_patch_dev.sh ${KO_DOCKER_REPO}/${STORAGE_INIT_IMG}
${KUSTOMIZE} build config/overlays/dev-image-config | kubectl apply -f -
kubectl apply -k config/overlays/dev-image-config

deploy-ci: manifests
kubectl apply -k config/overlays/test
Expand All @@ -130,14 +128,14 @@ deploy-helm: manifests
helm install kserve-crd charts/kserve-crd/ --wait --timeout 180s
helm install kserve charts/kserve-resources/ --wait --timeout 180s

undeploy: kustomize
${KUSTOMIZE} build config/default | kubectl delete -f -
undeploy:
kubectl delete -k config/default

undeploy-dev: kustomize
${KUSTOMIZE} build config/overlays/development | kubectl delete -f -
undeploy-dev:
kubectl delete -k config/overlays/development

# Generate manifests e.g. CRD, RBAC etc.
manifests: controller-gen kustomize
manifests: controller-gen
$(CONTROLLER_GEN) $(CRD_OPTIONS) paths=./pkg/apis/serving/... output:crd:dir=config/crd
$(CONTROLLER_GEN) rbac:roleName=kserve-manager-role paths=./pkg/controller/... output:rbac:artifacts:config=config/rbac
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths=./pkg/apis/serving/v1alpha1
Expand All @@ -156,19 +154,19 @@ manifests: controller-gen kustomize
#remove the required property on framework as name field needs to be optional
yq 'del(.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.*.properties.*.required)' -i config/crd/serving.kserve.io_inferenceservices.yaml
#remove ephemeralContainers properties for compress crd size https://github.com/kubeflow/kfserving/pull/1141#issuecomment-714170602
yq 'del(.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.*.properties.ephemeralContainers)' -i config/crd/serving.kserve.io_inferenceservices.yaml
yq 'del(.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.*.properties.ephemeralContainers)' -i config/crd/serving.kserve.io_inferenceservices.yaml
#knative does not allow setting port on liveness or readiness probe
yq 'del(.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.*.properties.*.properties.readinessProbe.properties.httpGet.required)' -i config/crd/serving.kserve.io_inferenceservices.yaml
yq 'del(.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.*.properties.*.properties.livenessProbe.properties.httpGet.required)' -i config/crd/serving.kserve.io_inferenceservices.yaml
yq 'del(.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.*.properties.*.properties.readinessProbe.properties.tcpSocket.required)' -i config/crd/serving.kserve.io_inferenceservices.yaml
yq 'del(.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.*.properties.*.properties.livenessProbe.properties.tcpSocket.required)' -i config/crd/serving.kserve.io_inferenceservices.yaml
yq 'del(.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.*.properties.containers.items.properties.livenessProbe.properties.httpGet.required)' -i config/crd/serving.kserve.io_inferenceservices.yaml
yq 'del(.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.*.properties.containers.items.properties.readinessProbe.properties.httpGet.required)' -i config/crd/serving.kserve.io_inferenceservices.yaml
yq 'del(.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.*.properties.*.properties.readinessProbe.properties.httpGet.required)' -i config/crd/serving.kserve.io_inferenceservices.yaml
yq 'del(.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.*.properties.*.properties.livenessProbe.properties.httpGet.required)' -i config/crd/serving.kserve.io_inferenceservices.yaml
yq 'del(.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.*.properties.*.properties.readinessProbe.properties.tcpSocket.required)' -i config/crd/serving.kserve.io_inferenceservices.yaml
yq 'del(.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.*.properties.*.properties.livenessProbe.properties.tcpSocket.required)' -i config/crd/serving.kserve.io_inferenceservices.yaml
yq 'del(.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.*.properties.containers.items.properties.livenessProbe.properties.httpGet.required)' -i config/crd/serving.kserve.io_inferenceservices.yaml
yq 'del(.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.*.properties.containers.items.properties.readinessProbe.properties.httpGet.required)' -i config/crd/serving.kserve.io_inferenceservices.yaml
#With v1 and newer kubernetes protocol requires default
yq '.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties | .. | select(has("protocol")) | path' config/crd/serving.kserve.io_inferenceservices.yaml -o j | jq -r '. | map(select(numbers)="["+tostring+"]") | join(".")' | awk '{print "."$$0".protocol.default"}' | xargs -n1 -I{} yq '{} = "TCP"' -i config/crd/serving.kserve.io_inferenceservices.yaml
yq '.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties | .. | select(has("protocol")) | path' config/crd/serving.kserve.io_clusterservingruntimes.yaml -o j | jq -r '. | map(select(numbers)="["+tostring+"]") | join(".")' | awk '{print "."$$0".protocol.default"}' | xargs -n1 -I{} yq '{} = "TCP"' -i config/crd/serving.kserve.io_clusterservingruntimes.yaml
yq '.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties | .. | select(has("protocol")) | path' config/crd/serving.kserve.io_servingruntimes.yaml -o j | jq -r '. | map(select(numbers)="["+tostring+"]") | join(".")' | awk '{print "."$$0".protocol.default"}' | xargs -n1 -I{} yq '{} = "TCP"' -i config/crd/serving.kserve.io_servingruntimes.yaml
${KUSTOMIZE} build config/crd > test/crds/serving.kserve.io_inferenceservices.yaml
kubectl kustomize config/crd > test/crds/serving.kserve.io_inferenceservices.yaml

# Run go fmt against code
fmt:
Expand Down Expand Up @@ -296,11 +294,14 @@ docker-push-storageInitializer: docker-build-storageInitializer
docker push ${KO_DOCKER_REPO}/${STORAGE_INIT_IMG}

docker-build-qpext:
cd qpext && docker buildx build -t ${KO_DOCKER_REPO}/${QPEXT_IMG} -f qpext.Dockerfile .
docker buildx build -t ${KO_DOCKER_REPO}/${QPEXT_IMG} -f qpext/qpext.Dockerfile .

docker-build-push-qpext: docker-build-qpext
docker push ${KO_DOCKER_REPO}/${QPEXT_IMG}

deploy-dev-qpext: docker-build-push-qpext
kubectl patch cm config-deployment -n knative-serving --type merge --patch '{"data": {"queue-sidecar-image": "${KO_DOCKER_REPO}/${QPEXT_IMG}"}}'

docker-build-success-200-isvc:
cd python && docker buildx build -t ${KO_DOCKER_REPO}/${SUCCESS_200_ISVC_IMG} -f success_200_isvc.Dockerfile .

Expand All @@ -320,12 +321,6 @@ controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessar
$(CONTROLLER_GEN): $(LOCALBIN)
test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
$(KUSTOMIZE): $(LOCALBIN)
test -s $(LOCALBIN)/kustomize || { curl -Ss $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }

envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
Expand Down
Loading

0 comments on commit d1dd94d

Please sign in to comment.