Skip to content

Commit

Permalink
Retain OID in vtable when used, and set default containers properly
Browse files Browse the repository at this point in the history
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
  • Loading branch information
sighingnow committed Jan 13, 2023
1 parent 5de96b8 commit cf1d916
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 19 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/k8s-ci-dummy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,35 +67,35 @@ jobs:
build-analytical:
runs-on: ubuntu-20.04
needs: [build-wheels, changes]
needs: [changes]
if: ${{ github.repository == 'alibaba/GraphScope' }}
steps:
- run: 'echo "No action required" '

build-analytical-java:
runs-on: ubuntu-20.04
needs: [build-wheels, changes]
needs: [changes]
if: ${{ github.repository == 'alibaba/GraphScope' }}
steps:
- run: 'echo "No action required" '

build-interactive:
runs-on: ubuntu-20.04
needs: [build-wheels, changes]
needs: [changes]
if: ${{ github.repository == 'alibaba/GraphScope' }}
steps:
- run: 'echo "No action required" '

build-learning:
runs-on: ubuntu-20.04
needs: [build-wheels, changes]
needs: [changes]
if: ${{ github.repository == 'alibaba/GraphScope' }}
steps:
- run: 'echo "No action required" '

# build-coordinator:
# runs-on: ubuntu-20.04
# needs: [build-wheels, changes]
# needs: [changes]
# if: ${{ github.repository == 'alibaba/GraphScope' }}
# steps:
# - run: 'echo "No action required" '
Expand Down
8 changes: 7 additions & 1 deletion coordinator/gscoordinator/cluster_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,13 @@ def get_engine_pod_spec(self):

def get_engine_pod_template_spec(self):
spec = self.get_engine_pod_spec()
return ResourceBuilder.get_pod_template_spec(spec, self._engine_labels)
if self._with_analytical or self._with_analytical_java:
default_container = self.analytical_container_name
else:
default_container = None
return ResourceBuilder.get_pod_template_spec(
spec, self._engine_labels, default_container=default_container
)

def get_engine_stateful_set(self):
name = self.engine_stateful_set_name
Expand Down
10 changes: 7 additions & 3 deletions python/graphscope/deploy/kubernetes/resource_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,14 @@ def get_pod_spec(containers: [kube_client.V1Container], image_pull_secrets=None,
return pod_spec

@staticmethod
def get_pod_template_spec(spec: kube_client.V1PodSpec, labels: dict):
def get_pod_template_spec(spec: kube_client.V1PodSpec, labels: dict, annotations=None, default_container=None):
pod_template_spec = kube_client.V1PodTemplateSpec()
pod_template_spec.spec = spec
pod_template_spec.metadata = kube_client.V1ObjectMeta(labels=labels)
if annotations is None:
annotations = dict()
if default_container is not None:
annotations['kubectl.kubernetes.io/default-container'] = default_container
pod_template_spec.metadata = kube_client.V1ObjectMeta(labels=labels, annotations=annotations)
return pod_template_spec

@staticmethod
Expand Down Expand Up @@ -333,7 +337,7 @@ def get_coordinator_pod_spec(self):

def get_coordinator_pod_template_spec(self):
spec = self.get_coordinator_pod_spec()
return ResourceBuilder.get_pod_template_spec(spec, self._labels)
return ResourceBuilder.get_pod_template_spec(spec, self._labels, default_container='coordinator')

def get_coordinator_deployment_spec(self, replicas):
template = self.get_coordinator_pod_template_spec()
Expand Down
16 changes: 8 additions & 8 deletions python/graphscope/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def arrow_property_graph(graphscope_session):
"v1": Loader("{}/twitter_v_1".format(new_property_dir), header_row=True),
},
generate_eid=False,
retain_oid=False,
retain_oid=True,
)
yield g
del g
Expand Down Expand Up @@ -327,7 +327,7 @@ def arrow_property_graph_only_from_efile(graphscope_session):
],
},
generate_eid=False,
retain_oid=False,
retain_oid=True,
)
yield g
del g
Expand Down Expand Up @@ -413,7 +413,7 @@ def arrow_project_undirected_graph(arrow_property_graph_undirected):

