Skip to content

Commit

Permalink
refactor(interactive): Reduce the size of codegen library (#4118)
Browse files Browse the repository at this point in the history
Currently, Interactive's gremlin tests utilize the codegen and
compilation stack, generating a dynamic library for each query.
Executing many queries consumes significant disk space.
  • Loading branch information
zhanglei1949 authored Aug 8, 2024
1 parent 1a31576 commit 32cfcf4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/interactive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ jobs:
#set back
sed -i 's/default_graph: graph_algo/default_graph: ldbc/g' ../tests/hqps/engine_config_test.yaml
rm -rf /tmp/codegen
- name: Test cypher&cpp procedure generation and loading
env:
Expand Down
6 changes: 6 additions & 0 deletions flex/bin/load_plan_and_gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,12 @@ compile_hqps_so() {
info "Finish building, output to ${output_so_path}"
popd

# strip the output_so_path
strip ${output_so_path}
# clean the cmake directory, the cmake files may take up a lot of space
cmd="rm -rf ${cur_dir}/CMakeFiles"
eval ${cmd}

################### now copy ##########################
# if dst_so_path eq output_so_path, skip copying.
if [ ${dst_so_path} == ${output_so_path} ]; then
Expand Down
2 changes: 1 addition & 1 deletion flex/resources/hqps/CMakeLists.txt.template
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if(EXISTS "/opt/graphscope/include")
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -Wl,-rpath,$ORIGIN -O0 -flto -Werror=unused-result -fPIC -no-pie")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -Wl,-rpath,$ORIGIN -O2 -flto -Werror=unused-result -fPIC -no-pie")

add_library(${QUERY_NAME} SHARED ${PROJECT_SOURCE_DIR}/${QUERY_NAME}.cc)
target_include_directories(${QUERY_NAME} PUBLIC ${FLEX_INCLUDE_PREFIX} ${FLEX_INCLUDE_PREFIX}/flex/build/engines/hqps_db/)
Expand Down
1 change: 1 addition & 0 deletions flex/tests/hqps/hqps_adhoc_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ run_cypher_test(){
else
echo "GRAPH_NAME: ${GRAPH_NAME} not supported, use movies, ldbc or graph_algo"
fi
rm -rf /tmp/neo4j-* || true
}


Expand Down
6 changes: 3 additions & 3 deletions k8s/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ interactive-experimental:
flex-interactive:
cd $(WORKING_DIR)/.. && \
docker build \
-f ${DOCKERFILES_DIR}/flex-interactive.Dockerfile \
--target runtime \
--build-arg ENABLE_COORDINATOR=${ENABLE_COORDINATOR} \
--build-arg REGISTRY=$(REGISTRY) \
--build-arg BUILDER_VERSION=$(BUILDER_VERSION) \
--build-arg ARCH=${ARCH} \
--build-arg ENABLE_COORDINATOR=${ENABLE_COORDINATOR} \
-t graphscope/interactive:${VERSION} .
-t graphscope/interactive:${VERSION} \
-f ${DOCKERFILES_DIR}/flex-interactive.Dockerfile .

learning:
cd $(WORKING_DIR)/.. && \
Expand Down
2 changes: 1 addition & 1 deletion k8s/dockerfiles/flex-interactive.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

ARG REGISTRY=registry.cn-hongkong.aliyuncs.com
ARG BUILDER_VERSION=latest
FROM $REGISTRY/graphscope/graphscope-dev:$BUILDER_VERSION AS builder
ARG ARCH=x86_64
ARG ENABLE_COORDINATOR="false"
FROM $REGISTRY/graphscope/graphscope-dev:$BUILDER_VERSION AS builder

RUN sudo mkdir -p /opt/flex && sudo chown -R graphscope:graphscope /opt/flex/
USER graphscope
Expand Down

0 comments on commit 32cfcf4

Please sign in to comment.