Sfoglia il codice sorgente

immich: allow more granular control for gpu's (#2347)

Stavros Kois 1 anno fa
parent
commit
0a60a608e9

+ 20 - 0
library/ix-dev/community/immich/questions.yaml

@@ -836,3 +836,23 @@ questions:
       $ref:
         - "definitions/gpuConfiguration"
       attrs: []
+  - variable: immichGPUContainers
+    group: Resources Configuration
+    label: GPU Containers
+    description: Select which containers should use GPU.
+    schema:
+      type: dict
+      # This will only hide it if there are no GPUs available
+      # but will still show if there are 0 GPUs selected.
+      show_if: [["immichGPU", "!=", {}]]
+      attrs:
+        - variable: microservices
+          label: Enable GPU for Microservices
+          schema:
+            type: boolean
+            default: true
+        - variable: machinelearning
+          label: Enable GPU for Machine Learning
+          schema:
+            type: boolean
+            default: true

+ 4 - 0
library/ix-dev/community/immich/templates/_configuration.tpl

@@ -93,10 +93,14 @@ scaleGPU:
   - gpu:
       {{ $key }}: {{ $value }}
     targetSelector:
+      {{- if $.Values.immichGPUContainers.microservices }}
       microservices:
         - microservices
+      {{- end }}
+      {{- if $.Values.immichGPUContainers.machinelearning }}
       machinelearning:
         - machinelearning
+      {{- end }}
   {{- end -}}
 {{- end -}}
 {{- end -}}

+ 3 - 0
library/ix-dev/community/immich/values.yaml

@@ -29,6 +29,9 @@ resources:
     memory: 8Gi
 
 immichGPU: {}
+immichGPUContainers:
+  microservices: true
+  machinelearning: true
 
 immichConfig:
   publicLoginMessage: ''