@pytest.fixture(scope="module")
def p2p_property_graph(graphscope_session):
g = graphscope_session.g(generate_eid=False, retain_oid=False, directed=True)
g = graphscope_session.g(generate_eid=False, retain_oid=True, directed=True)
g = g.add_vertices(f"{property_dir}/p2p-31_property_v_0", "person")
g = g.add_edges(
f"{property_dir}/p2p-31_property_e_0",
Expand Down Expand Up @@ -441,7 +441,7 @@ def p2p_graph_from_pandas(graphscope_session):
@pytest.fixture(scope="module")
def p2p_property_graph_string(graphscope_session):
g = graphscope_session.g(
oid_type="string", generate_eid=False, retain_oid=False, directed=True
oid_type="string", generate_eid=False, retain_oid=True, directed=True
)
g = g.add_vertices(f"{property_dir}/p2p-31_property_v_0", "person")
g = g.add_edges(
Expand All @@ -457,7 +457,7 @@ def p2p_property_graph_string(graphscope_session):
@pytest.fixture(scope="module")
def p2p_property_graph_int32(graphscope_session):
g = graphscope_session.g(
oid_type="int32", generate_eid=False, retain_oid=False, directed=True
oid_type="int32", generate_eid=False, retain_oid=True, directed=True
)
g = g.add_vertices(f"{property_dir}/p2p-31_property_v_0", "person")
g = g.add_edges(
Expand Down Expand Up @@ -487,7 +487,7 @@ def p2p_property_graph_undirected(graphscope_session):
@pytest.fixture(scope="module")
def p2p_property_graph_undirected_local_vm(graphscope_session):
g = graphscope_session.g(
directed=False, generate_eid=False, retain_oid=False, vertex_map="local"
directed=False, generate_eid=False, retain_oid=True, vertex_map="local"
)
g = g.add_edges(
f"{property_dir}/p2p-31_property_e_0",
Expand All @@ -504,7 +504,7 @@ def p2p_property_graph_undirected_local_vm_string(graphscope_session):
g = graphscope_session.g(
directed=False,
generate_eid=False,
retain_oid=False,
retain_oid=True,
vertex_map="local",
oid_type="str",
)
Expand All @@ -523,7 +523,7 @@ def p2p_property_graph_undirected_local_vm_int32(graphscope_session):
g = graphscope_session.g(
directed=False,
generate_eid=False,
retain_oid=False,
retain_oid=True,
vertex_map="local",
oid_type="int32",
)
Expand Down
2 changes: 1 addition & 1 deletion python/graphscope/tests/kubernetes/test_demo_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def test_query_modern_graph(


def test_serialize_roundtrip(gs_session_distributed, p2p_property_dir):
graph = gs_session_distributed.g(generate_eid=False, retain_oid=False)
graph = gs_session_distributed.g(generate_eid=False, retain_oid=True)
graph = graph.add_vertices(f"{p2p_property_dir}/p2p-31_property_v_0", "person")
graph = graph.add_edges(
f"{p2p_property_dir}/p2p-31_property_e_0",
Expand Down
2 changes: 1 addition & 1 deletion python/graphscope/tests/unittest/test_serailaize.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def gs_session_local():


def test_serialize_roundtrip(gs_session_local):
graph = gs_session_local.g(generate_eid=False, retain_oid=False)
graph = gs_session_local.g(generate_eid=False, retain_oid=True)
p2p_property_dir = os.path.expandvars("${GS_TEST_DIR}/property")
graph = graph.add_vertices(f"{p2p_property_dir}/p2p-31_property_v_0", "person")
graph = graph.add_edges(
Expand Down

0 comments on commit cf1d916

Please sign in to comment.