You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/components/serving/tfserving_new.md
+273-73
Original file line number
Diff line number
Diff line change
@@ -6,41 +6,217 @@ weight = 51
6
6
7
7
## Serving a model
8
8
9
-
_This section has not yet been converted to kustomize, please refer to [kubeflow/website/issues/958](https://github.com/kubeflow/website/issues/958)._
9
+
To deploy a model we create following resources as illustrated below
10
10
11
-
We treat each deployed model as two [components](https://ksonnet.io/docs/tutorial#2-generate-and-deploy-an-app-component)
12
-
in your APP: one tf-serving-deployment, and one tf-serving-service.
13
-
We can think of the service as a model, and the deployment as the version of the model.
11
+
- A deployment to deploy the model using TFServing
12
+
- A K8s service to create an endpoint a service
13
+
- An Istio virtual service to route traffic to the model and expose it through the Istio gateway
14
+
- An Istio DestinationRule is for doing traffic splitting.
14
15
15
-
Generate the service(model) component
16
-
17
-
```
18
-
ks generate tf-serving-service mnist-service
19
-
ks param set mnist-service modelName mnist // match your deployment mode name
20
-
ks param set mnist-service trafficRule v1:100 // optional, it's the default value
21
-
ks param set mnist-service serviceType LoadBalancer // optional, change type to LoadBalancer to expose external IP
First you need to create secret that will contain access credentials. Use base64 to encode your credentials and check details in the Kubernetes guide to [creating a secret manually](https://kubernetes.io/docs/concepts/configuration/secret/#creating-a-secret-manually)
233
+
To use S3, first you need to create secret that will contain access credentials. Use base64 to encode your credentials and check details in the Kubernetes guide to [creating a secret manually](https://kubernetes.io/docs/concepts/configuration/secret/#creating-a-secret-manually)
63
234
```
64
235
apiVersion: v1
65
236
metadata:
@@ -70,52 +241,81 @@ data:
70
241
kind: Secret
71
242
```
72
243
73
-
Enable S3, set url and point to correct Secret
74
-
75
-
```
76
-
MODEL_PATH=s3://kubeflow-models/inception
77
-
ks param set ${MODEL_COMPONENT} modelBasePath ${MODEL_PATH}
78
-
ks param set ${MODEL_COMPONENT} s3Enable true
79
-
ks param set ${MODEL_COMPONENT} s3SecretName secretname
80
-
```
81
-
82
-
Optionally you can also override default parameters of S3
83
-
84
-
```
85
-
# S3 region
86
-
ks param set ${MODEL_COMPONENT} s3AwsRegion us-west-1
87
-
88
-
# Whether or not to use https for S3 connections
89
-
ks param set ${MODEL_COMPONENT} s3UseHttps true
244
+
Then use the following manifest as an example:
90
245
91
-
# Whether or not to verify https certificates for S3 connections
92
-
ks param set ${MODEL_COMPONENT} s3VerifySsl true
246
+
```yaml
93
247
94
-
# URL for your s3-compatible endpoint.
95
-
ks param set ${MODEL_COMPONENT} s3Endpoint s3.us-west-1.amazonaws.com
96
-
```
97
-
98
-
### Using GPU
99
-
To serve a model with GPU, first make sure your Kubernetes cluster has a GPU node. Then set an additional param:
100
-
```
101
-
ks param set ${MODEL_COMPONENT} numGpus 1
102
-
```
103
-
There is an [example](https://github.com/kubeflow/examples/blob/master/object_detection/tf_serving_gpu.md)
0 commit comments