GraphScope
GraphScope copied to clipboard
[Question] Where is graph.add_vertices() op Execute?
By reading the source code, there are two questions:
Source Code:
# Import the graphscope module
import graphscope
import os
# 单机验证 加载图数据 from HDFS
from graphscope.framework.loader import Loader
from graphscope.client.session import get_default_session
graphscope.set_option(show_log=True) # enable logging
graphscope.set_option(log_level='DEBUG')
# 拉起简单的任务
sess = graphscope.session( cluster_type='hosts',
enabled_engines='interactive',
vineyard_shared_mem='1Gi',
num_workers=2)
# 客户端向Coordinator 发送RPC请求:创建图并加载图数据
graph = sess.g()
prefix = '/Users/jacky/.graphscope/datasets/ogbn_mag_small'
graph = (
graph.add_vertices(os.path.join(prefix, "paper.csv"), "paper")
)
Questions:
-
1.Where is graph.add_vertices() op Execute?
From coordinator servicer _RunStep() i can't find add_vertices op run on where[analytical engine、interactive engine or coordinator]
while not dag_manager.empty():
run_dag_on, dag, dag_bodies = dag_manager.next_dag()
error_code = error_codes_pb2.COORDINATOR_INTERNAL_ERROR
head, bodies = None, None
try:
# run on analytical engine
if run_dag_on == GSEngine.analytical_engine:
# need dag_bodies to load graph from pandas/numpy
error_code = error_codes_pb2.ANALYTICAL_ENGINE_INTERNAL_ERROR
head, bodies = self._operation_executor.run_on_analytical_engine(
dag, dag_bodies, loader_op_bodies
)
# run on interactive engine
elif run_dag_on == GSEngine.interactive_engine:
error_code = error_codes_pb2.INTERACTIVE_ENGINE_INTERNAL_ERROR
head, bodies = self._operation_executor.run_on_interactive_engine(
dag
)
# run on learning engine
elif run_dag_on == GSEngine.learning_engine:
error_code = error_codes_pb2.LEARNING_ENGINE_INTERNAL_ERROR
head, bodies = self._operation_executor.run_on_learning_engine(dag)
# run on coordinator
# 加载点边的 OP 是在哪里执行
elif run_dag_on == GSEngine.coordinator:
error_code = error_codes_pb2.COORDINATOR_INTERNAL_ERROR
head, bodies = self._operation_executor.run_on_coordinator(
dag, dag_bodies, loader_op_bodies
)
# merge the responses
responses[0].head.results.extend(head.head.results)
responses.extend(bodies)
-
2.How to build a source code reading development environment
Support breakpoint debugging: between client and coordinator
- It has been processed in coordinator and fired to GAE in here
- You can use the devcontainer with vscode
Thanks for your reply!
- It has been processed in coordinator and fired to GAE in here
- You can use the devcontainer with vscode
- You can use the devcontainer with vscode
Using devcontainer makes compilation and debugging very convenient.
Happy to see it helps!