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

feat: Support customizable deployment strategy for RawDeployment mode. Fixes #3452 #3603

Merged
merged 10 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 54 additions & 0 deletions config/crd/full/serving.kserve.io_inferenceservices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,24 @@ spec:
- name
type: object
type: array
deploymentStrategy:
properties:
rollingUpdate:
properties:
maxSurge:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
maxUnavailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
type: object
type:
type: string
type: object
dnsConfig:
properties:
nameservers:
Expand Down Expand Up @@ -4333,6 +4351,24 @@ spec:
- name
type: object
type: array
deploymentStrategy:
properties:
rollingUpdate:
properties:
maxSurge:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
maxUnavailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
type: object
type:
type: string
type: object
dnsConfig:
properties:
nameservers:
Expand Down Expand Up @@ -13886,6 +13922,24 @@ spec:
- name
type: object
type: array
deploymentStrategy:
properties:
rollingUpdate:
properties:
maxSurge:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
maxUnavailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
type: object
type:
type: string
type: object
dnsConfig:
properties:
nameservers:
Expand Down
62 changes: 36 additions & 26 deletions docs/samples/client/kfserving_sdk_v1beta1_sample.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"metadata": {},
"outputs": [],
"source": [
"from kubernetes import client \n",
"from kubernetes import client\n",
terrytangyuan marked this conversation as resolved.
Show resolved Hide resolved
"from kfserving import KFServingClient\n",
"from kfserving import constants\n",
"from kfserving import utils\n",
Expand All @@ -45,8 +45,8 @@
"metadata": {},
"outputs": [],
"source": [
"#namespace = utils.get_default_target_namespace()\n",
"namespace = 'kfserving-test'"
"# namespace = utils.get_default_target_namespace()\n",
"namespace = \"kfserving-test\""
]
},
{
Expand All @@ -69,16 +69,21 @@
"metadata": {},
"outputs": [],
"source": [
"api_version = constants.KFSERVING_GROUP + '/' + kfserving_version\n",
"api_version = constants.KFSERVING_GROUP + \"/\" + kfserving_version\n",
"\n",
"isvc = V1beta1InferenceService(api_version=api_version,\n",
" kind=constants.KFSERVING_KIND,\n",
" metadata=client.V1ObjectMeta(\n",
" name='flower-sample', namespace=namespace),\n",
" spec=V1beta1InferenceServiceSpec(\n",
" predictor=V1beta1PredictorSpec(\n",
" tensorflow=(V1beta1TFServingSpec(\n",
" storage_uri='gs://kfserving-examples/models/tensorflow/flowers'))))\n",
"isvc = V1beta1InferenceService(\n",
" api_version=api_version,\n",
" kind=constants.KFSERVING_KIND,\n",
" metadata=client.V1ObjectMeta(name=\"flower-sample\", namespace=namespace),\n",
" spec=V1beta1InferenceServiceSpec(\n",
" predictor=V1beta1PredictorSpec(\n",
" tensorflow=(\n",
" V1beta1TFServingSpec(\n",
" storage_uri=\"gs://kfserving-examples/models/tensorflow/flowers\"\n",
" )\n",
" )\n",
" )\n",
" ),\n",
")"
]
},
Expand Down Expand Up @@ -152,7 +157,7 @@
}
],
"source": [
"KFServing.get('flower-sample', namespace=namespace, watch=True, timeout_seconds=120)"
"KFServing.get(\"flower-sample\", namespace=namespace, watch=True, timeout_seconds=120)"
]
},
{
Expand Down Expand Up @@ -223,18 +228,23 @@
}
],
"source": [
"isvc = V1beta1InferenceService(api_version=api_version,\n",
" kind=constants.KFSERVING_KIND,\n",
" metadata=client.V1ObjectMeta(\n",
" name='flower-sample', namespace=namespace),\n",
" spec=V1beta1InferenceServiceSpec(\n",
" predictor=V1beta1PredictorSpec(\n",
" canary_traffic_percent=20,\n",
" tensorflow=(V1beta1TFServingSpec(\n",
" storage_uri='gs://kfserving-examples/models/tensorflow/flowers-2'))))\n",
"isvc = V1beta1InferenceService(\n",
" api_version=api_version,\n",
" kind=constants.KFSERVING_KIND,\n",
" metadata=client.V1ObjectMeta(name=\"flower-sample\", namespace=namespace),\n",
" spec=V1beta1InferenceServiceSpec(\n",
" predictor=V1beta1PredictorSpec(\n",
" canary_traffic_percent=20,\n",
" tensorflow=(\n",
" V1beta1TFServingSpec(\n",
" storage_uri=\"gs://kfserving-examples/models/tensorflow/flowers-2\"\n",
" )\n",
" ),\n",
" )\n",
" ),\n",
")\n",
"\n",
"KFServing.patch('flower-sample', isvc, namespace=namespace)"
"KFServing.patch(\"flower-sample\", isvc, namespace=namespace)"
]
},
{
Expand All @@ -250,7 +260,7 @@
"metadata": {},
"outputs": [],
"source": [
"KFServing.wait_isvc_ready('flower-sample', namespace=namespace)"
"KFServing.wait_isvc_ready(\"flower-sample\", namespace=namespace)"
]
},
{
Expand All @@ -268,7 +278,7 @@
}
],
"source": [
"KFServing.get('flower-sample', namespace=namespace, watch=True)"
"KFServing.get(\"flower-sample\", namespace=namespace, watch=True)"
]
},
{
Expand Down Expand Up @@ -313,7 +323,7 @@
}
],
"source": [
"KFServing.delete('flower-sample', namespace=namespace)"
"KFServing.delete(\"flower-sample\", namespace=namespace)"
]
},
{
Expand Down