zero-shot-classification-zh/manifest.yaml
2024-11-06 02:03:15 +08:00

95 lines
2.2 KiB
YAML

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: text-classification-pvc
namespace: ecosystem
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: text-classification
namespace: ecosystem
spec:
selector:
matchLabels:
app: text-classification
tier: backend
template:
metadata:
labels:
app: text-classification
tier: backend
spec:
runtimeClassName: "nvidia"
volumes:
- name: text-classification-models
persistentVolumeClaim:
claimName: text-classification-pvc
containers:
- name: text-classification
image: leafdev.top/ecosystem/zero-shot-classification:v0.0.4
env:
- name: HF_DATASETS_CACHE
value: "/app/models"
- name: HF_HOME
value: "/app/models"
- name: HUGGINGFACE_HUB_CACHE
value: "/app/models"
- name: TRANSFORMERS_CACHE
value: "/app/models"
- name: HF_ENDPOINT
value: "https://hf-mirror.com"
- name: GPU_DEVICE
value: "-1"
# - name: CUDA_VISIBLE_DEVICES
# value: "1"
ports:
- containerPort: 80
protocol: TCP
name: http
resources:
limits:
nvidia.com/gpu: "1"
nvidia.com/gpumem: "1000"
volumeMounts:
- mountPath: /app/models
name: text-classification-models
---
apiVersion: v1
kind: Service
metadata:
name: text-classification
namespace: ecosystem
spec:
selector:
app: text-classification
tier: backend
type: ClusterIP
ports:
- port: 80
targetPort: 80
protocol: TCP
name: http
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: zero-shot-classification-http
namespace: ecosystem
spec:
hostnames:
- text-classification-api-testing.leaflow.cn
parentRefs:
- name: http-gw
namespace: networking
rules:
- backendRefs:
- name: text-classification
port: 80