diff --git a/flex/bin/load_plan_and_gen.sh b/flex/bin/load_plan_and_gen.sh index aac1920a122f..82afed3aaeaf 100755 --- a/flex/bin/load_plan_and_gen.sh +++ b/flex/bin/load_plan_and_gen.sh @@ -534,7 +534,11 @@ run() { # if engine_type equals hqps if [ ${ENGINE_TYPE} == "hqps" ]; then echo "Engine type is hqps, generating dynamic library for hqps engine." - compile_hqps_so ${INPUT} ${WORK_DIR} ${IR_CONF} ${GRAPH_SCHEMA_PATH} ${GIE_HOME} ${OUTPUT_DIR} ${PROCEDURE_NAME} \"${PROCEDURE_DESCRIPTION}\" + # if PROCEDURE_DESCRIPTION is not set, use empty string + if [ ! -z ${PROCEDURE_DESCRIPTION} ]; then + PROCEDURE_DESCRIPTION=\"${PROCEDURE_DESCRIPTION}\" + fi + compile_hqps_so ${INPUT} ${WORK_DIR} ${IR_CONF} ${GRAPH_SCHEMA_PATH} ${GIE_HOME} ${OUTPUT_DIR} ${PROCEDURE_NAME} ${PROCEDURE_DESCRIPTION} # else if engine_type equals pegasus elif [ ${ENGINE_TYPE} == "pegasus" ]; then diff --git a/flex/interactive/README.md b/flex/interactive/README.md index 7ef98ec46501..7713349e6142 100755 --- a/flex/interactive/README.md +++ b/flex/interactive/README.md @@ -2,3 +2,62 @@ GraphScope Interactive is a specialized construction of [GraphScope Flex](https://github.com/alibaba/GraphScope/tree/main/flex), designed to handle concurrent graph queries at an impressive speed. Its primary goal is to process as many queries as possible within a given timeframe, emphasizing a high query throughput rate. For the full documentation of GraphScope Interactive, please refer to [GraphScope-Interactive](https://graphscope.io/docs/interactive_engine/graphscope_interactive). + +## Minimal tutorial + +In this minimal tutorial, we will show you how to run graph service on builtin modern graph. + +### Preparation + +Set `location` to `/home/graphscope/default_graph`. + +### init database + +```bash +./bin/gs_interactive init -c ./conf/interactive.yaml +``` + +### Start service + +```bash +./bin/gs_interactive service start +``` + +### Stop service +```bash +./bin/gs_interactive service stop +``` + +### Restart service +```bash +./bin/gs_interactive service restart +``` + +### Get service status +```bash +./bin/gs_interactive service status +``` + +### Compile stored procedure +```bash +./bin/gs_interactive procedure compile -g modern -i ./examples/modern_graph/count_vertex_num.cypher +``` + +### Disable stored procedure +```bash +./bin/gs_interactive procedure disable -g modern -n count_vertex_num +``` + +### Enable stored procedure +```bash +./bin/gs_interactive procedure enable -g modern -n count_vertex_num +``` + +### Use user defined graph +```bash +./bin/gs_interactive service stop +./bin/gs_interactive database remove -g modern +./bin/gs_interactive database create -g test -c ./examples/modern_graph/modern_graph.yaml +./bin/gs_interactive database import -g test -c ./examples/modern_graph/bulk_load.yaml +./bin/gs_interactive service start -g test +``` \ No newline at end of file diff --git a/flex/interactive/bin/gs_interactive b/flex/interactive/bin/gs_interactive index 5fc9a6ea69bb..47c1aa8b2164 100755 --- a/flex/interactive/bin/gs_interactive +++ b/flex/interactive/bin/gs_interactive @@ -31,7 +31,7 @@ info() { ################## Some Util Functions ################## -# source : https://github.com/mrbaseman/parse_yaml +# source: https://github.com/mrbaseman/parse_yaml.git function parse_yaml { local prefix=$2 local separator=${3:-_} @@ -91,8 +91,8 @@ function parse_yaml { sed -ne "s|^\($s\):|\1|" \ -e "s|^\($s\)\(---\)\($s\)||" \ -e "s|^\($s\)\(\.\.\.\)\($s\)||" \ - -e "s|^\($s\)-${s[\"']\(.*\)[\"']}$s\$|\1$fs$fs\2|p;t" \ - -e "s|^\($s\)\($w\)$s:${s[\"']\(.*\)[\"']}$s\$|\1$fs\2$fs\3|p;t" \ + -e "s|^\($s\)-$s[\"']\(.*\)[\"']$s\$|\1$fs$fs\2|p;t" \ + -e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p;t" \ -e "s|^\($s\)-$s\(.*\)$s\$|\1$fs$fs\2|" \ -e "s|^\($s\)\($w\)$s:$s[\"']\?\(.*\)$s\$|\1$fs\2$fs\3|" \ -e "s|^\($s\)[\"']\?\([^&][^$fs]\+\)[\"']$s\$|\1$fs$fs$fs\2|" \ @@ -164,6 +164,7 @@ HOST_DB_HOME="$( pwd -P )" info "HOST_DB_HOME = ${HOST_DB_HOME}" +mkdir -p "${HOST_DB_HOME}/data" ################### GET USER INFO ################### # get uid diff --git a/flex/interactive/examples/modern_graph/bulk_load.yaml b/flex/interactive/examples/modern_graph/bulk_load.yaml index 8d9085d81aca..b1647ff4a294 100644 --- a/flex/interactive/examples/modern_graph/bulk_load.yaml +++ b/flex/interactive/examples/modern_graph/bulk_load.yaml @@ -2,7 +2,7 @@ graph: modern loading_config: data_source: scheme: file # file, oss, s3, hdfs; only file is supported now - # location: # specify it or use FLEX_DATA_DIR env. + # location: /home/graphscope/default_graph/ import_option: init # append, overwrite, only init is supported now format: type: csv diff --git a/flex/tests/hqps/hqps_cypher_test.sh b/flex/tests/hqps/hqps_cypher_test.sh index 5696a898f350..b06a70cc69d5 100644 --- a/flex/tests/hqps/hqps_cypher_test.sh +++ b/flex/tests/hqps/hqps_cypher_test.sh @@ -31,10 +31,10 @@ if [ ! -d ${GS_TEST_DIR} ]; then exit 1 fi -GRAPH_CONFIG_PATH=${FLEX_HOME}/interactive/conf/interactive.yaml +ENGINE_CONFIG_PATH=${GS_TEST_DIR}/flex/ldbc-sf01-long-date/engine_config.yaml GRAPH_SCHEMA_YAML=${GS_TEST_DIR}/flex/ldbc-sf01-long-date/audit_graph_schema.yaml GRAPH_BULK_LOAD_YAML=${GS_TEST_DIR}/flex/ldbc-sf01-long-date/audit_bulk_load.yaml -COMPILER_GRAPH_SCHEMA=${GS_TEST_DIR}/flex/ldbc-sf01-long-date/ldbc_schema_csr_ic.json +COMPILER_GRAPH_SCHEMA=${GS_TEST_DIR}/flex/ldbc-sf01-long-date/audit_graph_schema.yaml GRAPH_CSR_DATA_DIR=${HOME}/csr-data-dir/ HQPS_IR_CONF=/tmp/hqps.ir.properties # check if GRAPH_SCHEMA_YAML exists @@ -105,9 +105,9 @@ start_engine_service(){ # export FLEX_DATA_DIR export FLEX_DATA_DIR=${GS_TEST_DIR}/flex/ldbc-sf01-long-date/ - cmd="${SERVER_BIN} -c ${GRAPH_CONFIG_PATH} -g ${GRAPH_SCHEMA_YAML} " + cmd="${SERVER_BIN} -c ${ENGINE_CONFIG_PATH} -g ${GRAPH_SCHEMA_YAML} " cmd="${cmd} --data-path ${GRAPH_CSR_DATA_DIR} -l ${GRAPH_BULK_LOAD_YAML} " - cmd="${cmd} -i ${HQPS_IR_CONF} -z ${COMPILER_GRAPH_SCHEMA} --gie-home ${GIE_HOME}" + cmd="${cmd} --gie-home ${GIE_HOME}" echo "Start engine service with command: ${cmd}" ${cmd} & @@ -126,6 +126,8 @@ start_compiler_service(){ echo "Start compiler service with command: ${cmd}" ${cmd} & sleep 5 + # check if Graph Server is running, if not exist + ps -ef | grep "com.alibaba.graphscope.GraphServer" | grep -v grep info "Start compiler service success" popd } @@ -154,7 +156,7 @@ kill_service create_ir_conf start_engine_service start_compiler_service -run_ldbc_test +#run_ldbc_test run_simple_test kill_service diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/meta/schema/Utils.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/meta/schema/Utils.java index 58990d564689..8a8db3f2c814 100644 --- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/meta/schema/Utils.java +++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/meta/schema/Utils.java @@ -86,17 +86,19 @@ public static final void builderGraphElementFromYaml( "type_id not exist in yaml config"); List propertyList = Lists.newArrayList(); List propertyNodes = (List) elementMap.get("properties"); - for (Object property : propertyNodes) { - if (property instanceof Map) { - Map propertyMap = (Map) property; - String propertyName = (String) propertyMap.get("property_name"); - int propertyId = (int) propertyMap.get("property_id"); - propNameToIdMap.put(propertyName, propertyId); - propertyList.add( - new DefaultGraphProperty( - propertyId, - propertyName, - toDataType(propertyMap.get("property_type")))); + if (propertyNodes != null) { + for (Object property : propertyNodes) { + if (property instanceof Map) { + Map propertyMap = (Map) property; + String propertyName = (String) propertyMap.get("property_name"); + int propertyId = (int) propertyMap.get("property_id"); + propNameToIdMap.put(propertyName, propertyId); + propertyList.add( + new DefaultGraphProperty( + propertyId, + propertyName, + toDataType(propertyMap.get("property_type")))); + } } } List primaryKeyNodes = (List) elementMap.get("primary_keys");