Skip to content

Commit

Permalink
Immich upstream breaking changes (#1907)
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros-k authored Dec 19, 2023
1 parent 8af9942 commit 9c74d50
Show file tree
Hide file tree
Showing 19 changed files with 32 additions and 145 deletions.
2 changes: 1 addition & 1 deletion library/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions library/common/templates/app_functions/_postgres.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}:
Expand All @@ -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
Expand Down Expand Up @@ -99,7 +101,7 @@ postgresbackup:
postgresbackup:
enabled: true
primary: true
imageSelector: postgresImage
imageSelector: {{ $imageSelector }}
securityContext:
runAsUser: 999
runAsGroup: 999
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions library/ix-dev/community/immich/Chart.lock
Original file line number Diff line number Diff line change
@@ -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"
6 changes: 3 additions & 3 deletions library/ix-dev/community/immich/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion library/ix-dev/community/immich/ci/no-extra-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ immichStorage:

immichConfig:
enableML: false
enableTypesense: false
21 changes: 0 additions & 21 deletions library/ix-dev/community/immich/ci/no-typesenes-values.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions library/ix-dev/community/immich/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down
20 changes: 0 additions & 20 deletions library/ix-dev/community/immich/templates/_configuration.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
Expand All @@ -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
Expand Down
6 changes: 1 addition & 5 deletions library/ix-dev/community/immich/templates/_immich-server.tpl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 -}}
42 changes: 0 additions & 42 deletions library/ix-dev/community/immich/templates/_immich-typesense.tpl

This file was deleted.

10 changes: 0 additions & 10 deletions library/ix-dev/community/immich/templates/_persistence.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -104,7 +95,6 @@ persistence:
redis:
mountPath: /tmp


{{/* Database */}}
{{- include "ix.v1.common.app.postgresPersistence"
(dict "pgData" .Values.immichStorage.pgData
Expand Down
8 changes: 7 additions & 1 deletion library/ix-dev/community/immich/templates/_postgres.tpl
Original file line number Diff line number Diff line change
@@ -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 -}}
14 changes: 0 additions & 14 deletions library/ix-dev/community/immich/templates/_service.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 0 additions & 3 deletions library/ix-dev/community/immich/templates/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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) -}}
Expand Down
2 changes: 1 addition & 1 deletion library/ix-dev/community/immich/upgrade_info.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"filename": "values.yaml",
"keys": ["image", "webImage", "proxyImage", "mlImage", "typesenseImage"]
"keys": ["image", "webImage", "proxyImage", "mlImage"]
}
8 changes: 4 additions & 4 deletions library/ix-dev/community/immich/upgrade_strategy
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand Down
12 changes: 5 additions & 7 deletions library/ix-dev/community/immich/values.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -23,7 +23,6 @@ immichGPU: {}
immichConfig:
publicLoginMessage: ''
enableML: true
enableTypesense: true

immichNetwork:
webuiPort: 30041
Expand All @@ -32,7 +31,6 @@ immichNetwork:
# in the future.
machinelearningPort: 32002
microservicesPort: 32003
typesensePort: 32004

immichStorage:
uploads:
Expand Down

0 comments on commit 9c74d50

Please sign in to comment.