Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(interactive): Implement admin http service for hqps engine #3322

Merged
merged 30 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
30955c5
prob
zhanglei1949 Sep 18, 2023
6047318
fix
zhanglei1949 Nov 17, 2023
fd7e1ab
Merge remote-tracking branch 'upstream/main' into new_interface
zhanglei1949 Nov 17, 2023
2b779b4
fix CI
zhanglei1949 Nov 22, 2023
5e6751e
debug
zhanglei1949 Nov 23, 2023
b940af9
Merge branch 'main' into new_interface
zhanglei1949 Nov 23, 2023
b7534fa
refactor
zhanglei1949 Nov 23, 2023
1fcd946
Merge branch 'new_interface' of https://github.com/zhanglei1949/Graph…
zhanglei1949 Nov 23, 2023
9539d44
fix
zhanglei1949 Nov 23, 2023
8c72793
0.0.6 -> 0.0.7
zhanglei1949 Nov 23, 2023
12b21e5
Merge branch 'main' into new_interface
zhanglei1949 Nov 23, 2023
ec8c29b
add impl
zhanglei1949 Nov 24, 2023
21851ed
Merge branch 'new_interface' of https://github.com/zhanglei1949/Graph…
zhanglei1949 Nov 24, 2023
e954eaf
Merge branch 'main' into new_interface
zhanglei1949 Nov 24, 2023
61dde74
refactor
zhanglei1949 Nov 24, 2023
1f292e8
Merge branch 'new_interface' of https://github.com/zhanglei1949/Graph…
zhanglei1949 Nov 24, 2023
c32aff8
test
zhanglei1949 Nov 24, 2023
df04ad4
fix
zhanglei1949 Nov 24, 2023
b13ba57
use nlohmann json as submodule
zhanglei1949 Nov 24, 2023
2785cf3
fix CI
zhanglei1949 Nov 27, 2023
615b558
minor
zhanglei1949 Nov 27, 2023
ff6b4fb
use close() and open() rather than loadFromDataDirectory
zhanglei1949 Nov 27, 2023
b2dd3b0
minor change dockerfile
zhanglei1949 Nov 27, 2023
52e660f
update doc
zhanglei1949 Nov 27, 2023
c6246b1
update doc
zhanglei1949 Nov 27, 2023
3754c9b
udpate doc
zhanglei1949 Nov 27, 2023
90fdf0a
minor update doc
zhanglei1949 Nov 27, 2023
d5b5739
minor code refactor
zhanglei1949 Nov 27, 2023
a63e1c4
fix flex.yaml
zhanglei1949 Nov 27, 2023
b3f8758
fixing CI
zhanglei1949 Nov 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/flex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-20.04
if: ${{ github.repository == 'alibaba/GraphScope' }}
container:
image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.6
image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.8
steps:
- uses: actions/checkout@v3

Expand All @@ -44,6 +44,8 @@ jobs:
env:
HOME: /home/graphscope/
run: |
cd ${GITHUB_WORKSPACE}/
git submodule update --init
cd ${GITHUB_WORKSPACE}/flex
mkdir build && cd build
cmake .. && sudo make -j$(nproc)
Expand Down Expand Up @@ -74,10 +76,10 @@ jobs:
GLOG_v=10 ./bin/graph_loader ${SCHEMA_FILE} ${BULK_LOAD_FILE} /tmp/csr-data-dir/

- name: Test Graph Loading on type_test graph
env:
env:
GS_TEST_DIR: ${{ github.workspace }}/gstest/
FLEX_DATA_DIR: ${{ github.workspace }}/gstest/flex/type_test/
run: |
run: |
# remove modern graph indices
rm -rf /tmp/csr-data-dir/

