Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(caraml): harmonize version label #391

Merged
merged 9 commits into from
Dec 12, 2023
2 changes: 1 addition & 1 deletion charts/caraml-authz/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ maintainers:
- email: [email protected]
name: caraml-dev
name: authz
version: 0.1.12
version: 0.1.13
2 changes: 1 addition & 1 deletion charts/caraml-authz/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
8 changes: 5 additions & 3 deletions charts/caraml-authz/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions charts/caraml-authz/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ spec:
metadata:
labels:
app: {{ template "caraml-authz.name" . }}
version: {{ template "caraml-authz.version" . }}
release: {{ .Release.Name }}
spec:
initContainers:
Expand Down
2 changes: 1 addition & 1 deletion charts/merlin/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ maintainers:
- email: [email protected]
name: caraml-dev
name: merlin
version: 0.13.8
version: 0.13.9
2 changes: 1 addition & 1 deletion charts/merlin/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
23 changes: 18 additions & 5 deletions charts/merlin/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,31 @@ Generated names
{{- end -}}
{{- end -}}

{{/*
Application version
*/}}
{{- define "merlin.version" -}}
maniteja6799 marked this conversation as resolved.
Show resolved Hide resolved
{{- 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
Expand Down Expand Up @@ -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" . -}}
maniteja6799 marked this conversation as resolved.
Show resolved Hide resolved
{{ printf "%s%s:%s" (ternary (printf "%s/" $.Values.deployment.image.registry) "" (ne $.Values.deployment.image.registry "")) $.Values.deployment.image.repository $tag }}
{{- end -}}
{{- end -}}
Expand Down
3 changes: 2 additions & 1 deletion charts/merlin/templates/merlin-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
44 changes: 43 additions & 1 deletion charts/merlin/tests/merlin_deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion charts/mlp/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ maintainers:
- email: [email protected]
name: caraml-dev
name: mlp
version: 0.6.4
version: 0.6.5
2 changes: 1 addition & 1 deletion charts/mlp/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
8 changes: 5 additions & 3 deletions charts/mlp/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion charts/mlp/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ spec:
metadata:
labels:
app: {{ template "mlp.name" .}}
version: {{ template "mlp.version" . }}
release: {{ .Release.Name }}
{{- if .Values.deployment.podLabels }}
{{- toYaml .Values.deployment.podLabels | nindent 8 }}
{{- end }}
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 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/turing/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ maintainers:
- email: [email protected]
name: caraml-dev
name: turing
version: 0.3.9
version: 0.3.10
2 changes: 1 addition & 1 deletion charts/turing/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
7 changes: 6 additions & 1 deletion charts/turing/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 -}}
Expand Down
1 change: 1 addition & 0 deletions charts/turing/templates/turing-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
26 changes: 25 additions & 1 deletion charts/turing/tests/turing_deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
2 changes: 1 addition & 1 deletion charts/xp-management/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ maintainers:
- email: [email protected]
name: caraml-dev
name: xp-management
version: 0.2.10
version: 0.2.11
2 changes: 1 addition & 1 deletion charts/xp-management/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 12 additions & 4 deletions charts/xp-management/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{/* vim: set filetype=mustache: */}}

{{/*
Expand the name of the chart.
*/}}
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions charts/xp-management/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion charts/xp-treatment/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ maintainers:
- email: [email protected]
name: caraml-dev
name: xp-treatment
version: 0.1.27
version: 0.1.28
2 changes: 1 addition & 1 deletion charts/xp-treatment/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading
Loading