Просмотр исходного кода

Immich upstream breaking changes (#1907)

Stavros Kois 1 год назад
Родитель
Сommit
9c74d50fa4

+ 1 - 1
library/common/Chart.yaml

@@ -2,7 +2,7 @@ apiVersion: v2
 name: common
 description: A library chart for iX Official Catalog
 type: library
-version: 1.2.4
+version: 1.2.5
 appVersion: v1
 annotations:
   title: Common Library Chart

+ 7 - 2
library/common/templates/app_functions/_postgres.tpl

@@ -13,10 +13,12 @@ backupChownMode (optional): Whether to chown the backup directory or
 */}}
 {{- define "ix.v1.common.app.postgres" -}}
   {{- $name := .name | default "postgres" -}}
+  {{- $imageSelector := .imageSelector | default "postgresImage" -}}
   {{- $secretName := (required "Postgres - Secret Name is required" .secretName) -}}
   {{- $backupPath := .backupPath | default "/postgres_backup" -}}
   {{- $backupChownMode := .backupChownMode | default "check" -}}
   {{- $ixChartContext := .ixChartContext -}}
+  {{- $preUpgradeTasks := .preUpgradeTasks | default list -}}
   {{- $resources := (required "Postgres - Resources are required" .resources) }}
 
 {{ $name }}:
@@ -27,7 +29,7 @@ backupChownMode (optional): Whether to chown the backup directory or
       {{ $name }}:
         enabled: true
         primary: true
-        imageSelector: postgresImage
+        imageSelector: {{ $imageSelector }}
         securityContext:
           runAsUser: 999
           runAsGroup: 999
@@ -99,7 +101,7 @@ postgresbackup:
       postgresbackup:
         enabled: true
         primary: true
-        imageSelector: postgresImage
+        imageSelector: {{ $imageSelector }}
         securityContext:
           runAsUser: 999
           runAsGroup: 999
@@ -126,6 +128,9 @@ postgresbackup:
             echo "Creating backup of ${POSTGRES_DB} database"
             pg_dump --dbname=${POSTGRES_URL} --file {{ $backupPath }}/${POSTGRES_DB}_$(date +%Y-%m-%d_%H-%M-%S).sql || echo "Failed to create backup"
             echo "Backup finished"
