Skip to content

Commit

Permalink
test demo on helm (#2412)
Browse files Browse the repository at this point in the history
<!--
Thanks for your contribution! please review
https://github.com/alibaba/GraphScope/blob/main/CONTRIBUTING.md before
opening an issue.
-->

## What do these changes do?

<!-- Please give a short brief about these changes. -->
Add more tests under helm installation.

## Related issue number

<!-- Are there any issues opened that will be resolved by merging this
change? -->

Fixes #2172
  • Loading branch information
siyuan0322 committed Feb 7, 2023
1 parent 0491d27 commit 670e481
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 16 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/k8s-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,13 @@ jobs:
echo "loaded learning"
- name: Helm Test
env:
GS_TEST_DIR: ${{ github.workspace }}/gstest
run: |
cd charts
helm template graphscope --set image.registry="",image.tag="${SHORT_SHA}",withJupyter=false \
helm template graphscope --set image.registry="",image.tag="${SHORT_SHA}",withJupyter=false,volumes.enabled=true,volumes.items.data.field.path=${GS_TEST_DIR} \
./graphscope
helm install graphscope --set image.registry="",image.tag="${SHORT_SHA}",withJupyter=false \
helm install graphscope --set image.registry="",image.tag="${SHORT_SHA}",withJupyter=false,volumes.enabled=true,volumes.items.data.field.path=${GS_TEST_DIR} \
./graphscope
helm test graphscope --timeout 5m0s
export NODE_IP=$(kubectl get pod -lgraphscope.coordinator.name=coordinator-graphscope -ojsonpath="{.items[0].status.hostIP}")
Expand Down
4 changes: 2 additions & 2 deletions charts/graphscope/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ volumes:
type: hostPath
field:
type: Directory
path: /testingdata
path: /tmp/testingdata
mounts:
- mountPath: /tmp/testingdata
- mountPath: /testingdata
preemptive: true


Expand Down
57 changes: 45 additions & 12 deletions python/graphscope/tests/kubernetes/test_demo_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,20 +318,53 @@ def get_addr_on_ci_env():


@pytest.mark.skipif("GS_ADDR" not in os.environ, reason="GS_ADDR not specified")
def test_helm_installation():
def test_helm_installation(data_dir, modern_graph_data_dir):
addr = get_addr_on_ci_env()
sess = graphscope.session(addr=addr)
g = sess.g()
assert g is not None
sess.close()
sess = graphscope.session(addr=addr)
g = sess.g()
assert g is not None
sess.close()
sess = graphscope.session(addr=addr)
g = sess.g()
assert g is not None
sess.close()
graph = load_ldbc(sess, data_dir)

# Interactive engine
interactive = sess.gremlin(graph)
sub_graph = interactive.subgraph( # noqa: F841
'g.V().hasLabel("person").outE("knows")'
)
person_count = interactive.execute(
'g.V().hasLabel("person").outE("knows").bothV().dedup().count()'
).all()[0]
knows_count = interactive.execute(
'g.V().hasLabel("person").outE("knows").count()'
).all()[0]
interactive2 = sess.gremlin(sub_graph)
sub_person_count = interactive2.execute("g.V().count()").all()[0]
sub_knows_count = interactive2.execute("g.E().count()").all()[0]
assert person_count == sub_person_count
assert knows_count == sub_knows_count

# Analytical engine
# project the projected graph to simple graph.
simple_g = sub_graph.project(vertices={"person": []}, edges={"knows": []})

pr_result = graphscope.pagerank(simple_g, delta=0.8)
tc_result = graphscope.triangles(simple_g)

# add the PageRank and triangle-counting results as new columns to the property graph
sub_graph.add_column(pr_result, {"Ranking": "r"})
sub_graph.add_column(tc_result, {"TC": "r"})

# test subgraph on modern graph
mgraph = load_modern_graph(sess, modern_graph_data_dir)

# Interactive engine
minteractive = sess.gremlin(mgraph)
msub_graph = minteractive.subgraph( # noqa: F841
'g.V().hasLabel("person").outE("knows")'
)
person_count = minteractive.execute(
'g.V().hasLabel("person").outE("knows").bothV().dedup().count()'
).all()[0]
msub_interactive = sess.gremlin(msub_graph)
sub_person_count = msub_interactive.execute("g.V().count()").all()[0]
assert person_count == sub_person_count


def test_modualize():
Expand Down

0 comments on commit 670e481

Please sign in to comment.