diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81ebcf1d84a4..5cf7232041a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -678,14 +678,17 @@ jobs: python3 -m pytest -s -vvv tests/kubernetes/test_store_service.py -k test_demo_fresh # helm restart ci release and run demo with the PersistentVolume - # FIXME(@haixia): restart seems not work. - # helm uninstall ci - # cd ${GITHUB_WORKSPACE}/charts - # helm install ci --set image.tag=${{ github.sha }},executor=${{ matrix.executor }} \ - # ./graphscope-store - # helm test ci --timeout 5m0s - # cd ${GITHUB_WORKSPACE}/python - # python3 -m pytest -s -vvv tests/kubernetes/test_store_service.py -k test_demo_after_restart + helm uninstall ci + cd ${GITHUB_WORKSPACE}/charts + helm install ci --set image.tag=${{ github.sha }},executor=${{ matrix.executor }} \ + ./graphscope-store + export GRPC_PORT=$(kubectl get --namespace default -o jsonpath="{.spec.ports[0].nodePort}" services ci-graphscope-store-frontend) + export GREMLIN_PORT=$(kubectl get --namespace default -o jsonpath="{.spec.ports[1].nodePort}" services ci-graphscope-store-frontend) + export NODE_IP=$(kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}") + helm test ci --timeout 5m0s + cd ${GITHUB_WORKSPACE}/python + sleep 30 + python3 -m pytest -s -vvv tests/kubernetes/test_store_service.py -k test_demo_after_restart - name: Clean if: always() diff --git a/interactive_engine/src/v2/src/main/java/com/alibaba/maxgraph/v2/frontend/SnapshotCache.java b/interactive_engine/src/v2/src/main/java/com/alibaba/maxgraph/v2/frontend/SnapshotCache.java index ff6b3fc4b41b..767740769038 100644 --- a/interactive_engine/src/v2/src/main/java/com/alibaba/maxgraph/v2/frontend/SnapshotCache.java +++ b/interactive_engine/src/v2/src/main/java/com/alibaba/maxgraph/v2/frontend/SnapshotCache.java @@ -17,6 +17,7 @@ import com.alibaba.maxgraph.v2.common.SnapshotListener; import com.alibaba.maxgraph.v2.common.SnapshotWithSchema; +import com.alibaba.maxgraph.v2.common.exception.MaxGraphException; import com.alibaba.maxgraph.v2.common.frontend.api.schema.SchemaFetcher; import com.alibaba.maxgraph.v2.common.frontend.api.schema.SnapshotSchema; import com.alibaba.maxgraph.v2.common.schema.GraphDef; @@ -130,6 +131,10 @@ public SnapshotSchema fetchSchema() { if (snapshotWithSchema == null) { return null; } - return new SnapshotSchema(snapshotWithSchema.getSnapshotId(), snapshotWithSchema.getGraphDef()); + long snapshotId = snapshotWithSchema.getSnapshotId(); + if (snapshotId == -1L) { + throw new MaxGraphException("Not started yet"); + } + return new SnapshotSchema(snapshotId, snapshotWithSchema.getGraphDef()); } } diff --git a/python/graphscope/framework/graph_schema.py b/python/graphscope/framework/graph_schema.py index 580be496b0cb..82ca88d882e2 100644 --- a/python/graphscope/framework/graph_schema.py +++ b/python/graphscope/framework/graph_schema.py @@ -135,7 +135,7 @@ def as_type_def(self): @classmethod def from_type_def(cls, pb): label = cls(pb.label) - label._label_id = pb.label_id + label._label_id = pb.label_id.id label._version_id = pb.version_id for prop_pb in pb.props: label._props.append(Property.from_property_def(prop_pb)) @@ -240,12 +240,19 @@ def _from_store_service(self, graph_def): """ self._vertex_labels.clear() self._edge_labels.clear() + id_to_label = {} + for type_def_pb in graph_def.type_defs: + id_to_label[type_def_pb.label_id.id] = type_def_pb.label edge_kinds = {} for kind in graph_def.edge_kinds: - if kind.edge_label not in edge_kinds: - edge_kinds[kind.edge_label] = [] - edge_kinds[kind.edge_label].append( - (kind.src_vertex_label, kind.dst_vertex_label) + edge_label = id_to_label[kind.edge_label_id.id] + if edge_label not in edge_kinds: + edge_kinds[edge_label] = [] + edge_kinds[edge_label].append( + ( + id_to_label[kind.src_vertex_label_id.id], + id_to_label[kind.dst_vertex_label_id.id], + ) ) for type_def_pb in graph_def.type_defs: if type_def_pb.type_enum == graph_def_pb2.VERTEX: