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

Use KServe component in tests instead of KFServing #2164

Merged
merged 2 commits into from
Jul 19, 2022
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
2 changes: 2 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ included in the tests.

### Test Suite

**To use KFserving v0.5/0.6 instead of KServe v0.7, comment the 6,7th lines and uncomment the 10,11th lines here [e2e/utils/kserve.py](https://github.com/kubeflow/manifests/compare/master/tests/e2e/utils/kserve.py#L6-L11)**

The e2e tests are completely independent of the underlying K8s cluster, as well
as the platform of the cluster. These tests should be able to run in real
world clusters, as well as ephemeral ones like KinD.
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This test is using the following Kubeflow CRDs:
1. Kubeflow Pipelines
2. Katib Experiments
3. TFJobs
4. KFServing InferenceServices
4. KServe InferenceServices

## How to run

Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/mnist.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""E2E Kubeflow test that tesst Pipelines, Katib, TFJobs and KFServing.
"""E2E Kubeflow test that tesst Pipelines, Katib, TFJobs and KServe.

Requires:
pip install kfp==1.8.4
Expand All @@ -9,7 +9,7 @@
from kubernetes import config

import settings
from utils import isvc, katib, kfserving, tfjob
from utils import isvc, katib, kserve, tfjob

config.load_kube_config()

Expand Down Expand Up @@ -38,8 +38,8 @@ def mnist_pipeline(name=settings.PIPELINE_NAME,
tfjob_op = tfjob.create_tfjob_task(name, namespace, training_steps,
katib_op, model_volume_op)

# Create the KFServing inference.
kfserving.create_kfserving_task(name, namespace, tfjob_op,
# Create the KServe Inference
kserve.create_serving_task(name, namespace, tfjob_op,
model_volume_op)


Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/utils/isvc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from . import watch

GROUP = "serving.kubeflow.org"
GROUP = "serving.kserve.io" #"serving.kubeflow.org"
PLURAL = "inferenceservices"
VERSION = "v1beta1"

Expand Down
29 changes: 0 additions & 29 deletions tests/e2e/utils/kfserving.py

This file was deleted.

28 changes: 28 additions & 0 deletions tests/e2e/utils/kserve.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from kfp import components


def create_serving_task(model_name, model_namespace, tfjob_op, model_volume_op):

api_version = 'serving.kserve.io/v1beta1'
serving_component_url = 'https://raw.githubusercontent.com/kubeflow/pipelines/master/components/kserve/component.yaml'

# Uncomment the following two lines if you are using KFServing v0.6.x or v0.5.x
# api_version = 'serving.kubeflow.org/v1beta1'
# serving_component_url = 'https://raw.githubusercontent.com/kubeflow/pipelines/master/components/kubeflow/kfserving/component.yaml'

inference_service = '''
apiVersion: "{}"
kind: "InferenceService"
metadata:
name: {}
namespace: {}
annotations:
"sidecar.istio.io/inject": "false"
spec:
predictor:
tensorflow:
storageUri: "pvc://{}/"
'''.format(api_version, model_name, model_namespace, str(model_volume_op.outputs["name"]))

serving_launcher_op = components.load_component_from_url(serving_component_url)
serving_launcher_op(action="apply", inferenceservice_yaml=inference_service).after(tfjob_op)