Skip to content

Commit 36510de

Browse files
authored
feat(interactive): Upgrade graphscope-store imageto 0.30.0 and enable portal in onepod mode (#4550)
As titled.
1 parent cff6eb7 commit 36510de

File tree

6 files changed

+112
-8
lines changed

6 files changed

+112
-8
lines changed

charts/graphscope-store/templates/configmap.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ data:
182182
183183
while true
184184
do
185+
{{- if .Values.distributed.enabled }}
185186
export HOST="${INSTANCE_NAME}-graphscope-store-frontend-0.${INSTANCE_NAME}-graphscope-store-frontend-headless"
187+
{{- else }}
188+
export HOST="localhost"
189+
{{- end }}
186190
export GRPC_PORT=${GROOT_GRPC_PORT}
187191
export GREMLIN_PORT=${GROOT_GREMLIN_PORT}
188192
echo "${HOST} ${GRPC_PORT} ${GREMLIN_PORT}"

charts/graphscope-store/templates/onepod/statefulset.yaml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,75 @@ spec:
142142
{{- if .Values.store.extraVolumeMounts }}
143143
{{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumeMounts "context" $) | nindent 12 }}
144144
{{- end }}
145+
{{- if .Values.portal.enabled }}
146+
- name: gs-coordinator
147+
image: {{ include "graphscope-store.portal.coordinator.image" . }}
148+
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
149+
{{- if .Values.containerSecurityContext.enabled }}
150+
securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
151+
{{- end }}
152+
command:
153+
- /etc/coordinator/setup.sh
154+
env:
155+
- name: CLUSTER_TYPE
156+
value: "KUBERNETES"
157+
- name: VERSION
158+
value: {{ .Chart.Version | quote }}
159+
- name: GROOT_USERNAME
160+
value: {{ .Values.auth.username | quote }}
161+
- name: GROOT_PASSWORD
162+
value: {{ .Values.auth.password | b64enc | quote }}
163+
- name: GROOT_GRPC_PORT
164+
value: {{ .Values.frontend.service.servicePort | quote }}
165+
- name: GROOT_GREMLIN_PORT
166+
value: {{ .Values.frontend.service.gremlinPort | quote }}
167+
- name: GROOT_CYPHER_PORT
168+
value: {{ .Values.frontend.service.cypherPort | quote }}
169+
{{- if not .Values.distributed.enabled }}
170+
- name: GROOT_FRONTEND_POD_SUFFIX
171+
value: {{ printf "%s-store" (include "graphscope-store.name" .) }}
172+
{{- end }}
173+
- name: INSTANCE_NAME
174+
value: {{ .Release.Name | quote }}
175+
- name: NAMESPACE
176+
value: {{ .Release.Namespace | quote }}
177+
- name: SERVICE_PORT
178+
value: {{ .Values.portal.service.servicePort | quote }}
179+
- name: WORKSPACE
180+
value: {{ .Values.portal.runtimePath | quote }}
181+
- name: STUDIO_WRAPPER_ENDPOINT
182+
value: {{ .Values.portal.studioWrapperEndpoint | quote }}
183+
- name: BASEID
184+
value: {{ .Values.portal.baseId | quote }}
185+
- name: SOLUTION
186+
value: "GRAPHSCOPE_INSIGHT"
187+
{{- range $key, $value := .Values.env }}
188+
- name: {{ $key }}
189+
value: {{ $value | quote }}
190+
{{- end }}
191+
ports:
192+
- name: http
193+
containerPort: {{ .Values.portal.service.servicePort }}
194+
{{- if .Values.portal.resources }}
195+
resources: {{- toYaml .Values.portal.resources | nindent 12 }}
196+
{{- end }}
197+
{{- if .Values.livenessProbe.enabled }}
198+
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.livenessProbe "enabled") "context" $) | nindent 12 }}
199+
tcpSocket:
200+
port: http
201+
{{- end }}
202+
{{- if .Values.readinessProbe.enabled }}
203+
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readinessProbe "enabled") "context" $) | nindent 12 }}
204+
tcpSocket:
205+
port: http
206+
{{- end }}
207+
volumeMounts:
208+
- name: runtime
209+
mountPath: {{ .Values.portal.runtimePath | quote }}
210+
- name: config
211+
mountPath: /etc/coordinator/setup.sh
212+
subPath: portal_setup.sh
213+
{{- end }}
145214
volumes:
146215
- name: config
147216
configMap:
@@ -166,6 +235,14 @@ spec:
166235
persistentVolumeClaim:
167236
claimName: {{ printf "%s" (tpl .Values.logPersistence.existingClaim .) }}
168237
{{- end }}
238+
{{- if and .Values.portal.enabled .Values.portal.persistence.enabled .Values.portal.persistence.existingClaim }}
239+
- name: runtime
240+
persistentVolumeClaim:
241+
claimName: {{ printf "%s" (tpl .Values.portal.persistence.existingClaim .) }}
242+
{{- else if and .Values.portal.enabled (not .Values.portal.persistence.enabled) }}
243+
- name: runtime
244+
emptyDir: {}
245+
{{- end }}
169246
volumeClaimTemplates:
170247
{{- if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }}
171248
- metadata:
@@ -211,4 +288,26 @@ spec:
211288
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.logPersistence.selector "context" $) | nindent 10 }}
212289
{{- end -}}
213290
{{- end }}
291+
{{- if and .Values.portal.enabled .Values.portal.persistence.enabled (not .Values.portal.persistence.existingClaim) }}
292+
- metadata:
293+
name: runtime
294+
{{- if .Values.persistence.annotations }}
295+
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
296+
{{- end }}
297+
{{- if .Values.persistence.labels }}
298+
labels: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.labels "context" $) | nindent 10 }}
299+
{{- end }}
300+
spec:
301+
accessModes:
302+
{{- range .Values.persistence.accessModes }}
303+
- {{ . | quote }}
304+
{{- end }}
305+
resources:
306+
requests:
307+
storage: {{ .Values.portal.persistence.size | quote }}
308+
{{ include "graphscope-store.storageClass" . | nindent 8 }}
309+
{{- if .Values.portal.persistence.selector }}
310+
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.portal.persistence.selector "context" $) | nindent 10 }}
311+
{{- end -}}
312+
{{- end }}
214313
{{- end }}

