Skip to content

Commit

Permalink
add pre upgrade tasks and skip updating pgvector for now
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros-k committed Dec 18, 2023
1 parent b220d3d commit 515fa78
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 5 deletions.
4 changes: 4 additions & 0 deletions library/common/templates/app_functions/_postgres.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ backupChownMode (optional): Whether to chown the backup directory or
{{- $backupPath := .backupPath | default "/postgres_backup" -}}
{{- $backupChownMode := .backupChownMode | default "check" -}}
{{- $ixChartContext := .ixChartContext -}}
{{- $preUpgradeTasks := .preUpgradeTasks | default list -}}
{{- $resources := (required "Postgres - Resources are required" .resources) }}

{{ $name }}:
Expand Down Expand Up @@ -127,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
2 changes: 1 addition & 1 deletion library/ix-dev/community/immich/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ annotations:
type: application
version: 3.0.0
apiVersion: v2
appVersion: 1.90.2
appVersion: 1.91.3
kubeVersion: '>=1.16.0-0'
maintainers:
- name: truenas
Expand Down
Binary file modified library/ix-dev/community/immich/charts/common-1.2.5.tgz
Binary file not shown.
7 changes: 6 additions & 1 deletion library/ix-dev/community/immich/templates/_postgres.tpl
Original file line number Diff line number Diff line change
@@ -1,8 +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 -}}
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", "pgvectorImage"]
"keys": ["image", "webImage", "proxyImage", "mlImage"]
}
2 changes: 1 addition & 1 deletion library/ix-dev/community/immich/upgrade_strategy
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENUMS = {
'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
2 changes: 1 addition & 1 deletion library/ix-dev/community/immich/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mlImage:
pgvectorImage:
repository: tensorchord/pgvecto-rs
pullPolicy: IfNotPresent
tag: pg15-v0.1.13
tag: pg15-v0.1.11

resources:
limits:
Expand Down

0 comments on commit 515fa78

Please sign in to comment.