]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: install mgr module separately
authorKefu Chai <kchai@redhat.com>
Fri, 9 Jul 2021 03:04:04 +0000 (11:04 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 22 Jul 2021 05:44:34 +0000 (13:44 +0800)
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 <kchai@redhat.com>
src/pybind/mgr/CMakeLists.txt
src/pybind/mgr/rook/CMakeLists.txt

index b68daf925892ae09d5c250c86c3d88108f74c85d..0852adb79e64cf78e81726012fece7a25a7ad277 100644 (file)
@@ -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)
index 206e165e6890beced152309e59a583d937f5a960..79e4e9a2eb5b0c708e6ec9d8f7c082a8c7c453ff 100644 (file)
@@ -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)