danhuawang commented on code in PR #7767:
URL: https://github.com/apache/gravitino/pull/7767#discussion_r2234596609
##########
dev/charts/gravitino/templates/deployment.yaml:
##########
@@ -46,13 +46,81 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
- {{- with .Values.image.pullSecrets }}
+ {{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
+ {{- end }}
+ initContainers:
+ - name: sqlfile
+ image: {{ include "gravitino.image" . }}
+ imagePullPolicy: "{{ .Values.image.pullPolicy }}"
+ command:
+ - /bin/bash
+ - -c
+ - |
+ cp -r /root/gravitino/scripts/* /tmp/scripts/
+ /root/gravitino/bin/gravitino.sh run > /dev/null 2>&1 &
+ while ! /root/gravitino/bin/gcli.sh -s; do
+ echo "Waiting for Gravitino to be ready..."
+ sleep 2
+ done
+ VERSION=$(/root/gravitino/bin/gcli.sh -s | grep -oP
'[0-9]+\.[0-9]+\.[0-9]+' | head -1)
+ echo $VERSION > /tmp/scripts/version.txt
+ resources:
+ {{- toYaml .Values.initResources | nindent 10 }}
+ volumeMounts:
+ - mountPath: /tmp/scripts/
+ name: scripts-emptydir
Review Comment:
I thought we don't have a static file in the image that record the gravitino
server version, especially if I replace the image with the enterprise one.
Additionally, I attempt to use `GRAVITINO_VERSION` in "gravitino-env.sh"
file, however this environment variable in enterprise image is a PLACEHOLDER.
In order to cover the enterprise scenario, I finally use an init container
to temporarily start the gravitino (h2 embedded database) to get the version
and save the version to a shared pod volume. This init container will
terminated once get version finished.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]