diff --git a/charts/caraml-authz/Chart.yaml b/charts/caraml-authz/Chart.yaml index 90c51994..61ad556a 100644 --- a/charts/caraml-authz/Chart.yaml +++ b/charts/caraml-authz/Chart.yaml @@ -14,4 +14,4 @@ maintainers: - email: caraml-dev@caraml.dev name: caraml-dev name: authz -version: 0.1.12 +version: 0.1.13 diff --git a/charts/caraml-authz/README.md b/charts/caraml-authz/README.md index 326c625b..2c54bd16 100644 --- a/charts/caraml-authz/README.md +++ b/charts/caraml-authz/README.md @@ -1,6 +1,6 @@ # authz -![Version: 0.1.12](https://img.shields.io/badge/Version-0.1.12-informational?style=flat-square) ![AppVersion: 0.4.3](https://img.shields.io/badge/AppVersion-0.4.3-informational?style=flat-square) +![Version: 0.1.13](https://img.shields.io/badge/Version-0.1.13-informational?style=flat-square) ![AppVersion: 0.4.3](https://img.shields.io/badge/AppVersion-0.4.3-informational?style=flat-square) Helm chart for deploying Ory Keto diff --git a/charts/caraml-authz/templates/_helpers.tpl b/charts/caraml-authz/templates/_helpers.tpl index 1b4016d3..82255b3a 100644 --- a/charts/caraml-authz/templates/_helpers.tpl +++ b/charts/caraml-authz/templates/_helpers.tpl @@ -41,15 +41,17 @@ Generated names {{- printf "%s-bootstrap-config" (include "caraml-authz.resource-prefix-with-release-name" .) | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{- define "caraml-authz.version" -}} +{{ .Values.deployment.image.tag | default .Chart.AppVersion }} +{{- end -}} + {{/* Common labels */}} {{- define "caraml-authz.labels" -}} app.kubernetes.io/name: {{ template "caraml-authz.name" . }} helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | quote}} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} +app.kubernetes.io/version: {{ template "caraml-authz.version" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: caraml diff --git a/charts/caraml-authz/templates/deployment.yaml b/charts/caraml-authz/templates/deployment.yaml index 1e59fca9..1166737b 100644 --- a/charts/caraml-authz/templates/deployment.yaml +++ b/charts/caraml-authz/templates/deployment.yaml @@ -17,6 +17,7 @@ spec: metadata: labels: app: {{ template "caraml-authz.name" . }} + version: {{ template "caraml-authz.version" . }} release: {{ .Release.Name }} spec: initContainers: diff --git a/charts/merlin/Chart.yaml b/charts/merlin/Chart.yaml index 4c70810c..f627a459 100644 --- a/charts/merlin/Chart.yaml +++ b/charts/merlin/Chart.yaml @@ -33,4 +33,4 @@ maintainers: - email: caraml-dev@caraml.dev name: caraml-dev name: merlin -version: 0.13.9 +version: 0.13.10 diff --git a/charts/merlin/README.md b/charts/merlin/README.md index 511390ba..94a2ef1c 100644 --- a/charts/merlin/README.md +++ b/charts/merlin/README.md @@ -1,7 +1,7 @@ # merlin --- -![Version: 0.13.9](https://img.shields.io/badge/Version-0.13.9-informational?style=flat-square) +![Version: 0.13.10](https://img.shields.io/badge/Version-0.13.10-informational?style=flat-square) ![AppVersion: v0.38.0-rc1](https://img.shields.io/badge/AppVersion-v0.38.0--rc1-informational?style=flat-square) Kubernetes-friendly ML model management, deployment, and serving. diff --git a/charts/merlin/templates/_helpers.tpl b/charts/merlin/templates/_helpers.tpl index be616669..137492c4 100644 --- a/charts/merlin/templates/_helpers.tpl +++ b/charts/merlin/templates/_helpers.tpl @@ -76,18 +76,31 @@ Generated names {{- end -}} {{- end -}} +{{/* +Application version +*/}} +{{- define "merlin.version" -}} + {{- if (ne .Values.deployment.image.tag "") -}} + {{- .Values.deployment.image.tag -}} + {{- else -}} + {{- if (ne (len .Values.rendered) 0) -}} + {{- substr 1 (len .Values.rendered.releasedVersion) .Values.rendered.releasedVersion -}} + {{- else -}} + {{- substr 1 (len .Chart.AppVersion) .Chart.AppVersion -}} + {{- end -}} + {{- end -}} +{{- end }} {{/* Common labels */}} {{- define "merlin.labels" -}} -app: {{ template "merlin.name" .}} +app: {{ template "merlin.name" . }} +version: {{ template "merlin.version" . }} release: {{ .Release.Name }} app.kubernetes.io/name: {{ template "merlin.name" . }} helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | quote}} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} +app.kubernetes.io/version: {{ template "merlin.version" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: caraml @@ -322,7 +335,7 @@ MlflowConfig: {{ printf "%s%s:%s" (ternary (printf "%s/" $.Values.deployment.image.registry) "" (ne $.Values.deployment.image.registry "")) $.Values.deployment.image.repository $.Values.deployment.image.tag }} {{- else -}} {{- with index . 1 }} -{{- $tag := ternary $.Values.deployment.image.tag (substr 1 (len $rendered.releasedVersion) $rendered.releasedVersion) (ne $.Values.deployment.image.tag "") -}} +{{- $tag := include "merlin.version" . -}} {{ printf "%s%s:%s" (ternary (printf "%s/" $.Values.deployment.image.registry) "" (ne $.Values.deployment.image.registry "")) $.Values.deployment.image.repository $tag }} {{- end -}} {{- end -}} diff --git a/charts/merlin/templates/merlin-deployment.yaml b/charts/merlin/templates/merlin-deployment.yaml index 93e27e78..5441ff44 100644 --- a/charts/merlin/templates/merlin-deployment.yaml +++ b/charts/merlin/templates/merlin-deployment.yaml @@ -32,7 +32,8 @@ spec: template: metadata: labels: - app: {{ template "merlin.name" .}} + app: {{ template "merlin.name" . }} + version: {{ template "merlin.version" . }} release: {{ .Release.Name }} {{- if .Values.deployment.podLabels }} {{- toYaml .Values.deployment.podLabels | nindent 8 }} diff --git a/charts/merlin/tests/merlin_deployment_test.yaml b/charts/merlin/tests/merlin_deployment_test.yaml index 9def61f5..4b283d58 100644 --- a/charts/merlin/tests/merlin_deployment_test.yaml +++ b/charts/merlin/tests/merlin_deployment_test.yaml @@ -136,6 +136,48 @@ tests: - matchRegex: path: metadata.name pattern: my-release-merlin$ - - equal: # check database secret name + - equal: # check image version path: spec.template.spec.containers[0].image value: ghcr.io/caraml-dev/merlin:1.0.0-test-released-version + - equal: # check version label + path: spec.template.metadata.labels.version + value: 1.0.0-test-released-version + + - it: image tag must have precedence over releasedVersion + set: + deployment: + image: + tag: 1.0.0-test-image-tag + rendered: + releasedVersion: v1.0.0-test-released-version + asserts: + - isKind: + of: Deployment + - matchRegex: + path: metadata.name + pattern: my-release-merlin$ + - equal: # check image version + path: spec.template.spec.containers[0].image + value: ghcr.io/caraml-dev/merlin:1.0.0-test-image-tag + - equal: # check version label + path: spec.template.metadata.labels.version + value: 1.0.0-test-image-tag + + - it: default version is taken from .Chart.AppVersion + set: + deployment: + image: + tag: "" + rendered: {} + asserts: + - isKind: + of: Deployment + - matchRegex: + path: metadata.name + pattern: my-release-merlin$ + - equal: # check image version + path: spec.template.spec.containers[0].image + value: ghcr.io/caraml-dev/merlin:0.38.0-rc1 + - equal: # check version label + path: spec.template.metadata.labels.version + value: 0.38.0-rc1 diff --git a/charts/mlp/Chart.yaml b/charts/mlp/Chart.yaml index e3414c9c..a360d36d 100644 --- a/charts/mlp/Chart.yaml +++ b/charts/mlp/Chart.yaml @@ -17,4 +17,4 @@ maintainers: - email: caraml-dev@caraml.dev name: caraml-dev name: mlp -version: 0.6.4 +version: 0.6.5 diff --git a/charts/mlp/README.md b/charts/mlp/README.md index 1eafe9fe..128ba259 100644 --- a/charts/mlp/README.md +++ b/charts/mlp/README.md @@ -1,6 +1,6 @@ # mlp -![Version: 0.6.4](https://img.shields.io/badge/Version-0.6.4-informational?style=flat-square) ![AppVersion: v1.10.0](https://img.shields.io/badge/AppVersion-v1.10.0-informational?style=flat-square) +![Version: 0.6.5](https://img.shields.io/badge/Version-0.6.5-informational?style=flat-square) ![AppVersion: v1.10.0](https://img.shields.io/badge/AppVersion-v1.10.0-informational?style=flat-square) MLP API diff --git a/charts/mlp/templates/_helpers.tpl b/charts/mlp/templates/_helpers.tpl index 5569c28d..9e6cccf9 100644 --- a/charts/mlp/templates/_helpers.tpl +++ b/charts/mlp/templates/_helpers.tpl @@ -17,6 +17,10 @@ Expand the name of the chart. {{- printf "%s-%s" .Chart.Name .Chart.Version -}} {{- end -}} +{{- define "mlp.version" -}} +{{ .Values.deployment.image.tag | default .Chart.AppVersion }} +{{- end -}} + {{/* Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). @@ -53,9 +57,7 @@ Common labels {{- define "mlp.labels" -}} app.kubernetes.io/name: {{ template "mlp.name" . }} helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | quote}} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} +app.kubernetes.io/version: {{ template "mlp.version" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: caraml diff --git a/charts/mlp/templates/deployment.yaml b/charts/mlp/templates/deployment.yaml index d6cc901c..958d0a43 100644 --- a/charts/mlp/templates/deployment.yaml +++ b/charts/mlp/templates/deployment.yaml @@ -27,6 +27,7 @@ spec: metadata: labels: app: {{ template "mlp.name" .}} + version: {{ template "mlp.version" . }} release: {{ .Release.Name }} {{- if .Values.deployment.podLabels }} {{- toYaml .Values.deployment.podLabels | nindent 8 }} @@ -34,7 +35,7 @@ spec: spec: containers: - name: api - image: "{{ .Values.deployment.image.registry }}/{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }}" + image: "{{ .Values.deployment.image.registry }}/{{ .Values.deployment.image.repository }}:{{ template "mlp.version" . }}" imagePullPolicy: {{ .Values.deployment.image.pullPolicy }} ports: - containerPort: {{ .Values.service.internalPort }} diff --git a/charts/turing/Chart.yaml b/charts/turing/Chart.yaml index a3e8c72e..af011937 100644 --- a/charts/turing/Chart.yaml +++ b/charts/turing/Chart.yaml @@ -22,4 +22,4 @@ maintainers: - email: caraml-dev@caraml.dev name: caraml-dev name: turing -version: 0.3.10 +version: 0.3.11 diff --git a/charts/turing/README.md b/charts/turing/README.md index de4dbef5..8e746af4 100644 --- a/charts/turing/README.md +++ b/charts/turing/README.md @@ -1,7 +1,7 @@ # turing --- -![Version: 0.3.10](https://img.shields.io/badge/Version-0.3.10-informational?style=flat-square) +![Version: 0.3.11](https://img.shields.io/badge/Version-0.3.11-informational?style=flat-square) ![AppVersion: v1.16.0](https://img.shields.io/badge/AppVersion-v1.16.0-informational?style=flat-square) Kubernetes-friendly multi-model orchestration and experimentation system. diff --git a/charts/turing/templates/_helpers.tpl b/charts/turing/templates/_helpers.tpl index 67a4acfa..8828ef9d 100644 --- a/charts/turing/templates/_helpers.tpl +++ b/charts/turing/templates/_helpers.tpl @@ -8,8 +8,13 @@ {{- printf "%s-%s" .Chart.Name .Chart.Version -}} {{- end -}} +{{- define "turing.version" -}} +{{ (ternary .Values.deployment.image.tag (default "" .Values.rendered.releasedVersion ) (ne .Values.deployment.image.tag "")) | toString -}} +{{- end -}} + {{- define "turing.labels" -}} app: {{ include "turing.name" . }} +version: {{ include "turing.version" . }} chart: {{ include "turing.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} @@ -38,7 +43,7 @@ heritage: {{ .Release.Service }} {{- define "turing.image" -}} {{- $registryName := .Values.deployment.image.registry -}} {{- $repositoryName := .Values.deployment.image.repository -}} -{{- $tag := (ternary .Values.deployment.image.tag (default "" .Values.rendered.releasedVersion ) (ne .Values.deployment.image.tag "")) | toString -}} +{{- $tag := (include "turing.version" .) -}} {{- if $registryName }} {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} {{- else -}} diff --git a/charts/turing/templates/turing-deployment.yaml b/charts/turing/templates/turing-deployment.yaml index d900f4f4..27354ff6 100644 --- a/charts/turing/templates/turing-deployment.yaml +++ b/charts/turing/templates/turing-deployment.yaml @@ -23,6 +23,7 @@ spec: metadata: labels: app: {{ template "turing.name" . }} + version: {{ template "turing.version" . }} release: {{ .Release.Name }} {{- if .Values.deployment.labels }} {{ toYaml .Values.deployment.labels | indent 8 -}} diff --git a/charts/turing/tests/turing_deployment_test.yaml b/charts/turing/tests/turing_deployment_test.yaml index 5882d392..a2bc517b 100644 --- a/charts/turing/tests/turing_deployment_test.yaml +++ b/charts/turing/tests/turing_deployment_test.yaml @@ -78,6 +78,7 @@ tests: - equal: # check database secret key path: spec.template.spec.containers[0].env[0].valueFrom.secretKeyRef.key value: secret-key + - it: should set releasedVersion as deployment image tag if deployment image tag is unset set: deployment: @@ -91,6 +92,29 @@ tests: - matchRegex: path: metadata.name pattern: my-release-turing$ - - equal: # check database secret name + - equal: # check image version path: spec.template.spec.containers[0].image value: ghcr.io/caraml-dev/turing:1.11.0-test-released-version + - equal: # check version label + path: spec.template.metadata.labels.version + value: 1.11.0-test-released-version + + - it: image tag must have precedence over releasedVersion + set: + deployment: + image: + tag: 1.11.0-test-image-tag + rendered: + releasedVersion: 1.11.0-test-released-version + asserts: + - isKind: + of: Deployment + - matchRegex: + path: metadata.name + pattern: my-release-turing$ + - equal: # check image version + path: spec.template.spec.containers[0].image + value: ghcr.io/caraml-dev/turing:1.11.0-test-image-tag + - equal: # check version label + path: spec.template.metadata.labels.version + value: 1.11.0-test-image-tag diff --git a/charts/xp-management/Chart.yaml b/charts/xp-management/Chart.yaml index 94e3734f..562776e1 100644 --- a/charts/xp-management/Chart.yaml +++ b/charts/xp-management/Chart.yaml @@ -18,4 +18,4 @@ maintainers: - email: caraml-dev@caraml.dev name: caraml-dev name: xp-management -version: 0.2.10 +version: 0.2.11 diff --git a/charts/xp-management/README.md b/charts/xp-management/README.md index 1f5634ca..e0bc777c 100644 --- a/charts/xp-management/README.md +++ b/charts/xp-management/README.md @@ -1,7 +1,7 @@ # xp-management --- -![Version: 0.2.10](https://img.shields.io/badge/Version-0.2.10-informational?style=flat-square) +![Version: 0.2.11](https://img.shields.io/badge/Version-0.2.11-informational?style=flat-square) ![AppVersion: 0.12.1](https://img.shields.io/badge/AppVersion-0.12.1-informational?style=flat-square) Management service - A part of XP system that is used to configure experiments diff --git a/charts/xp-management/templates/_helpers.tpl b/charts/xp-management/templates/_helpers.tpl index c5360aa7..01bca6df 100644 --- a/charts/xp-management/templates/_helpers.tpl +++ b/charts/xp-management/templates/_helpers.tpl @@ -1,3 +1,5 @@ +{{/* vim: set filetype=mustache: */}} + {{/* Expand the name of the chart. */}} @@ -39,17 +41,23 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} +{{/* +Application version +*/}} +{{- define "management-svc.version" -}} +{{ .Values.deployment.image.tag | default .Chart.AppVersion }} +{{- end }} + {{/* Common labels */}} {{- define "management-svc.labels" -}} -app: {{ template "management-svc.name" .}} +app: {{ template "management-svc.name" . }} +version: {{ template "management-svc.version" . }} release: {{ .Release.Name }} app.kubernetes.io/name: {{ template "management-svc.name" . }} helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | quote}} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} +app.kubernetes.io/version: {{ template "management-svc.version" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: caraml diff --git a/charts/xp-management/templates/deployment.yaml b/charts/xp-management/templates/deployment.yaml index 358488b2..d6866f8b 100644 --- a/charts/xp-management/templates/deployment.yaml +++ b/charts/xp-management/templates/deployment.yaml @@ -24,7 +24,8 @@ spec: template: metadata: labels: - app: {{ template "management-svc.name" .}} + app: {{ template "management-svc.name" . }} + version: {{ template "management-svc.version" . }} release: {{ .Release.Name }} {{- if .Values.deployment.labels }} {{- toYaml .Values.deployment.labels | nindent 8 -}} @@ -43,7 +44,7 @@ spec: {{- end }} containers: - name: api - image: "{{ .Values.deployment.image.registry }}/{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.deployment.image.registry }}/{{ .Values.deployment.image.repository }}:{{ template "management-svc.version" . }}" imagePullPolicy: {{ .Values.deployment.image.pullPolicy }} env: - name: "DBCONFIG_PASSWORD" diff --git a/charts/xp-treatment/Chart.yaml b/charts/xp-treatment/Chart.yaml index fd54fe6f..91b44adb 100644 --- a/charts/xp-treatment/Chart.yaml +++ b/charts/xp-treatment/Chart.yaml @@ -15,4 +15,4 @@ maintainers: - email: caraml-dev@caraml.dev name: caraml-dev name: xp-treatment -version: 0.1.27 +version: 0.1.28 diff --git a/charts/xp-treatment/README.md b/charts/xp-treatment/README.md index 7018168c..aef129ff 100644 --- a/charts/xp-treatment/README.md +++ b/charts/xp-treatment/README.md @@ -1,7 +1,7 @@ # xp-treatment --- -![Version: 0.1.27](https://img.shields.io/badge/Version-0.1.27-informational?style=flat-square) +![Version: 0.1.28](https://img.shields.io/badge/Version-0.1.28-informational?style=flat-square) ![AppVersion: 0.12.1](https://img.shields.io/badge/AppVersion-0.12.1-informational?style=flat-square) Treatment service - A part of XP system that is used to obtain the treatment configuration from active experiments diff --git a/charts/xp-treatment/templates/_helpers.tpl b/charts/xp-treatment/templates/_helpers.tpl index 8e976ee2..be2aacb5 100644 --- a/charts/xp-treatment/templates/_helpers.tpl +++ b/charts/xp-treatment/templates/_helpers.tpl @@ -1,3 +1,5 @@ +{{/* vim: set filetype=mustache: */}} + {{/* Expand the name of the chart. */}} @@ -39,16 +41,23 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} +{{/* +Application version +*/}} +{{- define "treatment-svc.version" -}} +{{ .Values.deployment.image.tag | default .Chart.AppVersion }} +{{- end }} + {{/* Common labels */}} {{- define "treatment-svc.labels" -}} +app: {{ template "treatment-svc.name" . }} +version: {{ template "treatment-svc.version" . }} release: {{ .Release.Name }} app.kubernetes.io/name: {{ template "treatment-svc.name" . }} helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | quote}} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} +app.kubernetes.io/version: {{ template "treatment-svc.version" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: caraml diff --git a/charts/xp-treatment/templates/deployment.yaml b/charts/xp-treatment/templates/deployment.yaml index 6d1209df..078b2315 100644 --- a/charts/xp-treatment/templates/deployment.yaml +++ b/charts/xp-treatment/templates/deployment.yaml @@ -24,8 +24,8 @@ spec: metadata: labels: app: {{ template "treatment-svc.name" . }} + version: {{ template "treatment-svc.version" .}} release: {{ .Release.Name }} - {{- include "treatment-svc.labels" . | nindent 8 }} {{- with .Values.deployment.annotations }} annotations: {{- toYaml . | nindent 8 }} @@ -40,7 +40,7 @@ spec: {{- end }} containers: - name: api - image: "{{ .Values.deployment.image.registry }}/{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.deployment.image.registry }}/{{ .Values.deployment.image.repository }}:{{ template "treatment-svc.version" . }}" imagePullPolicy: {{ .Values.deployment.image.pullPolicy }} env: {{- with .Values.deployment.extraEnvs }}