File size: 2,064 Bytes
1c4d61c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
71
72
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: custom-ksvc-ddpm
  namespace: kubeflow-admin-cpaas-io
spec:
  template:
    metadata:
      annotations:
        autoscaling.knative.dev/class: "kpa.autoscaling.knative.dev"
        autoscaling.knative.dev/target: "10"
        autoscaling.knative.dev/minScale: "1"
        autoscaling.knative.dev/maxScale: "5"
    spec:
      containerConcurrency: 1
      initContainers:
      - args:
        - git+lfs://gitee.com/lanzhiwang/ddpm?branch=master-gitee
        - /mnt/app
        image: 10.0.200.210:11443/mlops/storage-initializer:v0.8.0-acp-0914
        imagePullPolicy: IfNotPresent
        name: storage-initializer
        resources:
          limits:
            cpu: "1"
            memory: 2Gi
          requests:
            cpu: 100m
            memory: 100Mi
        volumeMounts:
        - mountPath: /mnt/app
          name: space-code-location
      containers:
      - env:
        - name: SPACE_DIR
          value: /mnt/app
        - name: APP_NAME
          value: ddpm
        - name: PIP_MIRROR
          value: https://pypi.tuna.tsinghua.edu.cn/simple
        - name: APP_FILE
          value: app.py
        - name: HF_HOME
          value: ~/.cache/gitee-ai
        - name: HF_ENDPOINT
          value: https://ai.gitee.com/huggingface
        image: 10.0.200.210/3rdparty/gradio-runtime:v3.5
        command:
        - bash
        - -c
        - /home/user/app/endpoint.sh
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 7860
        name: space-container
        resources:
          limits:
            cpu: "8"
            memory: 32Gi
            tencent.com/vcuda-core: "100"
            tencent.com/vcuda-memory: "64"
        volumeMounts:
        - mountPath: /root/.cache/huggingface/hub
          name: models-location
        - mountPath: /mnt/app
          name: space-code-location
      timeoutSeconds: 600
      volumes:
      - name: space-code-location
        emptyDir: {}
      - name: models-location
        emptyDir: {}