alibaba / GraphScope

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

[Question]How to set gscoordinator parameters through graphscope.session #3417

Closed JackyYangPassion closed 11 months ago

JackyYangPassion commented 11 months ago

want to set coordinator config
"monitor":true, "monitor_port":9090

sess = graphscope.session( cluster_type='hosts',
                           enabled_engines='interactive',
                           vineyard_shared_mem='1Gi',
                           num_workers=1)

log

{
    "solution":"GraphScope One",
    "launcher_type":"hosts",
    "show_log":true,
    "log_level":"DEBUG",
    "session":{
        "num_workers":1,
        "default_local_num_workers":1,
        "reconnect":false,
        "instance_id":"ooxfoa",
        "timeout_seconds":600,
        "dangling_timeout_seconds":600,
        "retry_time_seconds":1,
        "execution_mode":"eager"
    },
    "coordinator":{
        "endpoint":null,
        "service_port":63800,
        "monitor":false,
        "monitor_port":9090,
        "deployment_name":null,
        "node_selector":null,
        "resource":{
            "requests":{
                "cpu":0.5,
                "memory":"512Mi"
            },
            "limits":null
        },
        "operator_mode":false
    },
    "vineyard":{
        "socket":null,
        "rpc_port":9600,
        "deployment_name":null,
        "image":"vineyardcloudnative/vineyardd:latest",
        "resource":{
            "requests":{
                "cpu":0.2,
                "memory":"256Mi"
            },
            "limits":null
        }
    },
    "hosts_launcher":{
        "hosts":[
            "localhost"
        ],
        "etcd":{
            "endpoint":null,
            "listening_client_port":2379,
            "listening_peer_port":2380,
            "replicas":1
        },
        "dataset_download_retries":3
    },
    "kubernetes_launcher":{
        "namespace":null,
        "delete_namespace":false,
        "config_file":null,
        "deployment_mode":"eager",
        "service_type":"NodePort",
        "volumes":null,
        "waiting_for_delete":false,
        "image":{
            "registry":"registry.cn-hongkong.aliyuncs.com",
            "repository":"graphscope",
            "tag":"0.26.0",
            "pull_secrets":[

            ],
            "pull_policy":"IfNotPresent"
        },
        "engine":{
            "enabled_engines":"interactive",
            "node_selector":null,
            "enable_gae":false,
            "enable_gae_java":false,
            "enable_gie":false,
            "enable_gle":false,
            "preemptive":true,
            "gae_resource":{
                "requests":{
                    "cpu":1,
                    "memory":"4Gi"
                },
                "limits":null
            },
            "gie_executor_resource":{
                "requests":{
                    "cpu":1,
                    "memory":"2Gi"
                },
                "limits":null
            },
            "gie_frontend_resource":{
                "requests":{
                    "cpu":0.5,
                    "memory":"1Gi"
                },
                "limits":null
            },
            "gle_resource":{
                "requests":{
                    "cpu":0.2,
                    "memory":"1Gi"
                },
                "limits":null
            }
        },
        "dataset":{
            "enable":false,
            "proxy":null
        },
        "mars":{
            "enable":false,
            "worker_resource":{
                "requests":{
                    "cpu":0.2,
                    "memory":"4Mi"
                },
                "limits":null
            },
            "scheduler_resource":{
                "requests":{
                    "cpu":0.2,
                    "memory":"4Mi"
                },
                "limits":null
            }
        }
    },
    "operator_launcher":{
        "namespace":"default",
        "gae_endpoint":"",
        "hosts":[

        ]
    }
}

Environment (please complete the following information):

siyuan0322 commented 11 months ago

If you take a look at the constructor of Session, you can see it takes a Config object, which you could highly customized via config = Config(); config.coordinator.monitor_port=9900. The detailed configurable items are in python/config.py

JackyYangPassion commented 11 months ago

Thanks for the reply. The setting was successful!

>>> from graphscope.Config import Config
>>> config = Config()
>>> config.coordinator.monitor=true
>>>  sess = graphscope.session( cluster_type='hosts',
                           enabled_engines='interactive',
                           vineyard_shared_mem='1Gi',
                           num_workers=1,
                           config=config)
JackyYangPassion commented 11 months ago

but the coordinator indicator collection did not take effect.

get gscoordinator metrics curl http://localhost:9090/metrics

error log curl: (7) Failed to connect to localhost port 9090 after 4 ms: Connection refused

coordinator config

"coordinator":{
        "endpoint":null,
        "service_port":63800,
        "monitor":true,
        "monitor_port":9090,
        "deployment_name":null,
        "node_selector":null,
        "resource":{
            "requests":{
                "cpu":0.5,
                "memory":"512Mi"
            },
            "limits":null
        },
        "operator_mode":false
    },
siyuan0322 commented 11 months ago

Sorry, please wait a moment and I'll have a try with that.

JackyYangPassion commented 11 months ago

with this PR i can't find the coordinator monitor.tartServer in the master branch

JackyYangPassion commented 11 months ago

after fix curl http://localhost:9090/metrics

result

# HELP session_state The session's state: 1 stands for connected or 0 stands for closed
# TYPE session_state gauge
session_state 1.0
# HELP analytical_request_total Count requests of analytical requests
# TYPE analytical_request_total counter
analytical_request_total 1.0
# HELP analytical_request_created Count requests of analytical requests
# TYPE analytical_request_created gauge
analytical_request_created 1.7023624177342794e+09
# HELP interactive_request_total Count requests of interactive requests
# TYPE interactive_request_total counter
interactive_request_total 0.0
# HELP interactive_request_created Count requests of interactive requests
# TYPE interactive_request_created gauge
interactive_request_created 1.7023624177342966e+09
# HELP interactive_request_time The interactive operation task time
# TYPE interactive_request_time gauge
# HELP analytical_request_time The analytical operation task time
# TYPE analytical_request_time gauge
analytical_request_time{op_name="GET_ENGINE_CONFIG"} 0.018267679999553366 1702362431023