Browse Source

immich: remove microservices (#2560)

* immich: remove microservices

* let upgrades succeed

* let default entrypoint take place

* skip upgrade tests, as it users new values with old templates and this wont fly
Stavros Kois 1 năm trước cách đây
mục cha
commit
362e758949

+ 2 - 2
library/ix-dev/community/immich/Chart.yaml

@@ -4,9 +4,9 @@ description: Immich is a self-hosted photo and video backup solution directly fr
 annotations:
   title: Immich
 type: application
-version: 3.0.25
+version: 4.0.0
 apiVersion: v2
-appVersion: 1.105.1
+appVersion: 1.106.1
 kubeVersion: '>=1.16.0-0'
 maintainers:
   - name: truenas

+ 1 - 21
library/ix-dev/community/immich/questions.yaml

@@ -80,7 +80,7 @@ questions:
             The Hugging Face endpoint to use for Machine Learning.
           schema:
             type: string
-            default: "" 
+            default: ""
   - variable: immichNetwork
     label: ""
     group: Network Configuration
@@ -861,23 +861,3 @@ 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

+ 5 - 20
library/ix-dev/community/immich/templates/_configuration.tpl

@@ -23,7 +23,6 @@
   {{- end -}}
 
   {{- $dbURL := (printf "postgres://%s:%s@%s:5432/%s?sslmode=disable" $dbUser $dbPass $dbHost $dbName) -}}
-
   {{- $mlURL := printf "http://%v-machinelearning:%v" $fullname .Values.immichNetwork.machinelearningPort }}
 
 secret:
@@ -43,7 +42,7 @@ secret:
       REDIS_PASSWORD: {{ $redisPass }}
       REDIS_HOST: {{ $redisHost }}
 
-  {{/* Server & Microservices */}}
+  {{/* Server */}}
   immich-creds:
     enabled: true
     data:
@@ -65,28 +64,20 @@ configmap:
   server-config:
     enabled: true
     data:
-      LOG_LEVEL: {{ .Values.immichConfig.logLevel | default "log" }}
+      IMMICH_LOG_LEVEL: {{ .Values.immichConfig.logLevel | default "log" }}
       NODE_ENV: production
-      SERVER_PORT: {{ .Values.immichNetwork.webuiPort | quote }}
-
-  micro-config:
-    enabled: true
-    data:
-      LOG_LEVEL: {{ .Values.immichConfig.logLevel | default "log" }}
-      NODE_ENV: production
-      MICROSERVICES_PORT: {{ .Values.immichNetwork.microservicesPort | quote }}
-      REVERSE_GEOCODING_DUMP_DIRECTORY: /microcache
+      IMMICH_PORT: {{ .Values.immichNetwork.webuiPort | quote }}
 
   {{- if .Values.immichConfig.enableML }}
   ml-config:
     enabled: true
     data:
       NODE_ENV: production
-      LOG_LEVEL: {{ .Values.immichConfig.logLevel | default "log" }}
+      IMMICH_LOG_LEVEL: {{ .Values.immichConfig.logLevel | default "log" }}
       {{- if .Values.immichConfig.huggingFaceEndpoint }}
       HF_ENDPOINT: {{ .Values.immichConfig.huggingFaceEndpoint }}
       {{- end }}
-      MACHINE_LEARNING_PORT: {{ .Values.immichNetwork.machinelearningPort | quote }}
+      IMMICH_PORT: {{ .Values.immichNetwork.machinelearningPort | quote }}
       MACHINE_LEARNING_CACHE_FOLDER: /mlcache
       TRANSFORMERS_CACHE: /mlcache
   {{- end }}
@@ -97,14 +88,8 @@ scaleGPU:
   - gpu:
       {{ $key }}: {{ $value }}
     targetSelector:
-      {{- if $.Values.immichGPUContainers.microservices }}
-      microservices:
-        - microservices
-      {{- end }}
-      {{- if $.Values.immichGPUContainers.machinelearning }}
       machinelearning:
         - machinelearning
-      {{- end }}
   {{- end -}}
 {{- end -}}
 {{- end -}}

+ 0 - 48
library/ix-dev/community/immich/templates/_immich-microservices.tpl

@@ -1,48 +0,0 @@
-{{- define "immich.microservices.workload" -}}
-{{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}}
-{{- $url := printf "http://%v:%v/api/server-info/ping" $fullname .Values.immichNetwork.webuiPort }}
-workload:
-  microservices:
-    enabled: true
-    type: Deployment
-    podSpec:
-      hostNetwork: false
-      containers:
-        microservices:
-          enabled: true
-          primary: true
-          imageSelector: image
-          securityContext:
-            runAsUser: 0
-            runAsGroup: 0
-            runAsNonRoot: false
-            readOnlyRootFilesystem: false
-          command: /bin/sh
-          args:
-            - -c
-            - /usr/src/app/start-microservices.sh
-          envFrom:
-            - secretRef:
-                name: immich-creds
-            - configMapRef:
-                name: micro-config
-          probes:
-            liveness:
-              enabled: true
-              type: tcp
-              port: {{ .Values.immichNetwork.microservicesPort }}
-            readiness:
-              enabled: true
-              type: tcp
-              port: {{ .Values.immichNetwork.microservicesPort }}
-            startup:
-              enabled: true
-              type: tcp
-              port: {{ .Values.immichNetwork.microservicesPort }}
-      initContainers:
-      {{- include "ix.v1.common.app.postgresWait" (dict "name" "postgres-wait"
-                                                        "secretName" "postgres-creds") | nindent 8 }}
-      {{- include "ix.v1.common.app.redisWait" (dict  "name" "redis-wait"
-                                                      "secretName" "redis-creds") | nindent 8 }}
-      {{- include "immich.wait.init" (dict "url" $url) | indent 8 }}
-{{- end -}}

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

@@ -17,10 +17,6 @@ workload:
             runAsGroup: 0
             runAsNonRoot: false
             readOnlyRootFilesystem: false
-          command: /bin/sh
-          args:
-            - -c
-            - /usr/src/app/start-server.sh
           envFrom:
             - secretRef:
                 name: immich-creds

+ 0 - 26
library/ix-dev/community/immich/templates/_persistence.tpl

@@ -8,9 +8,6 @@ persistence:
       server:
         server:
           mountPath: /usr/src/app/upload/library
-      microservices:
-        microservices:
-          mountPath: /usr/src/app/upload/library
   uploads:
     enabled: true
     {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.immichStorage.uploads) | nindent 4 }}