Expand Down
51 changes: 34 additions & 17 deletions .github/workflows/hqps-db-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ubuntu-20.04
if: ${{ github.repository == 'alibaba/GraphScope' }}
container:
image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.6
image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.8
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -68,6 +68,8 @@ jobs:
GIE_HOME: ${{ github.workspace }}/interactive_engine/
HOME: /home/graphscope/
run: |
cd ${GITHUB_WORKSPACE}/
git submodule update --init
cd ${GITHUB_WORKSPACE}/flex
mkdir build && cd build
cmake .. && sudo make -j$(nproc)
Expand All @@ -90,9 +92,27 @@ jobs:
git clone -b master --single-branch --depth=1 https://github.com/GraphScope/gstest.git ${GS_TEST_DIR}
mkdir -p ${INTERACTIVE_WORKSPACE}/data/ldbc
GRAPH_SCHEMA_YAML=${GS_TEST_DIR}/flex/ldbc-sf01-long-date/audit_graph_schema.yaml
BUILD_LOAD_FILE=${GS_TEST_DIR}/flex/ldbc-sf01-long-date/audit_bulk_load.yaml
cp ${GRAPH_SCHEMA_YAML} ${INTERACTIVE_WORKSPACE}/data/ldbc/graph.yaml
cp ${BUILD_LOAD_FILE} ${INTERACTIVE_WORKSPACE}/data/ldbc/import.yaml
mkdir -p ${INTERACTIVE_WORKSPACE}/data/movies
cp ${GS_TEST_DIR}/flex/movies/movies_schema.yaml ${INTERACTIVE_WORKSPACE}/data/movies/graph.yaml
cp ${GS_TEST_DIR}/flex/movies/movies_import.yaml ${INTERACTIVE_WORKSPACE}/data/movies/import.yaml

# load graph
cd ${GITHUB_WORKSPACE}/flex/build
export FLEX_DATA_DIR=${GS_TEST_DIR}/flex/ldbc-sf01-long-date
GLOG_v=10 ./bin/graph_loader ${INTERACTIVE_WORKSPACE}/data/ldbc/graph.yaml ${INTERACTIVE_WORKSPACE}/data/ldbc/import.yaml ${INTERACTIVE_WORKSPACE}/data/ldbc/indices/
export FLEX_DATA_DIR=../interactive/examples/movies
GLOG_v=10 ./bin/graph_loader ${INTERACTIVE_WORKSPACE}/data/movies/graph.yaml ${INTERACTIVE_WORKSPACE}/data/movies/import.yaml ${INTERACTIVE_WORKSPACE}/data/movies/indices/

- name: Test HQPS admin http service
env:
GS_TEST_DIR: ${{ github.workspace }}/gstest
FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph
run:
cd ${GITHUB_WORKSPACE}/flex/tests/hqps
bash hqps_admin_test.sh /tmp/temp_workspace ./engine_config_test.yaml ${GS_TEST_DIR}

- name: Sample Query test
env:
Expand All @@ -110,13 +130,12 @@ jobs:
HOME : /home/graphscope/
INTERACTIVE_WORKSPACE: /tmp/interactive_workspace
run: |
GIE_HOME=${GITHUB_WORKSPACE}/interactive_engine
cd ${GITHUB_WORKSPACE}/flex/bin

for i in 1 2 3 4 5 6 7 8 9 10 11 12;
do
cmd="./load_plan_and_gen.sh -e=hqps -i=../resources/queries/ic/adhoc/ic${i}_adhoc.cypher -w=/tmp/codgen/"
cmd=${cmd}" -o=/tmp/plugin --ir_conf=${GS_TEST_DIR}/flex/ldbc-sf01-long-date/engine_config.yaml "
cmd=${cmd}" -o=/tmp/plugin --ir_conf=../tests/hqps/engine_config_test.yaml "
cmd=${cmd}" --graph_schema_path=${INTERACTIVE_WORKSPACE}/data/ldbc/graph.yaml"
echo $cmd
eval ${cmd}
Expand All @@ -125,19 +144,19 @@ jobs:
for i in 1 2 3 4 5 6 7 8 9 10 11 12;
do
cmd="./load_plan_and_gen.sh -e=hqps -i=../resources/queries/ic/adhoc/simple_match_${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}" -o=/tmp/plugin --ir_conf=../tests/hqps/engine_config_test.yaml "
cmd=${cmd}" --graph_schema_path=${INTERACTIVE_WORKSPACE}/data/ldbc/graph.yaml"
echo $cmd
eval ${cmd}
done

