alibaba / GraphScope

🔨 🍇 💻 🚀 GraphScope: A One-Stop Large-Scale Graph Computing System from Alibaba | 一站式图计算系统
https://graphscope.io
Apache License 2.0
3.32k stars 448 forks source link

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

Open JackyYangPassion opened 1 year ago

JackyYangPassion commented 1 year ago

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:


        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)
siyuan0322 commented 1 year ago
  1. It has been processed in coordinator and fired to GAE in here
  2. You can use the devcontainer with vscode
JackyYangPassion commented 1 year ago

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 commented 1 year ago
  1. You can use the devcontainer with vscode

Using devcontainer makes compilation and debugging very convenient.

image
siyuan0322 commented 1 year ago

Happy to see it helps!