charts/graphscope-store/templates/portal/statefulset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.portal.enabled }}
1+
{{- if and .Values.portal.enabled .Values.distributed.enabled }}
22
apiVersion: apps/v1
33
kind: StatefulSet
44
metadata:

charts/graphscope-store/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ image:
2525
registry: registry.cn-hongkong.aliyuncs.com
2626
repository: graphscope/graphscope-store
2727
# Overrides the image tag whose default is the chart appVersion.
28-
tag: "0.29.0"
28+
tag: "0.30.0"
2929
digest: ""
3030
## Specify a imagePullPolicy
3131
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
@@ -263,7 +263,7 @@ portal:
263263
coordinatorImage:
264264
registry: registry.cn-hongkong.aliyuncs.com
265265
repository: graphscope/coordinator
266-
tag: "0.29.0"
266+
tag: "0.30.0"
267267
## Service parameters
268268
##
269269
service:

coordinator/gscoordinator/flex/core/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def str_to_bool(s):
108108
GROOT_PASSWORD = base64.b64decode(GROOT_PASSWORD).decode('utf-8')
109109
except Exception as e:
110110
logger.warn("Invalid base64-encoded string found, use original value: %s", str(e))
111-
111+
GROOT_FRONTEND_POD_SUFFIX = os.environ.get("GROOT_FRONTEND_POD_SUFFIX", "graphscope-store-frontend")
112112

113113
# dataloading service for groot
114114
STUDIO_WRAPPER_ENDPOINT = os.environ.get("STUDIO_WRAPPER_ENDPOINT", None)

coordinator/gscoordinator/flex/core/insight/graph.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from gscoordinator.flex.core.config import CLUSTER_TYPE
3131
from gscoordinator.flex.core.config import CREATION_TIME
3232
from gscoordinator.flex.core.config import GROOT_CYPHER_PORT
33+
from gscoordinator.flex.core.config import GROOT_FRONTEND_POD_SUFFIX
3334
from gscoordinator.flex.core.config import GROOT_GREMLIN_PORT
3435
from gscoordinator.flex.core.config import GROOT_GRPC_PORT
3536
from gscoordinator.flex.core.config import GROOT_PASSWORD
@@ -88,8 +89,8 @@ def _fetch_endpoints_impl(self):
8889

8990
try:
9091
# frontend statefulset and service name
91-
frontend_pod_name = "{0}-graphscope-store-frontend-0".format(
92-
INSTANCE_NAME
92+
frontend_pod_name = "{0}-{1}-0".format(
93+
INSTANCE_NAME, GROOT_FRONTEND_POD_SUFFIX
9394
)
9495
pod = self._core_api.read_namespaced_pod(frontend_pod_name, NAMESPACE)
9596
endpoints = [
@@ -312,14 +313,14 @@ def get_groot_graph_from_k8s():
312313
core_api = kube_client.CoreV1Api(api_client)
313314
app_api = kube_client.AppsV1Api(api_client)
314315
# frontend statefulset and service name
315-
name = "{0}-graphscope-store-frontend".format(INSTANCE_NAME)
316+
name = "{0}-{1}".format(INSTANCE_NAME, GROOT_FRONTEND_POD_SUFFIX)
316317
response = app_api.read_namespaced_stateful_set(name, NAMESPACE)
317318
# creation time
318319
creation_time = response.metadata.creation_timestamp.astimezone(
319320
tz.tzlocal()
320321
).strftime("%Y/%m/%d %H:%M:%S")
321322
# service endpoints: [grpc_endpoint, gremlin_endpoint]
322-
frontend_pod_name = "{0}-graphscope-store-frontend-0".format(INSTANCE_NAME)
323+
frontend_pod_name = "{0}-{1}-0".format(INSTANCE_NAME, GROOT_FRONTEND_POD_SUFFIX)
323324
pod = core_api.read_namespaced_pod(frontend_pod_name, NAMESPACE)
324325
endpoints = [
325326
f"{pod.status.pod_ip}:{GROOT_GRPC_PORT}",

0 commit comments

Comments
 (0)