Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
Committed-by: xiaolei.zl from Dev container
  • Loading branch information
zhanglei1949 committed Nov 4, 2024
2 parents 87e948a + 25fa9e9 commit dbde861
Show file tree
Hide file tree
Showing 34 changed files with 541 additions and 159 deletions.
1 change: 1 addition & 0 deletions charts/graphscope-store/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ data:
sudo chown -R graphscope:graphscope {{ .Values.storeDataPath }} || true
sudo chown -R graphscope:graphscope /etc/groot || true
sudo chown -R graphscope:graphscope /var/log/graphscope || true
[[ `hostname` =~ -([0-9]+)$ ]] || exit 1
ordinal=${BASH_REMATCH[1]}
Expand Down
43 changes: 38 additions & 5 deletions charts/graphscope-store/templates/coordinator/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,20 +135,31 @@ spec:
- name: config
mountPath: /etc/groot/setup.sh
subPath: setup.sh
- name: log
mountPath: {{ .Values.logPersistence.mountPath }}
volumes:
- name: config
configMap:
name: {{ include "graphscope-store.configmapName" . }}
defaultMode: 0755
{{- if and .Values.coordinator.persistence.enabled .Values.coordinator.persistence.existingClaim }}
{{- if and .Values.coordinator.persistence.enabled .Values.coordinator.persistence.existingClaim }}
- name: meta
persistentVolumeClaim:
claimName: {{ printf "%s" (tpl .Values.coordinator.persistence.existingClaim .) }}
{{- else if not .Values.coordinator.persistence.enabled }}
{{- else if not .Values.coordinator.persistence.enabled }}
- name: meta
emptyDir: {}
{{- else if and .Values.coordinator.persistence.enabled (not .Values.coordinator.persistence.existingClaim) }}
{{- end }}
{{- if not .Values.logPersistence.enabled }}
- name: log
emptyDir: {}
{{- else if .Values.logPersistence.existingClaim }}
- name: log
persistentVolumeClaim:
claimName: {{ printf "%s" (tpl .Values.logPersistence.existingClaim .) }}
{{- end }}
volumeClaimTemplates:
{{- if and .Values.coordinator.persistence.enabled (not .Values.coordinator.persistence.existingClaim) }}
- metadata:
name: meta
{{- if .Values.persistence.annotations }}
Expand All @@ -169,5 +180,27 @@ spec:
{{- if .Values.coordinator.persistence.selector }}
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.coordinator.persistence.selector "context" $) | nindent 10 }}
{{- end -}}
{{- end }}
{{- end -}}
{{- end }}
{{- if and .Values.logPersistence.enabled (not .Values.logPersistence.existingClaim) }}
- metadata:
name: log
{{- if .Values.persistence.annotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
{{- end }}
{{- if .Values.persistence.labels }}
labels: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.labels "context" $) | nindent 10 }}
{{- end }}
spec:
accessModes:
{{- range .Values.logPersistence.accessModes }}
- {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.logPersistence.size | quote }}
{{ include "graphscope-store.storageClass" . | nindent 8 }}
{{- if .Values.logPersistence.selector }}
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.logPersistence.selector "context" $) | nindent 10 }}
{{- end -}}
{{- end }}
{{- end -}}
33 changes: 33 additions & 0 deletions charts/graphscope-store/templates/frontend/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,42 @@ spec:
- name: config
mountPath: /etc/groot/setup.sh
subPath: setup.sh
- name: log
mountPath: {{ .Values.logPersistence.mountPath }}
volumes:
- name: config
configMap:
name: {{ include "graphscope-store.configmapName" . }}
defaultMode: 0755
{{- if not .Values.logPersistence.enabled }}
- name: log
emptyDir: {}
{{- else if .Values.logPersistence.existingClaim }}
- name: log
persistentVolumeClaim:
claimName: {{ printf "%s" (tpl .Values.logPersistence.existingClaim .) }}
{{- end }}
volumeClaimTemplates:
{{- if and .Values.logPersistence.enabled (not .Values.logPersistence.existingClaim) }}
- metadata:
name: log
{{- if .Values.persistence.annotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
{{- end }}
{{- if .Values.persistence.labels }}
labels: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.labels "context" $) | nindent 10 }}
{{- end }}
spec:
accessModes:
{{- range .Values.logPersistence.accessModes }}
- {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.logPersistence.size | quote }}
{{ include "graphscope-store.storageClass" . | nindent 8 }}
{{- if .Values.logPersistence.selector }}
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.logPersistence.selector "context" $) | nindent 10 }}
{{- end -}}
{{- end }}
{{- end }}
41 changes: 37 additions & 4 deletions charts/graphscope-store/templates/onepod/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ spec:
- name: config
mountPath: /etc/groot/setup.sh
subPath: setup.sh
- name: log
mountPath: {{ .Values.logPersistence.mountPath }}
{{- if .Values.store.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
Expand All @@ -148,15 +150,24 @@ spec:
{{- if .Values.store.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumes "context" $) | nindent 8 }}
{{- end }}
{{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }}
{{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }}
- name: data
persistentVolumeClaim:
claimName: {{ printf "%s" (tpl .Values.store.persistence.existingClaim .) }}
{{- else if not .Values.store.persistence.enabled }}
{{- else if not .Values.store.persistence.enabled }}
- name: data
emptyDir: {}
{{- else if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }}
{{- end }}
{{- if not .Values.logPersistence.enabled }}
- name: log
emptyDir: {}
{{- else if .Values.logPersistence.existingClaim }}
- name: log
persistentVolumeClaim:
claimName: {{ printf "%s" (tpl .Values.logPersistence.existingClaim .) }}
{{- end }}
volumeClaimTemplates:
{{- if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }}
- metadata:
name: data
{{- if .Values.persistence.annotations }}
Expand All @@ -177,5 +188,27 @@ spec:
{{- if .Values.store.persistence.selector }}
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.store.persistence.selector "context" $) | nindent 10 }}
{{- end -}}
{{- end }}
{{- end }}
{{- if and .Values.logPersistence.enabled (not .Values.logPersistence.existingClaim) }}
- metadata:
name: log
{{- if .Values.persistence.annotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
{{- end }}
{{- if .Values.persistence.labels }}
labels: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.labels "context" $) | nindent 10 }}
{{- end }}
spec:
accessModes:
{{- range .Values.logPersistence.accessModes }}
- {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.logPersistence.size | quote }}
{{ include "graphscope-store.storageClass" . | nindent 8 }}
{{- if .Values.logPersistence.selector }}
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.logPersistence.selector "context" $) | nindent 10 }}
{{- end -}}
{{- end }}
{{- end }}
41 changes: 37 additions & 4 deletions charts/graphscope-store/templates/store/statefulset-backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ spec:
- name: config
mountPath: /etc/groot/setup.sh
subPath: setup.sh
- name: log
mountPath: {{ .Values.logPersistence.mountPath }}
{{- if .Values.store.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
Expand All @@ -154,15 +156,24 @@ spec:
{{- if .Values.store.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumes "context" $) | nindent 8 }}
{{- end }}
{{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }}
{{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }}
- name: data
persistentVolumeClaim:
claimName: {{ printf "%s" (tpl .Values.store.persistence.existingClaim .) }}
{{- else if not .Values.store.persistence.enabled }}
{{- else if not .Values.store.persistence.enabled }}
- name: data
emptyDir: {}
{{- else if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }}
{{- end }}
{{- if not .Values.logPersistence.enabled }}
- name: log
emptyDir: {}
{{- else if .Values.logPersistence.existingClaim }}
- name: log
persistentVolumeClaim:
claimName: {{ printf "%s" (tpl .Values.logPersistence.existingClaim .) }}
{{- end }}
volumeClaimTemplates:
{{- if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }}
- metadata:
name: data
{{- if .Values.persistence.annotations }}
Expand All @@ -183,6 +194,28 @@ spec:
{{- if .Values.store.persistence.selector }}
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.store.persistence.selector "context" $) | nindent 10 }}
{{- end -}}
{{- end }}
{{- end }}
{{- if and .Values.logPersistence.enabled (not .Values.logPersistence.existingClaim) }}
- metadata:
name: log
{{- if .Values.persistence.annotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
{{- end }}
{{- if .Values.persistence.labels }}
labels: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.labels "context" $) | nindent 10 }}
{{- end }}
spec:
accessModes:
{{- range .Values.logPersistence.accessModes }}
- {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.logPersistence.size | quote }}
{{ include "graphscope-store.storageClass" . | nindent 8 }}
{{- if .Values.logPersistence.selector }}
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.logPersistence.selector "context" $) | nindent 10 }}
{{- end -}}
{{- end }}
{{- end -}}
{{- end -}}
41 changes: 37 additions & 4 deletions charts/graphscope-store/templates/store/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ spec:
- name: config
mountPath: /etc/groot/setup.sh
subPath: setup.sh
- name: log
mountPath: {{ .Values.logPersistence.mountPath }}
{{- if .Values.store.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
Expand All @@ -150,15 +152,24 @@ spec:
{{- if .Values.store.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumes "context" $) | nindent 8 }}
{{- end }}
{{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }}
{{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }}
- name: data
persistentVolumeClaim:
claimName: {{ printf "%s" (tpl .Values.store.persistence.existingClaim .) }}
{{- else if not .Values.store.persistence.enabled }}
{{- else if not .Values.store.persistence.enabled }}
- name: data
emptyDir: {}
{{- else if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }}
{{- end }}
{{- if not .Values.logPersistence.enabled }}
- name: log
emptyDir: {}
{{- else if .Values.logPersistence.existingClaim }}
- name: log
persistentVolumeClaim:
claimName: {{ printf "%s" (tpl .Values.logPersistence.existingClaim .) }}
{{- end }}
volumeClaimTemplates:
{{- if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }}
- metadata:
name: data
{{- if .Values.persistence.annotations }}
Expand All @@ -179,5 +190,27 @@ spec:
{{- if .Values.store.persistence.selector }}
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.store.persistence.selector "context" $) | nindent 10 }}
{{- end -}}
{{- end }}
{{- end }}
{{- if and .Values.logPersistence.enabled (not .Values.logPersistence.existingClaim) }}
- metadata:
name: log
{{- if .Values.persistence.annotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
{{- end }}
{{- if .Values.persistence.labels }}
labels: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.labels "context" $) | nindent 10 }}
{{- end }}
spec:
accessModes:
{{- range .Values.logPersistence.accessModes }}
- {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.logPersistence.size | quote }}
{{ include "graphscope-store.storageClass" . | nindent 8 }}
{{- if .Values.logPersistence.selector }}
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.logPersistence.selector "context" $) | nindent 10 }}
{{- end -}}
{{- end }}
{{- end -}}
21 changes: 21 additions & 0 deletions charts/graphscope-store/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,27 @@ queryExecutionTimeoutMs: 600000
graphPlannerJoinMinPatternSize: 5
graphPlannerCboGlogueSize: 3