@@ -18,9 +15,6 @@ persistence:
       server:
         server:
           mountPath: /usr/src/app/upload/upload
-      microservices:
-        microservices:
-          mountPath: /usr/src/app/upload/upload
   thumbs:
     enabled: true
     {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.immichStorage.thumbs) | nindent 4 }}
@@ -28,9 +22,6 @@ persistence:
       server:
         server:
           mountPath: /usr/src/app/upload/thumbs
-      microservices:
-        microservices:
-          mountPath: /usr/src/app/upload/thumbs
   profile:
     enabled: true
     {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.immichStorage.profile) | nindent 4 }}
@@ -38,9 +29,6 @@ persistence:
       server:
         server:
           mountPath: /usr/src/app/upload/profile
-      microservices:
-        microservices:
-          mountPath: /usr/src/app/upload/profile
   video:
     enabled: true
     {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.immichStorage.video) | nindent 4 }}
@@ -48,9 +36,6 @@ persistence:
       server:
         server:
           mountPath: /usr/src/app/upload/encoded-video
-      microservices:
-        microservices:
-          mountPath: /usr/src/app/upload/encoded-video
   {{- range $idx, $storage := .Values.immichStorage.additionalStorages }}
   {{ printf "immich-%v:" (int $idx) }}
     enabled: true
@@ -59,18 +44,7 @@ persistence:
       server:
         server:
           mountPath: {{ $storage.mountPath }}
-      microservices:
-        microservices:
-          mountPath: {{ $storage.mountPath }}
   {{- end }}
-  {{/* Caches */}}
-  microcache:
-    enabled: true
-    type: emptyDir
-    targetSelector:
-      microservices:
-        microservices:
-          mountPath: /microcache
   {{- if .Values.immichConfig.enableML }}
   mlcache:
     enabled: true

+ 0 - 12
library/ix-dev/community/immich/templates/_service.tpl

@@ -14,18 +14,6 @@ service:
         protocol: http
         targetSelector: server
 
-  microservices:
-    enabled: true
-    type: ClusterIP
-    targetSelector: microservices
-    ports:
-      microservices:
-        enabled: true
-        primary: true
-        port: {{ .Values.immichNetwork.microservicesPort }}
-        protocol: http
-        targetSelector: microservices
-
   {{- if .Values.immichConfig.enableML }}
   machinelearning:
     enabled: true

+ 0 - 1
library/ix-dev/community/immich/templates/common.yaml

@@ -3,7 +3,6 @@
 {{/* Merge the templates with Values */}}
 {{- $_ := mustMergeOverwrite .Values (include "immich.configuration" $ | fromYaml) -}}
 {{- $_ := mustMergeOverwrite .Values (include "immich.server.workload" $ | fromYaml) -}}
-{{- $_ := mustMergeOverwrite .Values (include "immich.microservices.workload" $ | fromYaml) -}}
 {{- if .Values.immichConfig.enableML -}}
   {{- $_ := mustMergeOverwrite .Values (include "immich.machinelearning.workload" $ | fromYaml) -}}
 {{- end -}}

+ 4 - 8
library/ix-dev/community/immich/values.yaml

@@ -1,22 +1,22 @@
 image:
   repository: altran1502/immich-server
   pullPolicy: IfNotPresent
-  tag: v1.105.1
+  tag: v1.106.1
 
 mlImage:
   repository: altran1502/immich-machine-learning
   pullPolicy: IfNotPresent
-  tag: v1.105.1
+  tag: v1.106.1
 
 mlCudaImage:
   repository: altran1502/immich-machine-learning
   pullPolicy: IfNotPresent
-  tag: v1.105.1-cuda
+  tag: v1.106.1-cuda
 
 mlOpenvinoImage:
   repository: altran1502/immich-machine-learning
   pullPolicy: IfNotPresent
-  tag: v1.105.1-openvino
+  tag: v1.106.1-openvino
 
 pgvectorImage:
   repository: tensorchord/pgvecto-rs
@@ -29,9 +29,6 @@ resources:
     memory: 8Gi
 
 immichGPU: {}
-immichGPUContainers:
-  microservices: true
-  machinelearning: true
 
 immichConfig:
   publicLoginMessage: ""
@@ -46,7 +43,6 @@ immichNetwork:
   # Putting it here in case it needs to be configurable
   # in the future.
   machinelearningPort: 32002
-  microservicesPort: 32003
 
 immichStorage:
   uploads: