From 54bc97d740c3612c00b53767b382b4b07ef383fa Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Tue, 21 Nov 2023 12:39:48 +0200 Subject: [PATCH] feat(immich): adapt to upstream changes (#15203) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** ⚒️ Fixes #10202 ⚒️ Fixes #14324 external library mount is removed, now "additional storage" is mounted on both microservices and server **⚙️ Type of change** - [x] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [x] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [x] ⚖️ My code follows the style guidelines of this project - [x] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [x] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> --- .github/renovate.json5 | 4 +- charts/stable/immich/Chart.yaml | 4 +- charts/stable/immich/questions.yaml | 8 --- charts/stable/immich/templates/_config.tpl | 22 ++----- .../immich/templates/_machinelearning.tpl | 2 +- .../immich/templates/_microservices.tpl | 13 +++-- charts/stable/immich/templates/_proxy.tpl | 45 --------------- charts/stable/immich/templates/_server.tpl | 17 +++--- charts/stable/immich/templates/_wait.tpl | 2 +- charts/stable/immich/templates/_web.tpl | 42 -------------- charts/stable/immich/templates/common.yaml | 18 ++++-- charts/stable/immich/values.yaml | 57 ++++--------------- 12 files changed, 52 insertions(+), 182 deletions(-) delete mode 100644 charts/stable/immich/templates/_proxy.tpl delete mode 100644 charts/stable/immich/templates/_web.tpl diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 9200ebb195c..ca575e5fe5b 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -304,7 +304,7 @@ }, { "matchDatasources": ["docker"], - "matchPackagePrefixes": ["tccr.io/truecharts/immich"], + "matchPackagePrefixes": ["altran1502/immich"], "groupName": "immich", }, { @@ -369,7 +369,7 @@ }, { "matchDatasources": ["docker"], - "matchPackagePrefixes": ["tccr.io/truecharts/authentik"], + "matchPackagePrefixes": ["ghcr.io/goauthentik/"], "groupName": "authentik", }, { diff --git a/charts/stable/immich/Chart.yaml b/charts/stable/immich/Chart.yaml index 6687a5f26cf..eefe3bbd4a2 100644 --- a/charts/stable/immich/Chart.yaml +++ b/charts/stable/immich/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: "1.86.0" +appVersion: "1.88.1" dependencies: - name: common repository: https://library-charts.truecharts.org @@ -22,7 +22,7 @@ name: immich sources: - https://github.com/truecharts/charts/tree/master/charts/stable/immich - https://github.com/immich-app/immich -version: 8.1.39 +version: 9.0.0 annotations: truecharts.org/category: media truecharts.org/SCALE-support: "true" diff --git a/charts/stable/immich/questions.yaml b/charts/stable/immich/questions.yaml index b46667aac1b..f8ce7153902 100644 --- a/charts/stable/immich/questions.yaml +++ b/charts/stable/immich/questions.yaml @@ -124,14 +124,6 @@ questions: additional_attrs: true type: dict attrs: -# Include{persistenceBasic} - - variable: externallibrary - label: App External Library Storage - description: Stores the External Library. - schema: - additional_attrs: true - type: dict - attrs: # Include{persistenceBasic} # Include{persistenceList} # Include{ingressRoot} diff --git a/charts/stable/immich/templates/_config.tpl b/charts/stable/immich/templates/_config.tpl index 22d9c058bee..0f8b1ef9ef0 100644 --- a/charts/stable/immich/templates/_config.tpl +++ b/charts/stable/immich/templates/_config.tpl @@ -7,21 +7,13 @@ {{- end }} configmap: - web-config: - enabled: true - data: - PORT: {{ .Values.service.web.ports.web.port | quote }} - NODE_ENV: production - IMMICH_SERVER_URL: {{ printf "http://%v-server:%v" $fname .Values.service.server.ports.server.port }} - PUBLIC_IMMICH_SERVER_URL: {{ printf "http://%v-server:%v" $fname .Values.service.server.ports.server.port }} - {{- with .Values.immich.public_login_page_message }} - PUBLIC_LOGIN_PAGE_MESSAGE: {{ . }} - {{- end }} - server-config: enabled: true data: - SERVER_PORT: {{ .Values.service.server.ports.server.port | quote }} + SERVER_PORT: {{ .Values.service.main.ports.main.port | quote }} + {{- with .Values.immich.public_login_page_message }} + PUBLIC_LOGIN_PAGE_MESSAGE: {{ . }} + {{- end }} micro-config: enabled: true @@ -56,12 +48,6 @@ configmap: TYPESENSE_PORT: {{ .Values.service.typesense.ports.typesense.port | quote }} {{- end }} - proxy-config: - enabled: true - data: - IMMICH_WEB_URL: {{ printf "http://%v-web:%v" $fname .Values.service.web.ports.web.port }} - IMMICH_SERVER_URL: {{ printf "http://%v-server:%v" $fname .Values.service.server.ports.server.port }} - secret: typesense-secret: enabled: true diff --git a/charts/stable/immich/templates/_machinelearning.tpl b/charts/stable/immich/templates/_machinelearning.tpl index a5a23281458..a9a29258351 100644 --- a/charts/stable/immich/templates/_machinelearning.tpl +++ b/charts/stable/immich/templates/_machinelearning.tpl @@ -1,7 +1,7 @@ {{/* Define the machinelearning container */}} {{- define "immich.machinelearning" -}} {{- $fname := (include "tc.v1.common.lib.chart.names.fullname" .) -}} -{{- $serverUrl := printf "http://%v-server:%v/server-info/ping" $fname .Values.service.server.ports.server.port }} +{{- $serverUrl := printf "http://%v:%v/api/server-info/ping" $fname .Values.service.main.ports.main.port }} enabled: true type: Deployment podSpec: diff --git a/charts/stable/immich/templates/_microservices.tpl b/charts/stable/immich/templates/_microservices.tpl index fef7da011ae..60dd003447f 100644 --- a/charts/stable/immich/templates/_microservices.tpl +++ b/charts/stable/immich/templates/_microservices.tpl @@ -1,6 +1,6 @@ {{- define "immich.microservices" -}} {{- $fname := (include "tc.v1.common.lib.chart.names.fullname" .) -}} -{{- $serverUrl := printf "http://%v-server:%v/server-info/ping" $fname .Values.service.server.ports.server.port }} +{{- $serverUrl := printf "http://%v:%v/api/server-info/ping" $fname .Values.service.main.ports.main.port }} enabled: true type: Deployment podSpec: @@ -13,7 +13,10 @@ podSpec: enabled: true primary: true imageSelector: image - args: start-microservices.sh + command: /bin/sh + args: + - -c + - /usr/src/app/start-microservices.sh securityContext: capabilities: disableS6Caps: true @@ -30,13 +33,13 @@ podSpec: readiness: enabled: true type: tcp - port: '{{ .Values.service.microservices.ports.microservices.port }}' + port: {{ .Values.service.microservices.ports.microservices.port }} liveness: enabled: true type: tcp - port: '{{ .Values.service.microservices.ports.microservices.port }}' + port: {{ .Values.service.microservices.ports.microservices.port }} startup: enabled: true type: tcp - port: '{{ .Values.service.microservices.ports.microservices.port }}' + port: {{ .Values.service.microservices.ports.microservices.port }} {{- end -}} diff --git a/charts/stable/immich/templates/_proxy.tpl b/charts/stable/immich/templates/_proxy.tpl deleted file mode 100644 index 16402e04bdd..00000000000 --- a/charts/stable/immich/templates/_proxy.tpl +++ /dev/null @@ -1,45 +0,0 @@ -{{- define "immich.proxy" -}} -{{- $fname := (include "tc.v1.common.lib.chart.names.fullname" .) -}} -{{- $serverUrl := printf "http://%v-server:%v/server-info/ping" $fname .Values.service.server.ports.server.port }} -{{- $webUrl := printf "http://%v-web:%v/robots.txt" $fname .Values.service.web.ports.web.port }} -enabled: true -type: Deployment -podSpec: - initContainers: - wait-server: - {{/* Wait for server */}} - {{- include "immich.wait" (dict "url" $serverUrl) | nindent 6 }} - {{/* Wait for web, otherwise nginx will fail to find host */}} - {{- include "immich.wait" (dict "url" $webUrl) | nindent 6 }} - containers: - proxy: - enabled: true - primary: true - imageSelector: proxyImage - securityContext: - capabilities: - disableS6Caps: true - add: - - CHOWN - - SETUID - - SETGID - envFrom: - - configMapRef: - name: proxy-config - probes: - readiness: - enabled: true - type: http - path: /api/server-info/ping - port: {{ .Values.service.main.ports.main.targetPort }} - liveness: - enabled: true - type: http - path: /api/server-info/ping - port: {{ .Values.service.main.ports.main.targetPort }} - startup: - enabled: true - type: http - path: /api/server-info/ping - port: {{ .Values.service.main.ports.main.targetPort }} -{{- end -}} diff --git a/charts/stable/immich/templates/_server.tpl b/charts/stable/immich/templates/_server.tpl index 637313afc22..f8179772957 100644 --- a/charts/stable/immich/templates/_server.tpl +++ b/charts/stable/immich/templates/_server.tpl @@ -2,7 +2,10 @@ enabled: true primary: true imageSelector: image -args: start-server.sh +command: /bin/sh +args: + - -c + - /usr/src/app/start-server.sh securityContext: capabilities: disableS6Caps: true @@ -19,16 +22,16 @@ probes: liveness: enabled: true type: http - path: /server-info/ping - port: {{ .Values.service.server.ports.server.port }} + path: /api/server-info/ping + port: {{ .Values.service.main.ports.main.port }} readiness: enabled: true type: http - path: /server-info/ping - port: {{ .Values.service.server.ports.server.port }} + path: /api/server-info/ping + port: {{ .Values.service.main.ports.main.port }} startup: enabled: true type: http - path: /server-info/ping - port: {{ .Values.service.server.ports.server.port }} + path: /api/server-info/ping + port: {{ .Values.service.main.ports.main.port }} {{- end -}} diff --git a/charts/stable/immich/templates/_wait.tpl b/charts/stable/immich/templates/_wait.tpl index 45bda874fc0..83400b8dc50 100644 --- a/charts/stable/immich/templates/_wait.tpl +++ b/charts/stable/immich/templates/_wait.tpl @@ -8,7 +8,7 @@ command: - -c - | echo "Pinging [{{ $url }}] until it is ready..." - until wget --spider --quiet "{{ $url }}"; do + until wget --spider --quiet --timeout=3 --tries 1 "{{ $url }}"; do echo "Waiting for [{{ $url }}] to be ready..." sleep 2 done diff --git a/charts/stable/immich/templates/_web.tpl b/charts/stable/immich/templates/_web.tpl deleted file mode 100644 index 808800a0711..00000000000 --- a/charts/stable/immich/templates/_web.tpl +++ /dev/null @@ -1,42 +0,0 @@ -{{/* Define the web container */}} -{{- define "immich.web" -}} -{{- $fname := (include "tc.v1.common.lib.chart.names.fullname" .) -}} -{{- $serverUrl := printf "http://%v-server:%v/server-info/ping" $fname .Values.service.server.ports.server.port }} -enabled: true -type: Deployment -podSpec: - initContainers: - wait-server: - {{/* Wait for server */}} - {{- include "immich.wait" (dict "url" $serverUrl) | nindent 6 }} - containers: - web: - enabled: true - primary: true - imageSelector: webImage - securityContext: - capabilities: - disableS6Caps: true - add: - - SETUID - - SETGID - envFrom: - - configMapRef: - name: web-config - probes: - readiness: - enabled: true - type: http - path: /robots.txt - port: {{ .Values.service.web.ports.web.port }} - liveness: - enabled: true - type: http - path: /robots.txt - port: {{ .Values.service.web.ports.web.port }} - startup: - enabled: true - type: http - path: /robots.txt - port: {{ .Values.service.web.ports.web.port }} -{{- end -}} diff --git a/charts/stable/immich/templates/common.yaml b/charts/stable/immich/templates/common.yaml index 60d0a857d2e..f2c3d6fc68a 100644 --- a/charts/stable/immich/templates/common.yaml +++ b/charts/stable/immich/templates/common.yaml @@ -3,9 +3,6 @@ {{- $fname := (include "tc.v1.common.lib.chart.names.fullname" .) -}} -{{/* Render Proxy Workload */}} -{{- $_ := set .Values.workload "proxy" (include "immich.proxy" . | fromYaml) -}} - {{- $_ := set .Values.workload.main.podSpec.containers "main" (include "immich.server" . | fromYaml) -}} {{- if .Values.immich.enable_typesense -}} {{/* Append init container to server, to make sure typesense is ready before starting */}} @@ -13,9 +10,6 @@ {{- $_ := set .Values.workload.main.podSpec.initContainers "wait-typesense" (include "immich.wait" (dict "url" $url) | fromYaml) -}} {{- end -}} -{{/* Render Web Workload */}} -{{- $_ := set .Values.workload "web" (include "immich.web" . | fromYaml) -}} - {{/* Render Microservices Workload */}} {{- $_ := set .Values.workload "microservices" (include "immich.microservices" . | fromYaml) -}} @@ -54,5 +48,17 @@ {{- $_ := mustMergeOverwrite .Values $config -}} {{- end -}} +{{- range $idx, $persistence := .Values.persistenceList -}} + {{- $_ := set $persistence "targetSelector" (dict + "main" (dict "main" dict) + "microservices" (dict "microservices" dict) + ) -}} +{{- end -}} + +{{- $envList := .Values.workload.main.podSpec.containers.main.envList -}} +{{- if $envList -}} + {{- $_ := set .Values.workload.microservices.podSpec.containers.microservices "envList" $envList -}} +{{- end -}} + {{/* Render the templates */}} {{ include "tc.v1.common.loader.apply" . }} diff --git a/charts/stable/immich/values.yaml b/charts/stable/immich/values.yaml index 3c6c80c7d87..043303b0c51 100644 --- a/charts/stable/immich/values.yaml +++ b/charts/stable/immich/values.yaml @@ -1,67 +1,38 @@ image: repository: altran1502/immich-server - tag: v1.86.0@sha256:b04b0cb5db7f954d1d7a9c9792f9feedcaaabed03b2f251ef7c6a8169be10086 + tag: v1.88.1@sha256:87dd30e8938ec894d1a05b5ce436fd12d432f4f76992f85495b84a2f9d2b2583 pullPolicy: IfNotPresent mlImage: repository: altran1502/immich-machine-learning - tag: v1.86.0@sha256:4f745b74a3d534fde87ba8ae3c7de97c1504596188d6da3fd38a2777acacda8a - pullPolicy: IfNotPresent -webImage: - repository: altran1502/immich-web - tag: v1.86.0@sha256:f2e806d4cbe7e443de0c004e7d6bc585b00e1d187913591fdc1fca944143026d - pullPolicy: IfNotPresent -proxyImage: - repository: altran1502/immich-proxy - tag: v1.86.0@sha256:96a557932b457fba8eb38d1d0d476f2e07fa8971d8a926886ebc543a6b35f012 + tag: v1.88.1@sha256:68391160d4fca56382a3eb8eff969f1728fed019bd8d737cab5d64950512d333 pullPolicy: IfNotPresent typesenseImage: repository: typesense/typesense tag: 0.25.1@sha256:3724f68156097114d07790e1c8bfaaca13b12eaecd602776d30d9933029064c7 pullPolicy: IfNotPresent + securityContext: container: readOnlyRootFilesystem: false runAsNonRoot: false runAsUser: 0 runAsGroup: 0 + immich: enable_ml: true enable_typesense: true public_login_page_message: Immich log_level: log + service: main: - # Main service targets the proxy - targetSelector: proxy + # Main service targets the server + targetSelector: main ports: main: port: 10323 protocol: http - targetSelector: proxy - targetPort: 8080 - server: - enabled: true - type: ClusterIP - # Server is the main container - targetSelector: main - ports: - server: - enabled: true - primary: true - port: 10001 - protocol: http targetSelector: main - web: - enabled: true - type: ClusterIP - targetSelector: web - ports: - web: - enabled: true - primary: true - port: 10000 - protocol: http - targetSelector: web microservices: enabled: true type: ClusterIP @@ -95,6 +66,7 @@ service: port: 10002 protocol: http targetSelector: typesense + persistence: mlcache: enabled: true @@ -162,24 +134,19 @@ persistence: main: {} microservices: microservices: {} - externallibrary: - enabled: true - mountPath: /media - targetSelector: - # Main pod/container is server - main: - main: {} - microservices: - microservices: {} + cnpg: main: enabled: true user: immich database: immich + redis: enabled: true redisUsername: default + portal: open: enabled: true + updated: true