From 853cfffb14aa8cec23cfeb47580e839b92625fb6 Mon Sep 17 00:00:00 2001 From: Maksym Bruner Date: Mon, 11 Dec 2023 21:55:36 +0800 Subject: [PATCH 1/7] chore(caraml): set version label for all components --- charts/caraml-authz/templates/_helpers.tpl | 6 +++++- charts/caraml-authz/templates/deployment.yaml | 1 + charts/merlin/templates/_helpers.tpl | 13 ++++++++++--- charts/merlin/templates/merlin-deployment.yaml | 3 ++- charts/mlp/templates/_helpers.tpl | 8 ++++++-- charts/mlp/templates/deployment.yaml | 3 ++- charts/turing/templates/_helpers.tpl | 7 ++++++- charts/turing/templates/turing-deployment.yaml | 1 + charts/xp-management/templates/_helpers.tpl | 12 +++++++++++- charts/xp-management/templates/deployment.yaml | 5 +++-- charts/xp-treatment/templates/_helpers.tpl | 13 ++++++++++++- charts/xp-treatment/templates/deployment.yaml | 4 ++-- 12 files changed, 61 insertions(+), 15 deletions(-) diff --git a/charts/caraml-authz/templates/_helpers.tpl b/charts/caraml-authz/templates/_helpers.tpl index 1b4016d3..4579aa27 100644 --- a/charts/caraml-authz/templates/_helpers.tpl +++ b/charts/caraml-authz/templates/_helpers.tpl @@ -41,6 +41,10 @@ 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 */}} @@ -48,7 +52,7 @@ Common 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 }} +app.kubernetes.io/version: {{ template "caraml-authz.version" . }} {{- end }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} 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/templates/_helpers.tpl b/charts/merlin/templates/_helpers.tpl index be616669..7c3a8d9f 100644 --- a/charts/merlin/templates/_helpers.tpl +++ b/charts/merlin/templates/_helpers.tpl @@ -76,17 +76,24 @@ Generated names {{- end -}} {{- end -}} +{{/* +Application version +*/}} +{{- define "merlin.version" -}} +{{- ternary .Values.deployment.image.tag (substr 1 (len .Values.rendered.releasedVersion) .Values.rendered.releasedVersion) (ne .Values.deployment.image.tag "") -}} +{{- 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 }} +app.kubernetes.io/version: {{ template "merlin.version" . }} {{- end }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} @@ -322,7 +329,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/mlp/templates/_helpers.tpl b/charts/mlp/templates/_helpers.tpl index 5569c28d..130132f2 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). @@ -54,8 +58,8 @@ Common 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" . }} +{{- end -}} 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/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/xp-management/templates/_helpers.tpl b/charts/xp-management/templates/_helpers.tpl index c5360aa7..26693f8e 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,11 +41,19 @@ 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}} 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/templates/_helpers.tpl b/charts/xp-treatment/templates/_helpers.tpl index 8e976ee2..a292ecce 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,15 +41,24 @@ 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 }} +app.kubernetes.io/version: {{ template "treatment-svc.version" . }} {{- end }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} 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 }} From ce48577b585234c188193191f261602e64d4db9f Mon Sep 17 00:00:00 2001 From: Maksym Bruner Date: Mon, 11 Dec 2023 21:58:47 +0800 Subject: [PATCH 2/7] chore(caraml): fix versions and docs --- charts/caraml-authz/Chart.yaml | 2 +- charts/caraml-authz/README.md | 2 +- charts/merlin/Chart.yaml | 2 +- charts/merlin/README.md | 2 +- charts/mlp/Chart.yaml | 2 +- charts/mlp/README.md | 2 +- charts/turing/Chart.yaml | 2 +- charts/turing/README.md | 2 +- charts/xp-management/Chart.yaml | 2 +- charts/xp-management/README.md | 2 +- charts/xp-treatment/Chart.yaml | 2 +- charts/xp-treatment/README.md | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) 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/merlin/Chart.yaml b/charts/merlin/Chart.yaml index dd196735..4c70810c 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.8 +version: 0.13.9 diff --git a/charts/merlin/README.md b/charts/merlin/README.md index a11e4aac..5664cd64 100644 --- a/charts/merlin/README.md +++ b/charts/merlin/README.md @@ -1,7 +1,7 @@ # merlin --- -![Version: 0.13.8](https://img.shields.io/badge/Version-0.13.8-informational?style=flat-square) +![Version: 0.13.9](https://img.shields.io/badge/Version-0.13.9-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/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/turing/Chart.yaml b/charts/turing/Chart.yaml index d003842c..2bbd4a1f 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.9 +version: 0.3.10 diff --git a/charts/turing/README.md b/charts/turing/README.md index 51162960..de4dbef5 100644 --- a/charts/turing/README.md +++ b/charts/turing/README.md @@ -1,7 +1,7 @@ # turing --- -![Version: 0.3.9](https://img.shields.io/badge/Version-0.3.9-informational?style=flat-square) +![Version: 0.3.10](https://img.shields.io/badge/Version-0.3.10-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/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-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 From 29ef650ac0acf5de3251007c043f4a9479d2dae8 Mon Sep 17 00:00:00 2001 From: Maksym Bruner Date: Mon, 11 Dec 2023 22:12:30 +0800 Subject: [PATCH 3/7] chore(caraml): fix newline --- charts/mlp/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/mlp/templates/_helpers.tpl b/charts/mlp/templates/_helpers.tpl index 130132f2..e3af42cb 100644 --- a/charts/mlp/templates/_helpers.tpl +++ b/charts/mlp/templates/_helpers.tpl @@ -59,7 +59,7 @@ 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: {{ template "mlp.version" . }} -{{- end -}} +{{- end }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: caraml From aa0ed9c2039bc1da3008bc4e24ceac7d7afb3924 Mon Sep 17 00:00:00 2001 From: Maksym Bruner Date: Mon, 11 Dec 2023 22:21:07 +0800 Subject: [PATCH 4/7] chore(caraml): fix merlin version when rendered is empty --- charts/merlin/templates/_helpers.tpl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/charts/merlin/templates/_helpers.tpl b/charts/merlin/templates/_helpers.tpl index 7c3a8d9f..3d1b038b 100644 --- a/charts/merlin/templates/_helpers.tpl +++ b/charts/merlin/templates/_helpers.tpl @@ -80,8 +80,16 @@ Generated names Application version */}} {{- define "merlin.version" -}} -{{- ternary .Values.deployment.image.tag (substr 1 (len .Values.rendered.releasedVersion) .Values.rendered.releasedVersion) (ne .Values.deployment.image.tag "") -}} +{{- 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 -}} +{{- .Chart.AppVersion -}} {{- end -}} +{{- end -}} +{{- end }} {{/* Common labels From 78afdc3846d34ad8a180f32ec1073fdb210142ac Mon Sep 17 00:00:00 2001 From: Maksym Bruner Date: Tue, 12 Dec 2023 14:04:30 +0800 Subject: [PATCH 5/7] chore(caraml): add tests --- charts/merlin/templates/_helpers.tpl | 20 ++++----- .../merlin/tests/merlin_deployment_test.yaml | 44 ++++++++++++++++++- 2 files changed, 52 insertions(+), 12 deletions(-) diff --git a/charts/merlin/templates/_helpers.tpl b/charts/merlin/templates/_helpers.tpl index 3d1b038b..137492c4 100644 --- a/charts/merlin/templates/_helpers.tpl +++ b/charts/merlin/templates/_helpers.tpl @@ -80,15 +80,15 @@ Generated names 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 -}} -{{- .Chart.AppVersion -}} -{{- end -}} -{{- end -}} + {{- 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 }} {{/* @@ -100,9 +100,7 @@ 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: {{ template "merlin.version" . }} -{{- end }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: caraml 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 From 6ea7d984ab4b66f5b7d896fb0846429737dde38e Mon Sep 17 00:00:00 2001 From: Maksym Bruner Date: Tue, 12 Dec 2023 14:06:14 +0800 Subject: [PATCH 6/7] chore(caraml): add tests for turing --- charts/caraml-authz/templates/_helpers.tpl | 2 -- charts/mlp/templates/_helpers.tpl | 2 -- .../turing/tests/turing_deployment_test.yaml | 26 ++++++++++++++++++- charts/xp-management/templates/_helpers.tpl | 4 +-- charts/xp-treatment/templates/_helpers.tpl | 2 -- 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/charts/caraml-authz/templates/_helpers.tpl b/charts/caraml-authz/templates/_helpers.tpl index 4579aa27..82255b3a 100644 --- a/charts/caraml-authz/templates/_helpers.tpl +++ b/charts/caraml-authz/templates/_helpers.tpl @@ -51,9 +51,7 @@ 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: {{ template "caraml-authz.version" . }} -{{- end }} 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/_helpers.tpl b/charts/mlp/templates/_helpers.tpl index e3af42cb..9e6cccf9 100644 --- a/charts/mlp/templates/_helpers.tpl +++ b/charts/mlp/templates/_helpers.tpl @@ -57,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: {{ template "mlp.version" . }} -{{- end }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: caraml 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/templates/_helpers.tpl b/charts/xp-management/templates/_helpers.tpl index 26693f8e..01bca6df 100644 --- a/charts/xp-management/templates/_helpers.tpl +++ b/charts/xp-management/templates/_helpers.tpl @@ -57,9 +57,7 @@ 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-treatment/templates/_helpers.tpl b/charts/xp-treatment/templates/_helpers.tpl index a292ecce..be2aacb5 100644 --- a/charts/xp-treatment/templates/_helpers.tpl +++ b/charts/xp-treatment/templates/_helpers.tpl @@ -57,9 +57,7 @@ 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: {{ template "treatment-svc.version" . }} -{{- end }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: caraml From 62209d1956abc42f10cdab88b7030037463ac8ca Mon Sep 17 00:00:00 2001 From: Maksym Bruner Date: Tue, 12 Dec 2023 14:10:49 +0800 Subject: [PATCH 7/7] chore(caraml): update readme and bump versions --- charts/merlin/Chart.yaml | 2 +- charts/merlin/README.md | 2 +- charts/turing/Chart.yaml | 2 +- charts/turing/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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/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.