From caa448de4a96fbb37683982a48826ea0af6de6ea Mon Sep 17 00:00:00 2001 From: dongdaxiang Date: Sun, 10 May 2020 21:27:05 +0800 Subject: [PATCH] add debugger in paddle_serving_app --- CMakeLists.txt | 11 +++++++++++ core/CMakeLists.txt | 5 +++++ core/configure/CMakeLists.txt | 10 ++++++++++ python/paddle_serving_app/__init__.py | 1 + python/setup.py.app.in | 5 ++++- 5 files changed, 31 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af065158..7c497e3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,6 +85,17 @@ include(generic) include(flags) endif() +if (APP) +include(external/zlib) +include(external/boost) +include(external/protobuf) +include(external/gflags) +include(external/glog) +include(external/pybind11) +include(external/python) +include(generic) +endif() + if (SERVER) include(external/cudnn) include(paddlepaddle) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index ce2e5e38..56296b53 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -23,6 +23,11 @@ add_subdirectory(pdcodegen) add_subdirectory(sdk-cpp) endif() +if (APP) +add_subdirectory(configure) +endif() + + if(CLIENT) add_subdirectory(general-client) endif() diff --git a/core/configure/CMakeLists.txt b/core/configure/CMakeLists.txt index b6384fc9..d3e5b75d 100644 --- a/core/configure/CMakeLists.txt +++ b/core/configure/CMakeLists.txt @@ -1,3 +1,4 @@ +if (SERVER OR CLIENT) LIST(APPEND protofiles ${CMAKE_CURRENT_LIST_DIR}/proto/server_configure.proto ${CMAKE_CURRENT_LIST_DIR}/proto/sdk_configure.proto @@ -28,6 +29,7 @@ FILE(GLOB inc ${CMAKE_CURRENT_BINARY_DIR}/*.pb.h) install(FILES ${inc} DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/include/configure) +endif() py_proto_compile(general_model_config_py_proto SRCS proto/general_model_config.proto) add_custom_target(general_model_config_py_proto_init ALL COMMAND ${CMAKE_COMMAND} -E touch __init__.py) @@ -51,6 +53,14 @@ add_custom_command(TARGET general_model_config_py_proto POST_BUILD endif() +if (APP) +add_custom_command(TARGET general_model_config_py_proto POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory ${PADDLE_SERVING_BINARY_DIR}/python/paddle_serving_app/proto + COMMAND cp *.py ${PADDLE_SERVING_BINARY_DIR}/python/paddle_serving_app/proto + COMMENT "Copy generated general_model_config proto file into directory paddle_serving_app/proto." + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +endif() + if (SERVER) py_proto_compile(server_config_py_proto SRCS proto/server_configure.proto) add_custom_target(server_config_py_proto_init ALL COMMAND ${CMAKE_COMMAND} -E touch __init__.py) diff --git a/python/paddle_serving_app/__init__.py b/python/paddle_serving_app/__init__.py index 86087603..fd926028 100644 --- a/python/paddle_serving_app/__init__.py +++ b/python/paddle_serving_app/__init__.py @@ -16,3 +16,4 @@ from .reader.image_reader import ImageReader, File2Image, URL2Image, Sequential, from .reader.lac_reader import LACReader from .reader.senta_reader import SentaReader from .models import ServingModels +from .local_predict import Debugger diff --git a/python/setup.py.app.in b/python/setup.py.app.in index d981caa7..272d4a7f 100644 --- a/python/setup.py.app.in +++ b/python/setup.py.app.in @@ -42,10 +42,11 @@ if '${PACK}' == 'ON': REQUIRED_PACKAGES = [ - 'six >= 1.10.0', 'sentencepiece' + 'six >= 1.10.0', 'sentencepiece', 'cv2', 'pillow' ] packages=['paddle_serving_app', + 'paddle_serving_app.proto', 'paddle_serving_app.reader', 'paddle_serving_app.utils', 'paddle_serving_app.models', @@ -54,6 +55,8 @@ packages=['paddle_serving_app', package_data={} package_dir={'paddle_serving_app': '${PADDLE_SERVING_BINARY_DIR}/python/paddle_serving_app', + 'paddle_serving_app.proto': + '${PADDLE_SERVING_BINARY_DIR}/python/paddle_serving_app/proto', 'paddle_serving_app.reader': '${PADDLE_SERVING_BINARY_DIR}/python/paddle_serving_app/reader', 'paddle_serving_app.utils': -- GitLab