# test movie graph, 8,9,10 are not supported now
# change the default_graph config in ${GS_TEST_DIR}/flex/ldbc-sf01-long-date/engine_config.yaml to movies
sed -i 's/default_graph: ldbc/default_graph: movies/g' ${GS_TEST_DIR}/flex/ldbc-sf01-long-date/engine_config.yaml
# change the default_graph config in ../tests/hqps/engine_config_test.yaml to movies
sed -i 's/default_graph: ldbc/default_graph: movies/g' ../tests/hqps/engine_config_test.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}" -o=/tmp/plugin --ir_conf=../tests/hqps/engine_config_test.yaml "
cmd=${cmd}" --graph_schema_path=${INTERACTIVE_WORKSPACE}/data/movies/graph.yaml"
echo $cmd
eval ${cmd}
Expand All @@ -150,12 +169,11 @@ jobs:
INTERACTIVE_WORKSPACE: /tmp/interactive_workspace
run: |
cd ${GITHUB_WORKSPACE}/flex/tests/hqps/
export FLEX_DATA_DIR=${GS_TEST_DIR}/flex/ldbc-sf01-long-date
export ENGINE_TYPE=hiactor
# change the default_graph config in ${GS_TEST_DIR}/flex/ldbc-sf01-long-date/engine_config.yaml to ldbc
sed -i 's/default_graph: movies/default_graph: ldbc/g' ${GS_TEST_DIR}/flex/ldbc-sf01-long-date/engine_config.yaml
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
# change the default_graph config in ./engine_config_test.yaml to ldbc
sed -i 's/default_graph: movies/default_graph: ldbc/g' ./engine_config_test.yaml
bash hqps_cypher_test.sh ${INTERACTIVE_WORKSPACE} ldbc \
${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml

- name: Run End-to-End cypher adhoc movie query test
env:
Expand All @@ -164,11 +182,10 @@ jobs:
INTERACTIVE_WORKSPACE: /tmp/interactive_workspace
run: |
cd ${GITHUB_WORKSPACE}/flex/tests/hqps/
export FLEX_DATA_DIR=../../interactive/examples/movies/
export ENGINE_TYPE=hiactor
# change the default_graph config in ${GS_TEST_DIR}/flex/ldbc-sf01-long-date/engine_config.yaml to movies
sed -i 's/default_graph: ldbc/default_graph: movies/g' ${GS_TEST_DIR}/flex/ldbc-sf01-long-date/engine_config.yaml
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
# change the default_graph config in ./engine_config_test.yaml to movies
sed -i 's/default_graph: ldbc/default_graph: movies/g' ./engine_config_test.yaml
bash hqps_cypher_test.sh ${INTERACTIVE_WORKSPACE} movies \
${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml


4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
[submodule "learning_engine/graphlearn-for-pytorch"]
path = learning_engine/graphlearn-for-pytorch
url = https://github.com/alibaba/graphlearn-for-pytorch.git

[submodule "flex/third_party/nlohmann-json"]
path = flex/third_party/nlohmann-json
url = https://github.com/nlohmann/json.git
7 changes: 7 additions & 0 deletions docs/flex/interactive/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ compiler:
- FilterIntoJoinRule
- NotExistToAntiJoinRule
query_timeout: 20000 # query timeout in milliseconds, default 20000
http_service:
default_listen_address: localhost
admin_port: 7777
query_port: 10000
```


Expand All @@ -65,5 +69,8 @@ In this following table, we use the `.` notation to represent the hierarchy with
| compiler.planner.rules.FilterMatchRule | N/A | An optimization rule that pushes filter (`Where`) conditions into the `Match` clause | 0.0.1 |
| compiler.planner.rules.FilterIntoJoinRule | N/A | A native Calcite optimization rule that pushes filter conditions to the Join participants before performing the join | 0.0.1 |
| compiler.planner.rules.NotMatchToAntiJoinRule | N/A | An optimization rule that transforms a "not exist" pattern into an anti-join operation | 0.0.1 |
| http_service.default_listen_address | localhost | The address for http service to bind | 0.0.2 |
| http_service.admin_port | 7777 | The port for admin service to listen on | 0.0.2 |
| http_service.query_port | 10000 | The port for query service to listen on, for stored procedure queries, user can directory submit queries to query_port without compiler involved | 0.0.2 |


2 changes: 2 additions & 0 deletions docs/flex/interactive/dev_guide.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# GraphScope Interactive Development guide

Users can develop C++ stored procedures and Cypher stored procedures based on `GraphScope Interactive`.
Interactive also provides an Admin Service for managing graph data and stored procedures at runtime, and it can also retrieve the running status of the service.

```{toctree} arguments
---
Expand All @@ -9,4 +10,5 @@ maxdepth: 2
---
development/cypher_procedure
development/cpp_procedure
development/admin_service
```