diff --git a/.github/workflows/hqps-db-ci.yml b/.github/workflows/hqps-db-ci.yml index a211350a379a..f74ca8224634 100644 --- a/.github/workflows/hqps-db-ci.yml +++ b/.github/workflows/hqps-db-ci.yml @@ -92,6 +92,8 @@ jobs: mkdir -p ${INTERACTIVE_WORKSPACE}/data/ldbc GRAPH_SCHEMA_YAML=${GS_TEST_DIR}/flex/ldbc-sf01-long-date/audit_graph_schema.yaml cp ${GRAPH_SCHEMA_YAML} ${INTERACTIVE_WORKSPACE}/data/ldbc/graph.yaml + mkdir -p ${INTERACTIVE_WORKSPACE}/data/movies + cp ${GS_TEST_DIR}/flex/movies/movies_schema.yaml ${INTERACTIVE_WORKSPACE}/data/movies/graph.yaml - name: Sample Query test env: @@ -133,18 +135,17 @@ jobs: done # test movie graph, 8,9,10 are not supported now - cp ${GS_TEST_DIR}/flex/movies/movies_schema.yaml ${INTERACTIVE_WORKSPACE}/data/ldbc/graph.yaml for i in 1 2 3 4 5 6 7 11 12 13 14 15; do cmd="./load_plan_and_gen.sh -e=hqps -i=../tests/hqps/queries/movie/query${i}.cypher -w=/tmp/codgen/" cmd=${cmd}" -o=/tmp/plugin --ir_conf=${GS_TEST_DIR}/flex/ldbc-sf01-long-date/engine_config.yaml " - cmd=${cmd}" --graph_schema_path=${GS_TEST_DIR}/flex/movies/movies_schema.yaml" + cmd=${cmd}" --graph_schema_path=${INTERACTIVE_WORKSPACE}/data/movies/graph.yaml" cmd=${cmd}" --gie_home=${GIE_HOME}" echo $cmd eval ${cmd} done - - name: Run End-to-End cypher adhoc query test + - name: Run End-to-End cypher adhoc ldbc query test env: GS_TEST_DIR: ${{ github.workspace }}/gstest HOME : /home/graphscope/ @@ -153,5 +154,19 @@ jobs: cd ${GITHUB_WORKSPACE}/flex/tests/hqps/ export FLEX_DATA_DIR=${GS_TEST_DIR}/flex/ldbc-sf01-long-date export ENGINE_TYPE=hiactor - bash hqps_cypher_test.sh ${GS_TEST_DIR} ${INTERACTIVE_WORKSPACE} + bash hqps_cypher_test.sh ${INTERACTIVE_WORKSPACE} ldbc ${GS_TEST_DIR}/flex/ldbc-sf01-long-date/audit_bulk_load.yaml \ + ${GS_TEST_DIR}/flex/ldbc-sf01-long-date/engine_config.yaml + + - name: Run End-to-End cypher adhoc movie query test + env: + GS_TEST_DIR: ${{ github.workspace }}/gstest + HOME : /home/graphscope/ + INTERACTIVE_WORKSPACE: /tmp/interactive_workspace + run: | + cd ${GITHUB_WORKSPACE}/flex/tests/hqps/ + export FLEX_DATA_DIR=../../interactive/examples/movies/ + export ENGINE_TYPE=hiactor + bash hqps_cypher_test.sh ${INTERACTIVE_WORKSPACE} movies ${GS_TEST_DIR}/flex/movies/movies_import.yaml \ + ${GS_TEST_DIR}/flex/ldbc-sf01-long-date/engine_config.yaml + diff --git a/flex/tests/hqps/hqps_cypher_test.sh b/flex/tests/hqps/hqps_cypher_test.sh index 0d2798b48037..a942d05cb730 100644 --- a/flex/tests/hqps/hqps_cypher_test.sh +++ b/flex/tests/hqps/hqps_cypher_test.sh @@ -19,46 +19,50 @@ SERVER_BIN=${FLEX_HOME}/build/bin/sync_server GIE_HOME=${FLEX_HOME}/../interactive_engine/ # -if [ $# -lt 2 ]; then - echo "only receives: $# args, need 2" - echo "Usage: $0 " +if [ $# -neq 4 ]; then + echo "only receives: $# args, need 4" + echo "Usage: $0 " exit 1 fi -GS_TEST_DIR=$1 -INTERACTIVE_WORKSPACE=$2 -if [ ! -d ${GS_TEST_DIR} ]; then - echo "GS_TEST_DIR: ${GS_TEST_DIR} not exists" - exit 1 -fi +INTERACTIVE_WORKSPACE=$1 +GRAPH_NAME=$2 +GRAPH_BULK_LOAD_YAML=$3 +ENGINE_CONFIG_PATH=$4 if [ ! -d ${INTERACTIVE_WORKSPACE} ]; then echo "INTERACTIVE_WORKSPACE: ${INTERACTIVE_WORKSPACE} not exists" exit 1 fi - -ENGINE_CONFIG_PATH=${GS_TEST_DIR}/flex/ldbc-sf01-long-date/engine_config.yaml -GRAPH_SCHEMA_YAML=${INTERACTIVE_WORKSPACE}/data/ldbc/graph.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/audit_graph_schema.yaml -GRAPH_CSR_DATA_DIR=${HOME}/csr-data-dir/ -# check if GRAPH_SCHEMA_YAML exists -if [ ! -f ${GRAPH_SCHEMA_YAML} ]; then - echo "GRAPH_SCHEMA_YAML: ${GRAPH_SCHEMA_YAML} not found" +# check graph is ldbc or movies +if [ ${GRAPH_NAME} != "ldbc" ] && [ ${GRAPH_NAME} != "movies" ]; then + echo "GRAPH_NAME: ${GRAPH_NAME} not supported, use movies or ldbc" + exit 1 +fi +if [ ! -d ${INTERACTIVE_WORKSPACE}/data/${GRAPH_NAME} ]; then + echo "GRAPH: ${GRAPH_NAME} not exists" + exit 1 +fi +if [ ! -f ${INTERACTIVE_WORKSPACE}/data/${GRAPH_NAME}/graph.yaml ]; then + echo "GRAPH_SCHEMA_FILE: ${BULK_LOAD_FILE} not exists" exit 1 fi - -# check if GRAPH_BULK_LOAD_YAML exists if [ ! -f ${GRAPH_BULK_LOAD_YAML} ]; then - echo "GRAPH_BULK_LOAD_YAML: ${GRAPH_BULK_LOAD_YAML} not found" + echo "GRAPH_BULK_LOAD_YAML: ${GRAPH_BULK_LOAD_YAML} not exists" exit 1 fi - -# check if COMPILER_GRAPH_SCHEMA exists -if [ ! -f ${COMPILER_GRAPH_SCHEMA} ]; then - echo "COMPILER_GRAPH_SCHEMA: ${COMPILER_GRAPH_SCHEMA} not found" +if [ ! -f ${ENGINE_CONFIG_PATH} ]; then + echo "ENGINE_CONFIG: ${ENGINE_CONFIG_PATH} not exists" exit 1 fi +GRAPH_SCHEMA_YAML=${INTERACTIVE_WORKSPACE}/${GRAPH_NAME}/graph.yaml +GRAPH_CSR_DATA_DIR=${HOME}/csr-data-dir/ +# rm data dir if exists +if [ -d ${GRAPH_CSR_DATA_DIR} ]; then + rm -rf ${GRAPH_CSR_DATA_DIR} +fi + + RED='\033[0;31m' GREEN='\033[0;32m' NC='\033[0m' # No Color @@ -111,7 +115,7 @@ start_engine_service(){ start_compiler_service(){ echo "try to start compiler service" pushd ${GIE_HOME}/compiler - cmd="make run graph.schema=${COMPILER_GRAPH_SCHEMA} config.path=${ENGINE_CONFIG_PATH}" + cmd="make run graph.schema=${GRAPH_SCHEMA_YAML} config.path=${ENGINE_CONFIG_PATH}" echo "Start compiler service with command: ${cmd}" ${cmd} & sleep 5 @@ -154,13 +158,14 @@ run_movie_test(){ kill_service start_engine_service start_compiler_service -run_ldbc_test -run_simple_test -kill_service -start_engine_service -start_compiler_service -# test on movie graph -run_movie_test +# if GRAPH_NAME equals ldbc +if [ "${GRAPH_NAME}" == "ldbc" ]; then + run_ldbc_test + run_simple_test +else + run_movie_test +fi + kill_service