Skip to content

Commit

Permalink
Remove knative installation in raw tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sivanantham Chinnaiyan <[email protected]>
  • Loading branch information
sivanantha321 committed Feb 12, 2024
1 parent e07769b commit 1923acf
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 26 deletions.
6 changes: 5 additions & 1 deletion .github/actions/kserve-dep-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ inputs:
description: 'Network layer to install'
required: true
default: 'istio'
deployment-mode:
description: 'Kserve deployment mode. Supported values are serverless and raw'
required: false
default: 'serverless'
runs:
using: "composite"
steps:
Expand All @@ -15,7 +19,7 @@ runs:
if [[ "${{ inputs.network-layer }}" == "istio" ]]; then
echo "Selected network layer ${{ inputs.network-layer }}"
./test/scripts/gh-actions/setup-deps.sh
./test/scripts/gh-actions/setup-deps.sh ${{ inputs.deployment-mode }}
kubectl get pods -n istio-system
kubectl describe svc -n istio-system istio-ingressgateway
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Free-up disk space
uses: ./.github/actions/free-up-disk-space

- name: Setup Go
uses: actions/setup-go@v4
with:
Expand All @@ -285,18 +288,15 @@ jobs:
with:
python-version: "3.9"

- name: Free-up disk space
uses: ./.github/actions/free-up-disk-space

- name: Setup Minikube
uses: ./.github/actions/minikube-setup

- name: Download base images
uses: ./.github/actions/base-download

- name: KServe dependency setup
uses: ./.github/actions/kserve-dep-setup

- name: Download base images
uses: ./.github/actions/base-download

- name: Download predictor artifacts
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -670,6 +670,8 @@ jobs:
- uses: ./.github/actions/free-up-disk-space
- uses: ./.github/actions/minikube-setup
- uses: ./.github/actions/kserve-dep-setup
with:
deployment-mode: "raw"
- uses: ./.github/actions/base-download

- name: Download sklearn server image
Expand Down Expand Up @@ -700,7 +702,7 @@ jobs:

- name: Install KServe
run: |
./test/scripts/gh-actions/setup-kserve.sh
./test/scripts/gh-actions/setup-kserve.sh "raw"
kubectl get pods -n kserve
kubectl describe pods -n kserve
Expand Down
5 changes: 0 additions & 5 deletions test/e2e/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import json
import logging
import os
import time
from urllib.parse import urlparse

import grpc
Expand Down Expand Up @@ -81,8 +80,6 @@ def predict_str(service_name, input_json, protocol_version="v1",
namespace=KSERVE_TEST_NAMESPACE,
version=version,
)
# temporary sleep until this is fixed https://github.com/kserve/kserve/issues/604
time.sleep(10)
cluster_ip, host, path = get_isvc_endpoint(isvc)
headers = {"Host": host, "Content-Type": "application/json"}

Expand Down Expand Up @@ -151,8 +148,6 @@ def explain_response(service_name, input_json):
namespace=KSERVE_TEST_NAMESPACE,
version=constants.KSERVE_V1BETA1_VERSION,
)
# temporary sleep until this is fixed https://github.com/kserve/kserve/issues/604
time.sleep(10)
cluster_ip, host, _ = get_isvc_endpoint(isvc)
url = "http://{}/v1/models/{}:explain".format(cluster_ip, service_name)
headers = {"Host": host}
Expand Down
27 changes: 15 additions & 12 deletions test/scripts/gh-actions/setup-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ set -o nounset
set -o pipefail

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )";
DEPLOYMENT_MODE="$1"

ISTIO_VERSION="1.19.4"
CERT_MANAGER_VERSION="v1.5.0"
Expand Down Expand Up @@ -56,18 +57,20 @@ spec:
controller: istio.io/ingress-controller
EOF

source ./test/scripts/gh-actions/install-knative-operator.sh

echo "Installing Knative serving ..."
kubectl apply -f ./test/overlays/knative/knative-serving-istio.yaml
# sleep to avoid running kubectl wait before pods are created
sleep 15

echo "Waiting for Knative to be ready ..."
kubectl wait --for=condition=Ready pods --all --timeout=400s -n knative-serving -l 'app in (webhook, activator,autoscaler,autoscaler-hpa,controller,net-istio-controller,net-istio-webhook)'

# echo "Add knative hpa..."
# kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.0.0/serving-hpa.yaml
shopt -s nocasematch
if [[ $DEPLOYMENT_MODE != "raw" ]];then
source ./test/scripts/gh-actions/install-knative-operator.sh

echo "Installing Knative serving ..."
kubectl apply -f ./test/overlays/knative/knative-serving-istio.yaml
# sleep to avoid running kubectl wait before pods are created
sleep 15
echo "Waiting for Knative to be ready ..."
kubectl wait --for=condition=Ready pods --all --timeout=400s -n knative-serving -l 'app in (webhook, activator,autoscaler,autoscaler-hpa,controller,net-istio-controller,net-istio-webhook)'
# echo "Add knative hpa..."
# kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.0.0/serving-hpa.yaml
fi
shopt -u nocasematch

echo "Installing cert-manager ..."
kubectl create namespace cert-manager
Expand Down
9 changes: 8 additions & 1 deletion test/scripts/gh-actions/setup-kserve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@

# The script will install KServe dependencies in the GH Actions environment.
# (Istio, Knative, cert-manager, kustomize, yq)
# Usage: setup-kserve.sh $DEPLOYMENT_MODE

set -o errexit
set -o nounset
set -o pipefail
DEPLOYMENT_MODE=$1

make deploy-ci

shopt -s nocasematch
if [[ $DEPLOYMENT_MODE == "raw" ]];then
echo "Patching default deployment mode to raw deployment"
kubectl patch cm -n kserve inferenceservice-config --patch='{"data": {"deploy": "{\"defaultDeploymentMode\": \"RawDeployment\"}"}}'
fi
shopt -u nocasematch
echo "Waiting for KServe started ..."
kubectl wait --for=condition=Ready pods --all --timeout=180s -n kserve
kubectl get events -A
Expand Down

0 comments on commit 1923acf

Please sign in to comment.