+            {{- range $task := $preUpgradeTasks }}
+            {{ $task }}
+            {{- end }}
     initContainers:
     {{- include "ix.v1.common.app.permissions"
       (dict

+ 3 - 3
library/ix-dev/community/immich/Chart.lock

@@ -1,6 +1,6 @@
 dependencies:
 - name: common
   repository: file://../../../common
-  version: 1.2.4
-digest: sha256:47ebfd41bc2ac33ab6989e7bd4d1d3aea662365fffa8b525a24cc56a2a35c174
-generated: "2023-12-15T18:16:31.686869306+02:00"
+  version: 1.2.5
+digest: sha256:39d574b4c1141e20a63afd62dffdde37efe60a89e00e38111b35a53b34103bb1
+generated: "2023-12-18T15:33:51.655773088+02:00"

+ 3 - 3
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: 2.0.6
+version: 3.0.0
 apiVersion: v2
-appVersion: 1.90.2
+appVersion: 1.91.3
 kubeVersion: '>=1.16.0-0'
 maintainers:
   - name: truenas
@@ -15,7 +15,7 @@ maintainers:
 dependencies:
   - name: common
     repository: file://../../../common
-    version: 1.2.4
+    version: 1.2.5
 home: https://immich.app
 icon: https://media.sys.truenas.net/apps/immich/icons/icon.svg
 sources:

BIN
library/ix-dev/community/immich/charts/common-1.2.4.tgz


BIN
library/ix-dev/community/immich/charts/common-1.2.5.tgz


+ 0 - 1
library/ix-dev/community/immich/ci/no-extra-values.yaml

@@ -19,4 +19,3 @@ immichStorage:
 
 immichConfig:
   enableML: false
-  enableTypesense: false

+ 0 - 21
library/ix-dev/community/immich/ci/no-typesenes-values.yaml

@@ -1,21 +0,0 @@
-immichStorage:
-  uploads:
-    type: pvc
-  library:
-    type: pvc
-  thumbs:
-    type: pvc
-  profile:
-    type: pvc
-  video:
-    type: pvc
-  pgData:
-    type: pvc
-  pgBackup:
-    type: emptyDir
-    emptyDirConfig:
-      medium: ""
-      size: ""
-
-immichConfig:
-  enableTypesense: false

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

@@ -49,13 +49,6 @@ questions:
           schema:
             type: boolean
             default: true
-        - variable: enableTypesense
-          label: Enable Typesense
-          description: |
-            Enable Typesense
-          schema:
-            type: boolean
-            default: true
 
   - variable: immichNetwork
     label: ""

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

@@ -24,11 +24,6 @@
 
   {{- $dbURL := (printf "postgres://%s:%s@%s:5432/%s?sslmode=disable" $dbUser $dbPass $dbHost $dbName) -}}
 
-  {{- $typesenseKey := randAlphaNum 32 -}}
-  {{- with (lookup "v1" "Secret" .Release.Namespace (printf "%s-immich-creds" $fullname)) -}}
-    {{- $typesenseKey = ((index .data "TYPESENSE_API_KEY") | b64dec) -}}
-  {{- end -}}
-
   {{- $mlURL := printf "http://%v-machinelearning:%v" $fullname .Values.immichNetwork.machinelearningPort }}
 
 secret:
@@ -56,13 +51,6 @@ secret:
       {{- if .Values.immichConfig.enableML }}
       IMMICH_MACHINE_LEARNING_URL: {{ $mlURL | quote }}
       {{- end }}
-      TYPESENSE_ENABLED: {{ .Values.immichConfig.enableTypesense | quote }}
-      TYPESENSE_API_KEY: {{ $typesenseKey }}
-      {{- if .Values.immichConfig.enableTypesense }}
-      TYPESENSE_PROTOCOL: http
-      TYPESENSE_HOST: {{ printf "%v-typesense" $fullname }}
-      TYPESENSE_PORT: {{ .Values.immichNetwork.typesensePort | quote }}
-      {{- end }}
       DB_USERNAME: {{ $dbUser }}
       DB_PASSWORD: {{ $dbPass }}
       DB_HOSTNAME: {{ $dbHost }}
@@ -73,14 +61,6 @@ secret:
       REDIS_PORT: "6379"
       REDIS_DBINDEX: "0"
 
-  {{- if .Values.immichConfig.enableTypesense }}
-  typesense-creds:
-    enabled: true
-    data:
-      TYPESENSE_API_KEY: {{ $typesenseKey }}
-      TYPESENSE_DATA_DIR: /typesense-data
-  {{- end }}
-
 configmap:
   server-config:
     enabled: true

+ 1 - 5
library/ix-dev/community/immich/templates/_immich-server.tpl

@@ -1,6 +1,5 @@
 {{- define "immich.server.workload" -}}
-{{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}}
-{{- $typesenseUrl := printf "http://%v-typesense:%v/health" $fullname .Values.immichNetwork.typesensePort }}
+{{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) }}
 workload:
   server:
     enabled: true
@@ -48,7 +47,4 @@ workload:
                                                         "secretName" "postgres-creds") | nindent 8 }}
       {{- include "ix.v1.common.app.redisWait" (dict  "name" "redis-wait"
                                                       "secretName" "redis-creds") | nindent 8 }}
-      {{- if .Values.immichConfig.enableTypesense }}
-        {{- include "immich.wait.init" (dict "url" $typesenseUrl) | indent 8 }}
-      {{- end }}
 {{- end -}}

+ 0 - 42
library/ix-dev/community/immich/templates/_immich-typesense.tpl

@@ -1,42 +0,0 @@
-{{- define "immich.typesense.workload" -}}
-{{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}}
-{{- $url := printf "http://%v:%v/api/server-info/ping" $fullname .Values.immichNetwork.webuiPort }}
-workload:
-  typesense:
-    enabled: true
-    type: Deployment
-    podSpec:
-      hostNetwork: false
-      containers:
-        typesense:
-          enabled: true
-          primary: true
-          imageSelector: typesenseImage
-          args:
-            - --api-port
-            - {{ .Values.immichNetwork.typesensePort | quote }}
-          securityContext:
-            runAsUser: 0
-            runAsGroup: 0
-            runAsNonRoot: false
-            readOnlyRootFilesystem: false
-          envFrom:
-            - secretRef:
-                name: typesense-creds
-          probes:
-            liveness:
-              enabled: true
-              type: http
-              path: /health
-              port: {{ .Values.immichNetwork.typesensePort }}
-            readiness:
-              enabled: true
-              type: http
-              path: /health
-              port: {{ .Values.immichNetwork.typesensePort }}
-            startup:
-              enabled: true
-              type: http
-              path: /health
-              port: {{ .Values.immichNetwork.typesensePort }}
-{{- end -}}

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

@@ -71,15 +71,6 @@ persistence:
       microservices:
         microservices:
           mountPath: /microcache
-  {{- if .Values.immichConfig.enableTypesense }}
-  typsense:
-    enabled: true
-    type: emptyDir
-    targetSelector:
-      typesense:
-        typesense:
-          mountPath: /typesense-data
-  {{- end -}}
   {{- if .Values.immichConfig.enableML }}
   mlcache:
     enabled: true
@@ -104,7 +95,6 @@ persistence:
         redis:
           mountPath: /tmp
 
