GraphScope icon indicating copy to clipboard operation
GraphScope copied to clipboard

[Question] Where is graph.add_vertices() op Execute?

Open JackyYangPassion opened this issue 1 year ago • 4 comments

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

JackyYangPassion avatar Nov 09 '23 06:11 JackyYangPassion

  1. It has been processed in coordinator and fired to GAE in here
  2. You can use the devcontainer with vscode

siyuan0322 avatar Nov 09 '23 07:11 siyuan0322

Thanks for your reply!

  1. It has been processed in coordinator and fired to GAE in here
  2. You can use the devcontainer with vscode

JackyYangPassion avatar Nov 09 '23 07:11 JackyYangPassion

  1. You can use the devcontainer with vscode

Using devcontainer makes compilation and debugging very convenient.

image

JackyYangPassion avatar Nov 14 '23 09:11 JackyYangPassion

Happy to see it helps!

siyuan0322 avatar Nov 14 '23 09:11 siyuan0322