immich - allow different ml images (#2146)

* immich - allow different ml images

* flake
This commit is contained in:
Stavros Kois
2024-02-07 14:34:17 +02:00
committed by GitHub
parent 63986940ff
commit bb39bd95ff
6 changed files with 45 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ description: Immich is a self-hosted photo and video backup solution directly fr
annotations:
title: Immich
type: application
version: 3.0.7
version: 3.0.8
apiVersion: v2
appVersion: 1.94.1
kubeVersion: '>=1.16.0-0'

View File

@@ -42,7 +42,20 @@ questions:
schema:
type: boolean
default: true
- variable: mlImageType
label: Machine Learning Image Type
description: |
The type of image to use for Machine Learning.
schema:
type: string
default: mlImage
enum:
- value: mlImage
description: Default Machine Learning Image
- value: mlCudaImage
description: Cuda Machine Learning Image
- value: mlOpenvinoImage
description: Openvino Machine Learning Image
- variable: immichNetwork
label: ""
group: Network Configuration

View File

@@ -1,6 +1,10 @@
{{- define "immich.machinelearning.workload" -}}
{{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}}
{{- $url := printf "http://%v:%v/api/server-info/ping" $fullname .Values.immichNetwork.webuiPort }}
{{- $url := printf "http://%v:%v/api/server-info/ping" $fullname .Values.immichNetwork.webuiPort -}}
{{- $img := "mlImage" -}}
{{- with .Values.immichConfig.mlImage -}}
{{- $img = . -}}
{{- end }}
workload:
machinelearning:
enabled: true
@@ -11,7 +15,7 @@ workload:
machinelearning:
enabled: true
primary: true
imageSelector: mlImage
imageSelector: {{ $img }}
securityContext:
runAsUser: 0
runAsGroup: 0

View File

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

View File

@@ -19,6 +19,11 @@ ENUMS = {
}
def strip_text(key, STRIP_TEXT):
key = key.replace('cuda', '').replace('openvino', '')
return key.strip(STRIP_TEXT)
def newer_mapping(image_tags):
output = {
@@ -35,7 +40,7 @@ def newer_mapping(image_tags):
if (STRIP_TEXT is None) or (RE_STABLE_VERSION is None):
continue
tags = {t.strip(STRIP_TEXT): t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)}
tags = {strip_text(t, STRIP_TEXT): t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)}
version = semantic_versioning(list(tags))
if not version:

View File

@@ -8,6 +8,16 @@ mlImage:
pullPolicy: IfNotPresent
tag: v1.94.1
mlCudaImage:
repository: altran1502/immich-machine-learning
pullPolicy: IfNotPresent
tag: v1.94.1-cuda
mlOpenvinoImage:
repository: altran1502/immich-machine-learning
pullPolicy: IfNotPresent
tag: v1.94.1-openvino
pgvectorImage:
repository: tensorchord/pgvecto-rs
pullPolicy: IfNotPresent
@@ -23,6 +33,7 @@ immichGPU: {}
immichConfig:
publicLoginMessage: ''
enableML: true
mlImageType: mlImage
immichNetwork:
webuiPort: 30041