From: Kefu Chai Date: Fri, 9 Jul 2021 03:04:04 +0000 (+0800) Subject: cmake: install mgr module separately X-Git-Tag: v17.1.0~1313^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dfd3deb5b22dd49b887d6fa41cad0c1ebc525ebf;p=ceph.git cmake: install mgr module separately instead of installing the whole directory, install mgr modules individually, so it's more clear that what EXCLUDE pattern is used in which mgr module. this improves the maintability and readability. in future, we should only install the artifacts. with this change, we can specify the include pattern only for dashboard mgr module so that, for instance, only .js, .html and .css files are installed. Signed-off-by: Kefu Chai --- diff --git a/src/pybind/mgr/CMakeLists.txt b/src/pybind/mgr/CMakeLists.txt index b68daf92589..0852adb79e6 100644 --- a/src/pybind/mgr/CMakeLists.txt +++ b/src/pybind/mgr/CMakeLists.txt @@ -1,6 +1,26 @@ +set(mgr_module_install_excludes + REGEX "CMakeLists.txt" EXCLUDE + REGEX "\\.gitignore" EXCLUDE + REGEX "tox.ini" EXCLUDE + REGEX "requirements.*\.txt" EXCLUDE + REGEX "constraints.*\.txt" EXCLUDE + REGEX "tests/.*" EXCLUDE) + if(WITH_MGR_DASHBOARD_FRONTEND) add_subdirectory(dashboard) endif() + +install(DIRECTORY dashboard + DESTINATION ${CEPH_INSTALL_DATADIR}/mgr + ${mgr_module_install_excludes} + REGEX "node_modules" EXCLUDE + REGEX "cypress.*" EXCLUDE + REGEX "\.coveragerc" EXCLUDE + REGEX "\.editorconfig" EXCLUDE + REGEX "\..*lintrc" EXCLUDE + REGEX "\.browserslistrc" EXCLUDE + REGEX "\.prettier*" EXCLUDE) + if(WITH_MGR_ROOK_CLIENT) add_subdirectory(rook) endif() @@ -11,23 +31,45 @@ endif() # Location needs to match default setting for mgr_module_path, currently: # OPTION(mgr_module_path, OPT_STR, CEPH_INSTALL_DATADIR "/mgr") -install(DIRECTORY - ${CMAKE_CURRENT_SOURCE_DIR} - DESTINATION ${CEPH_INSTALL_DATADIR} - REGEX "CMakeLists.txt" EXCLUDE - REGEX "\\.gitignore" EXCLUDE - REGEX ".*\\.pyi" EXCLUDE - REGEX "hello/.*" EXCLUDE - REGEX "tests/.*" EXCLUDE - REGEX "rook/rook-client-python.*" EXCLUDE - REGEX "osd_perf_query/.*" EXCLUDE - REGEX "tox.ini" EXCLUDE - REGEX "requirements.*\.txt" EXCLUDE - REGEX "constraints.*\.txt" EXCLUDE - REGEX "node_modules" EXCLUDE - REGEX "cypress.*" EXCLUDE - REGEX "\.coveragerc" EXCLUDE - REGEX "\.editorconfig" EXCLUDE - REGEX "\..*lintrc" EXCLUDE - REGEX "\.browserslistrc" EXCLUDE - REGEX "\.prettier*" EXCLUDE) +set(mgr_modules + alerts + balancer + cephadm + crash + # dashboard (optional) + devicehealth + diskprediction_local + # hello is an example for developers, not for user + influx + insights + iostat + k8sevents + localpool + mds_autoscaler + mirroring + nfs + orchestrator + osd_perf_query + osd_support + pg_autoscaler + progress + prometheus + rbd_support + restful + # rook (optional) + selftest + snap_schedule + stats + status + telegraf + telemetry + # tests (for testing purpose only) + test_orchestrator + volumes + zabbix) + +install(DIRECTORY ${mgr_modules} + DESTINATION ${CEPH_INSTALL_DATADIR}/mgr + ${mgr_module_install_excludes}) +install(FILES mgr_module.py mgr_util.py + DESTINATION ${CEPH_INSTALL_DATADIR}/mgr) diff --git a/src/pybind/mgr/rook/CMakeLists.txt b/src/pybind/mgr/rook/CMakeLists.txt index 206e165e689..79e4e9a2eb5 100644 --- a/src/pybind/mgr/rook/CMakeLists.txt +++ b/src/pybind/mgr/rook/CMakeLists.txt @@ -13,3 +13,8 @@ ExternalProject_Add(mgr-rook-client INSTALL_COMMAND "") add_dependencies(ceph-mgr mgr-rook-client) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DESTINATION ${CEPH_INSTALL_DATADIR}/mgr + ${mgr_module_install_excludes} + REGEX "rook-client-python.*" EXCLUDE)