Skip to content

Commit 5cc2e18

Browse files
author
tylertitsworth
committed
val progress
Signed-off-by: tylertitsworth <tyler.titsworth@intel.com>
1 parent b0e5a5c commit 5cc2e18

File tree

9 files changed

+60
-133
lines changed

9 files changed

+60
-133
lines changed

workflows/charts/tensorflow-serving/README.md

+4-11
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,16 @@ TensorFlow Serving is a flexible, high-performance serving system for machine le
1717
| deploy.env | object | `{"configMapName":"intel-proxy-config","enabled":true}` | Add Environment mapping |
1818
| deploy.image | string | `"intel/intel-extension-for-tensorflow:serving-gpu"` | Intel Extension for Tensorflow Serving image |
1919
| deploy.modelName | string | `""` | Model Name |
20-
| deploy.modelPath | string | `"/serving"` | Path to Model Folder |
2120
| deploy.replicas | int | `1` | Number of pods |
2221
| deploy.resources.limits | object | `{"cpu":"4000m","gpu.intel.com/i915":1,"memory":"1Gi"}` | Maximum resources per pod |
2322
| deploy.resources.limits."gpu.intel.com/i915" | int | `1` | Intel GPU Device Configuration |
2423
| deploy.resources.requests | object | `{"cpu":"1000m","memory":"512Mi"}` | Minimum resources per pod |
25-
| deploy.storage.nfs | object | `{"enabled":false,"path":"nil","readOnly":true,"server":"nil","subPath":"nil"}` | Network File System (NFS) storage for models |
24+
| deploy.storage.nfs | object | `{"enabled":false,"path":"nil","readOnly":true,"server":"nil"}` | Network File System (NFS) storage for models |
2625
| fullnameOverride | string | `""` | Full qualified Domain Name |
27-
| ingress.annotations | object | `{}` | |
28-
| ingress.className | string | `""` | |
29-
| ingress.enabled | bool | `false` | |
30-
| ingress.hosts[0].host | string | `"chart-example.local"` | |
31-
| ingress.hosts[0].paths[0].path | string | `"/"` | |
32-
| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | |
33-
| ingress.tls | list | `[]` | |
3426
| nameOverride | string | `""` | Name of the serving service |
35-
| pvc.size | string | `"1Gi"` | Size of the storage |
36-
| service.port | int | `9090` | Port of the service |
27+
| pvc.size | string | `"5Gi"` | Size of the storage |
28+
| service.grpcPort | int | `8500` | |
29+
| service.restPort | int | `8501` | Port of the service |
3730
| service.type | string | `"NodePort"` | Type of service |
3831

3932
----------------------------------------------
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
1. Get the application URL by running these commands:
2-
{{- if .Values.ingress.enabled }}
3-
{{- range $host := .Values.ingress.hosts }}
4-
{{- range .paths }}
5-
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
6-
{{- end }}
7-
{{- end }}
8-
{{- else if contains "NodePort" .Values.service.type }}
2+
{{- if contains "NodePort" .Values.service.type }}
93
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "tensorflow-serving.fullname" . }})
104
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
115
echo http://$NODE_IP:$NODE_PORT
@@ -20,3 +14,6 @@
2014
echo "Visit http://127.0.0.1:8080 to use your application"
2115
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
2216
{{- end }}
17+
2. Make a prediction
18+
curl http://$NODE_IP:$NODE_PORT/v1/models/{{ .Values.deploy.modelName }}
19+
curl -X POST http://$NODE_IP:$NODE_PORT/v1/models/{{ .Values.deploy.modelName }}:predict -d '{"data": []}'

workflows/charts/tensorflow-serving/templates/deployment.yaml