-
   {{/* Database */}}
   {{- include "ix.v1.common.app.postgresPersistence"
       (dict "pgData" .Values.immichStorage.pgData

+ 7 - 1
library/ix-dev/community/immich/templates/_postgres.tpl

@@ -1,7 +1,13 @@
 {{- define "postgres.workload" -}}
+{{- $psql := "PGPASSWORD=${POSTGRES_PASSWORD} psql --host=${POSTGRES_HOST} --dbname=${POSTGRES_DB} --username=${POSTGRES_USER}" -}}
+{{- $tasks := (list
+  (printf "%s -c \"ALTER DATABASE ${POSTGRES_DB} REFRESH COLLATION VERSION;\"" $psql)
+) }}
+
 workload:
 {{- include "ix.v1.common.app.postgres" (dict "secretName" "postgres-creds"
                                               "resources" .Values.resources
+                                              "imageSelector" "pgvectorImage"
+                                              "preUpgradeTasks" $tasks
                                               "ixChartContext" .Values.ixChartContext) | nindent 2 }}
-
 {{- end -}}

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

@@ -38,20 +38,6 @@ service:
         port: {{ .Values.immichNetwork.machinelearningPort }}
         protocol: http
         targetSelector: machinelearning
-  {{- end -}}
-
-  {{- if .Values.immichConfig.enableTypesense }}
-  typesense:
-    enabled: true
-    type: ClusterIP
-    targetSelector: typesense
-    ports:
-      typesense:
-        enabled: true
-        primary: true
-        port: {{ .Values.immichNetwork.typesensePort }}
-        protocol: http
-        targetSelector: typesense
   {{- end }}
 
   redis:

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

@@ -7,9 +7,6 @@
 {{- if .Values.immichConfig.enableML -}}
   {{- $_ := mustMergeOverwrite .Values (include "immich.machinelearning.workload" $ | fromYaml) -}}
 {{- end -}}
-{{- if .Values.immichConfig.enableTypesense -}}
-  {{- $_ := mustMergeOverwrite .Values (include "immich.typesense.workload" $ | fromYaml) -}}
-{{- end -}}
 {{- $_ := mustMergeOverwrite .Values (include "immich.persistence" $ | fromYaml) -}}
 {{- $_ := mustMergeOverwrite .Values (include "immich.service" $ | fromYaml) -}}
 {{- $_ := mustMergeOverwrite .Values (include "postgres.workload" $ | fromYaml) -}}

+ 1 - 1
library/ix-dev/community/immich/upgrade_info.json

@@ -1,4 +1,4 @@
 {
   "filename": "values.yaml",
-  "keys": ["image", "webImage", "proxyImage", "mlImage", "typesenseImage"]
+  "keys": ["image", "webImage", "proxyImage", "mlImage"]
 }

+ 4 - 4
library/ix-dev/community/immich/upgrade_strategy

@@ -8,13 +8,13 @@ from catalog_update.upgrade_strategy import semantic_versioning
 
 RE_STABLE_VERSION_BASE = r'\d+\.\d+\.\d+'
 ENUMS = {
-    'typesenseImage': {
-        'RE_STABLE_VERSION': re.compile(RE_STABLE_VERSION_BASE),
-        'STRIP_TEXT': ''
-    },
     'default': {
         'RE_STABLE_VERSION': re.compile(rf'v{RE_STABLE_VERSION_BASE}'),
         'STRIP_TEXT': 'v'
+    },
+    'pgvectorImage': {
+        'RE_STABLE_VERSION': re.compile(rf'pg15-v{RE_STABLE_VERSION_BASE}'),
+        'STRIP_TEXT': 'pg15-v'
     }
 }
 

+ 5 - 7
library/ix-dev/community/immich/values.yaml

@@ -1,17 +1,17 @@
 image:
   repository: altran1502/immich-server
   pullPolicy: IfNotPresent
-  tag: v1.90.2
+  tag: v1.91.3
 
 mlImage:
   repository: altran1502/immich-machine-learning
   pullPolicy: IfNotPresent
-  tag: v1.90.2
+  tag: v1.91.3
 
-typesenseImage:
-  repository: typesense/typesense
+pgvectorImage:
+  repository: tensorchord/pgvecto-rs
   pullPolicy: IfNotPresent
-  tag: 0.25.1
+  tag: pg15-v0.1.11
 
 resources:
   limits:
@@ -23,7 +23,6 @@ immichGPU: {}
 immichConfig:
   publicLoginMessage: ''
   enableML: true
-  enableTypesense: true
 
 immichNetwork:
   webuiPort: 30041
@@ -32,7 +31,6 @@ immichNetwork:
   # in the future.
   machinelearningPort: 32002
   microservicesPort: 32003
-  typesensePort: 32004
 
 immichStorage:
   uploads: