Skip to content

Commit

Permalink
Merge pull request #354 from terrytangyuan/odh-cp-deployment-strategy
Browse files Browse the repository at this point in the history
[RHOAIENG-3375][Cherry-pick] feat: Support customizable deployment strategy for RawDeployment mode. Fixes kserve#3452 (kserve#3603)
  • Loading branch information
openshift-merge-bot[bot] committed May 9, 2024
2 parents 2518cca + 51c8bb5 commit f7233ba
Show file tree
Hide file tree
Showing 31 changed files with 1,126 additions and 2,198 deletions.
54 changes: 54 additions & 0 deletions config/crd/serving.kserve.io_inferenceservices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2319,6 +2319,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 @@ -4964,6 +4982,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 @@ -14517,6 +14553,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",
"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

0 comments on commit f7233ba

Please sign in to comment.