## Log Persistence parameters
##
logPersistence:
## Enable persistence using Persistent Volume Claims. If false, use emptyDir
enabled: false
## Existing PVC to hold the log data. If not provided, a new PVC will be created.
existingClaim: ""
## Persistent Volume storage class
storageClass: ""
## Persistent Volume access modes
accessModes:
- ReadWriteOnce
## Persistent Volume size
size: 1Gi
## Persistent Volume annotations
annotations: {}
## Persistent Volume labels
selector: {}
## mountPath for the Persistent Volume
mountPath: "/var/log/graphscope"

## Key-value pair separated by ;
## For example extraConfig="k1=v1;k2=v2"
extraConfig: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public class CoordinatorConfig {
public static final Config<Long> SNAPSHOT_INCREASE_INTERVAL_MS =
Config.longConfig("snapshot.increase.interval.ms", 1000L);
Config.longConfig("snapshot.increase.interval.ms", 2000L);

public static final Config<Long> OFFSETS_PERSIST_INTERVAL_MS =
Config.longConfig("offsets.persist.interval.ms", 1000L);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.alibaba.graphscope.common.client.type.ExecutionResponseListener;
import com.alibaba.graphscope.common.config.Configs;
import com.alibaba.graphscope.common.config.QueryTimeoutConfig;
import com.alibaba.graphscope.gremlin.plugin.QueryLogger;

/**
* client to submit request to remote engine service
Expand All @@ -37,7 +38,8 @@ public ExecutionClient(ChannelFetcher<C> channelFetcher) {
public abstract void submit(
ExecutionRequest request,
ExecutionResponseListener listener,
QueryTimeoutConfig timeoutConfig)
QueryTimeoutConfig timeoutConfig,
QueryLogger queryLogger)
throws Exception;

public abstract void close() throws Exception;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.alibaba.graphscope.gaia.proto.GraphAlgebraPhysical;
import com.alibaba.graphscope.gaia.proto.IrResult;
import com.alibaba.graphscope.gaia.proto.StoredProcedure;
import com.alibaba.graphscope.gremlin.plugin.QueryLogger;
import com.alibaba.graphscope.interactive.client.Session;
import com.alibaba.graphscope.interactive.client.common.Result;
import com.alibaba.graphscope.interactive.client.impl.DefaultSession;
Expand Down Expand Up @@ -56,7 +57,8 @@ public HttpExecutionClient(Configs graphConfig, ChannelFetcher<URI> channelFetch
public void submit(
ExecutionRequest request,
ExecutionResponseListener listener,
QueryTimeoutConfig timeoutConfig)
QueryTimeoutConfig timeoutConfig,
QueryLogger queryLogger)
throws Exception {
List<CompletableFuture> responseFutures = Lists.newArrayList();
for (URI httpURI : channelFetcher.fetch()) {
Expand Down
Loading

0 comments on commit dbde861

Please sign in to comment.