Skip to content

Commit

Permalink
feat(chart): support appVersion as the default image tag
Browse files Browse the repository at this point in the history
Signed-off-by: Zubiao Xiong <[email protected]>
  • Loading branch information
xiongzubiao committed Jan 23, 2025
1 parent 7fe6183 commit 3589c95
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion charts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ update-versions:
hami_version="$(VERSION)"; \
chart_version=` echo $(VERSION) | tr -d 'v' ` ; \
sed -i 's/version: "*'$(VERSION_REGEX)'"*/version: '$$chart_version'/g' $(CHART_FILE); \
sed -i 's/appVersion: "*'$(VERSION_REGEX)'"*/appVersion: "'$$chart_version'"/g' $(CHART_FILE); \
sed -i 's/appVersion: "*'$(VERSION_REGEX)'"*/appVersion: "'$$hami_version'"/g' $(CHART_FILE); \
sed -i 's/version: "*'$(VERSION_REGEX)'"*/version: "'$$hami_version'"/g' $(VALUES_FILE)

lint: update-versions
Expand Down
2 changes: 1 addition & 1 deletion charts/hami/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ maintainers:
email: [email protected]
- name: zhangxiao
email: [email protected]
appVersion: "2.4.1"
appVersion: "v2.4.1"

4 changes: 2 additions & 2 deletions charts/hami/templates/device-plugin/daemonsetnvidia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
hostNetwork: true
containers:
- name: device-plugin
image: {{ .Values.devicePlugin.image }}:{{ .Values.version }}
image: {{ .Values.devicePlugin.image }}:{{ .Values.version | default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.devicePlugin.imagePullPolicy | quote }}
lifecycle:
postStart:
Expand Down Expand Up @@ -90,7 +90,7 @@ spec:
mountPath: /device-config.yaml
subPath: device-config.yaml
- name: vgpu-monitor
image: {{ .Values.devicePlugin.image }}:{{ .Values.version }}
image: {{ .Values.devicePlugin.image }}:{{ .Values.version | default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.devicePlugin.imagePullPolicy | quote }}
command: ["vGPUmonitor"]
securityContext:
Expand Down
2 changes: 1 addition & 1 deletion charts/hami/templates/scheduler/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ spec:
timeoutSeconds: 15
{{- end }}
- name: vgpu-scheduler-extender
image: {{ .Values.scheduler.extender.image }}:{{ .Values.version }}
image: {{ .Values.scheduler.extender.image }}:{{ .Values.version | default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.scheduler.extender.imagePullPolicy | quote }}
env:
{{- if .Values.global.managedNodeSelectorEnable }}
Expand Down
3 changes: 1 addition & 2 deletions charts/hami/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

nameOverride: ""
fullnameOverride: ""
imagePullSecrets: [ ]
version: "v2.4.1"
imagePullSecrets: []

#Nvidia GPU Parameters
resourceName: "nvidia.com/gpu"
Expand Down
1 change: 0 additions & 1 deletion docs/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ This is the architecture diagram of the HAMi release process
Update version information through PR and create a new tag

* update 'version' and 'appVersion' filed in 'charts/hami/Chart.yaml' by pr
* update 'version' in 'charts/hami/values.yaml' by pr
* update version in '/VERSION' by pr
* a version tag should be set on right branch. The version should go with
* v0.1.0
Expand Down
2 changes: 1 addition & 1 deletion hack/verify-chart-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ else
util::install_helm
fi

APP_VERSION=$(helm show chart ./charts/hami | grep '^appVersion' |grep -E '[0-9].*.[0-9]' | awk -F ':' '{print $2}' | tr -d ' ')
APP_VERSION=$(helm show chart ./charts/hami | grep '^appVersion' |grep -E '[0-9].*.[0-9]' | awk -F ':' '{print $2}' | tr -d ' ' | cut -c2-)
VERSION=$(helm show chart ./charts/hami | grep '^version' |grep -E '[0-9].*.[0-9]' | awk -F ':' '{print $2}' | tr -d ' ')

if [[ ${APP_VERSION} != ${VERSION} ]]; then
Expand Down

0 comments on commit 3589c95

Please sign in to comment.