+8-11
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
14+
{{- $name := .Values.deploy.modelName | required ".Values.deploy.modelName is required." -}}
15+
---
1516
apiVersion: apps/v1
1617
kind: Deployment
1718
metadata:
1819
name: {{ include "tensorflow-serving.fullname" . }}
1920
labels:
2021
{{- include "tensorflow-serving.labels" . | nindent 4 }}
2122
spec:
22-
{{- if not .Values.autoscaling.enabled }}
2323
replicas: {{ .Values.deploy.replicas }}
24-
{{- end }}
2524
selector:
2625
matchLabels:
2726
{{- include "tensorflow-serving.selectorLabels" . | nindent 6 }}
@@ -44,21 +43,20 @@ spec:
4443
env:
4544
- name: MODEL_NAME
4645
value: {{ .Values.deploy.modelName }}
47-
- name: MODEL_DIR
48-
value: {{ .Values.deploy.modelPath }}
4946
ports:
50-
- name: serving
51-
containerPort: {{ .Values.service.port }}
47+
- name: rest
48+
containerPort: {{ .Values.service.restPort }}
49+
- name: grpc
50+
containerPort: {{ .Values.service.grpcPort }}
5251
volumeMounts:
5352
- mountPath: /dev/shm
5453
name: dshm
5554
{{- if .Values.deploy.storage.nfs.enabled }}
5655
- name: model
57-
mountPath: /home/model-server/model-store
58-
subPath: {{ .Values.deploy.storage.nfs.subPath }}
56+
mountPath: /models/{{ .Values.deploy.modelName }}
5957
{{- else }}
6058
- name: model
61-
mountPath: /home/model-server/model-store
59+
mountPath: /models/{{ .Values.deploy.modelName }}
6260
{{- end }}
6361
resources:
6462
{{- toYaml .Values.deploy.resources | nindent 12 }}
@@ -72,7 +70,6 @@ spec:
7270
server: {{ .Values.deploy.storage.nfs.server }}
7371
path: {{ .Values.deploy.storage.nfs.path }}
7472
readOnly: {{ .Values.deploy.storage.nfs.readOnly }}
75-
emptyDir: {}
7673
{{- else }}
7774
- name: model
7875
persistentVolumeClaim:

workflows/charts/tensorflow-serving/templates/ingress.yaml

-75
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) 2024 Intel Corporation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
---
16+
{{- if not .Values.deploy.storage.nfs.enabled }}
17+
apiVersion: v1
18+
kind: PersistentVolumeClaim
19+
metadata:
20+
name: {{ include "tensorflow-serving.fullname" . }}-model-dir
21+
labels:
22+
{{- include "tensorflow-serving.labels" . | nindent 4 }}
23+
spec:
24+
accessModes:
25+
- ReadWriteMany
26+
resources:
27+
requests:
28+
storage: {{ .Values.pvc.size }}
29+
{{- end }}

workflows/charts/tensorflow-serving/templates/service.yaml

+6-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ metadata:
2121
spec:
2222
type: {{ .Values.service.type }}
2323
ports:
24-
- name: serving
25-
port: {{ .Values.service.port }}
26-
targetPort: serving
24+
- name: rest
25+
port: {{ .Values.service.restPort }}
26+
targetPort: rest
27+
- name: grpc
28+
port: {{ .Values.service.grpcPort }}
29+
targetPort: grpc
2730
selector:
2831
{{- include "tensorflow-serving.selectorLabels" . | nindent 4 }}

workflows/charts/tensorflow-serving/templates/tests/test-connection.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ metadata:
2222
"helm.sh/hook": test
2323
spec:
2424
containers:
25-
- name: wget
26-
image: busybox
27-
command: ['wget']
28-
args: ['{{ include "tensorflow-serving.fullname" . }}:{{ .Values.service.port }}']
29-
restartPolicy: Never
25+
- name: info
26+
image: curlimages/curl
27+
command: ['sh', '-c']
28+
args: ['curl -f {{ include "tensorflow-serving.fullname" . }}:{{ .Values.service.restPort }}/v1/model/{{ .Values.deploy.modelName}}']
29+
restartPolicy: OnFailure

workflows/charts/tensorflow-serving/values.yaml

+3-20
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ deploy:
2525
enabled: true
2626
# -- Model Name
2727
modelName: ""
28-
# -- Path to Model Folder
29-
modelPath: /serving
3028
# -- Number of pods
3129
replicas: 1
3230
resources:
@@ -47,27 +45,12 @@ deploy:
4745
server: nil
4846
path: nil
4947
readOnly: true
50-
subPath: nil
5148
service:
5249
# -- Type of service
5350
type: NodePort
5451
# -- Port of the service
55-
port: 9090
52+
restPort: 8501
53+
grpcPort: 8500
5654
pvc:
5755
# -- Size of the storage
58-
size: 1Gi
59-
ingress:
60-
enabled: false
61-
className: ""
62-
annotations: {}
63-
# kubernetes.io/ingress.class: nginx
64-
# kubernetes.io/tls-acme: "true"
65-
hosts:
66-
- host: chart-example.local
67-
paths:
68-
- path: /
69-
pathType: ImplementationSpecific
70-
tls: []
71-
# - secretName: chart-example-tls
72-
# hosts:
73-
# - chart-example.local
56+
size: 5Gi

workflows/charts/tgi/templates/tests/test-connection.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ spec:
2525
- name: info
2626
image: curlimages/curl
2727
command: ['sh', '-c']
28-
args: ['curl --noproxy "*" -f {{ include "tgi.fullname" . }}:{{ .Values.service.port }}/info']
28+
args: ['curl -f {{ include "tgi.fullname" . }}:{{ .Values.service.port }}/info']
2929
restartPolicy: OnFailure

0 commit comments

Comments
 (0)