forked from occlum/occlum
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathocclum_tf_demo.yaml
70 lines (70 loc) · 1.56 KB
/
occlum_tf_demo.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
apiVersion: apps/v1
kind: Deployment
metadata:
name: tf-demo-deployment
spec:
selector:
matchLabels:
app: tf-demo
replicas: 1
template:
metadata:
labels:
app: tf-demo
spec:
containers:
- name: tf-demo-1
image: <registry>/tf_demo:<tag>
# imagePullPolicy: Always
imagePullPolicy: IfNotPresent
env:
- name: PCCS_URL
value: https://sgx-dcap-server.cn-shanghai.aliyuncs.com/sgx/certification/v3/
- name: GRPC_SERVER
value: init-ra-server-svc:5000
args:
- taskset
- -c
- 2,3,4,5
- occlum
- run
- /bin/tensorflow_model_server
- --model_name=resnet
- --model_base_path=/models/resnet
- --port=9001
- --ssl_config_file=/etc/tf_ssl.cfg
ports:
- name: grpc
containerPort: 9001
volumeMounts:
- name: sgx-enclave
mountPath: /dev/sgx/enclave
- name: sgx-provision
mountPath: /dev/sgx/provision
securityContext:
privileged: true
resources:
limits:
sgx.intel.com/epc: "8000Mi"
cpu: "1000m"
volumes:
- name: sgx-enclave
hostPath:
path: /dev/sgx_enclave
- name: sgx-provision
hostPath:
path: /dev/sgx_provision
---
apiVersion: v1
kind: Service
metadata:
name: tf-demo-svc
spec:
type: NodePort
ports:
- name: grpc
port: 9001
targetPort: 9001
nodePort: 31001
selector:
app: tf-demo