From d38fc1ab377457dc3f7701417e7775d1c4cfe6d8 Mon Sep 17 00:00:00 2001 From: LINxiansheng Date: Fri, 1 Mar 2024 06:44:40 +0000 Subject: [PATCH] [CP] support debian package --- .gitignore | 3 + CMakeLists.txt | 56 ++- build.sh | 16 +- cmake/DEB.cmake | 61 +++ cmake/Pack.cmake | 368 +++++++++++++++++ cmake/RPM.cmake | 389 +----------------- deps/init/oceanbase.el9.aarch64.deps | 12 + deps/init/oceanbase.el9.x86_64.deps | 13 + deps/oblib/src/lib/oblog/ob_log.h | 2 +- package/deb/oceanbase-ce-build.sh | 23 ++ package/deb/oceanbase-ce-cdc-build.sh | 25 ++ .../meta_mem/ob_tenant_meta_mem_mgr.cpp | 2 +- .../runtime_utility/common_define.h | 2 +- .../tablet/ob_i_tablet_mds_interface.ipp | 2 +- src/storage/tablet/ob_tablet.cpp | 12 +- 15 files changed, 587 insertions(+), 399 deletions(-) create mode 100644 cmake/DEB.cmake create mode 100644 cmake/Pack.cmake create mode 100644 package/deb/oceanbase-ce-build.sh create mode 100644 package/deb/oceanbase-ce-cdc-build.sh diff --git a/.gitignore b/.gitignore index 67cb28874..e52ffd656 100644 --- a/.gitignore +++ b/.gitignore @@ -294,6 +294,9 @@ tools/rpm/systemd/profile/post_install.sh tools/rpm/systemd/profile/pre_uninstall.sh tools/rpm/systemd/profile/post_uninstall.sh tools/rpm/systemd/profile/telemetry.sh +tools/rpm/systemd/profile/postinst +tools/rpm/systemd/profile/prerm +tools/rpm/systemd/profile/postrm ############# unittest ############# unittest/**/test_* diff --git a/CMakeLists.txt b/CMakeLists.txt index 09068101f..1df2f20fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,9 +105,9 @@ if (ENABLE_SANITY) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_SANITY") endif() -if (OB_BUILD_RPM) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOB_BUILD_RPM") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOB_BUILD_RPM") +if (OB_BUILD_PACKAGE) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOB_BUILD_PACKAGE") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOB_BUILD_PACKAGE") endif() message(STATUS "This is BINARY dir " ${PROJECT_BINARY_DIR}) @@ -126,42 +126,42 @@ add_subdirectory(src/objit) add_subdirectory(src) include(CMakeDependentOption) -# OB_BUILD_RPM => include tools and build them. +# OB_BUILD_PACKAGE => include tools and build them. # otherwise => include tools but don't build them. option(OB_INCLUDE_TOOLS "" ON) cmake_dependent_option( OB_BUILD_TOOLS "Build tools" ON - "OB_BUILD_RPM" OFF) -# OB_BUILD_RPM => don't include unittest or build them. + "OB_BUILD_PACKAGE" OFF) +# OB_BUILD_PACKAGE => don't include unittest or build them. # otherwise => include unittest but don't build them. cmake_dependent_option( OB_INCLUDE_UNITTEST "Include unittest" ON - "NOT OB_BUILD_RPM" OFF) + "NOT OB_BUILD_PACKAGE" OFF) option(OB_BUILD_UNITTEST "" OFF) -# OB_BUILD_RPM => don't include test or build them. +# OB_BUILD_PACKAGE => don't include test or build them. # otherwise => include test but don't build them. cmake_dependent_option( OB_INCLUDE_TEST "Include test" ON - "NOT OB_BUILD_RPM" OFF) + "NOT OB_BUILD_PACKAGE" OFF) option(OB_BUILD_TEST "" OFF) -# OB_BUILD_RPM => build sql proxy parser +# OB_BUILD_PACKAGE => build sql proxy parser cmake_dependent_option( OB_BUILD_LIBOB_SQL_PROXY_PARSER "Build lib_sql_proxy_parser" OFF - "NOT OB_BUILD_RPM" ON + "NOT OB_BUILD_PACKAGE" ON ) -# OB_BUILD_RPM => build OB_BUILD_LIBOBTABLE +# OB_BUILD_PACKAGE => build OB_BUILD_LIBOBTABLE cmake_dependent_option( OB_BUILD_LIBOBTABLE "Build liboblog" OFF - "NOT OB_BUILD_RPM" ON + "NOT OB_BUILD_PACKAGE" ON ) -# OB_BUILD_RPM => build OB_BUILD_OBADMIN +# OB_BUILD_PACKAGE => build OB_BUILD_OBADMIN cmake_dependent_option( OB_BUILD_OBADMIN "Build ob_admin" OFF - "NOT OB_BUILD_RPM" ON + "NOT OB_BUILD_PACKAGE" ON ) include(CTest) @@ -191,7 +191,31 @@ elseif (OB_INCLUDE_TOOLS) add_subdirectory(tools EXCLUDE_FROM_ALL) endif() -include(cmake/RPM.cmake) +if (CMAKE_BUILD_RPM) + include(cmake/RPM.cmake) +elseif(CMAKE_BUILD_DEB) + include(cmake/DEB.cmake) +else() + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + include(FindPkgConfig) + if(PKG_CONFIG_FOUND) + execute_process( + COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=systemdsystemunitdir systemd + RESULT_VARIABLE result_var + OUTPUT_VARIABLE output_var + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if("${result_var}" STREQUAL "0" AND "${output_var}" STREQUAL "/lib/systemd/system") + include(cmake/DEB.cmake) + else() + include(cmake/RPM.cmake) + endif() + endif() + else() + message(FATAL_ERROR "Unsupported system: ${CMAKE_SYSTEM_NAME}") + endif() +endif() if(EXISTS ${CMAKE_SOURCE_DIR}/sensitive_test) message(STATUS "will add sensitive_test sub directory") diff --git a/build.sh b/build.sh index ec8f632b0..aed1edac5 100755 --- a/build.sh +++ b/build.sh @@ -143,6 +143,12 @@ function do_clean find . -maxdepth 1 -type d -name 'build_*' | grep -v 'build_ccls' | xargs rm -rf } +function build_package +{ + STATIC_LINK_LGPL_DEPS_OPTION=OFF + do_build "$@" -DOB_BUILD_PACKAGE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOB_USE_LLD=$LLD_OPTION -DENABLE_FATAL_ERROR_HANG=OFF -DENABLE_AUTO_FDO=ON -DENABLE_THIN_LTO=ON -DOB_STATIC_LINK_LGPL_DEPS=$STATIC_LINK_LGPL_DEPS_OPTION +} + # build - configurate project and prepare to compile, by calling make function build { @@ -203,8 +209,14 @@ function build do_build "$@" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_DEBUG_LOG=ON -DENABLE_OBJ_LEAK_CHECK=ON -DOB_USE_LLD=$LLD_OPTION ;; xrpm) - STATIC_LINK_LGPL_DEPS_OPTION=OFF - do_build "$@" -DOB_BUILD_RPM=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOB_USE_LLD=$LLD_OPTION -DENABLE_FATAL_ERROR_HANG=OFF -DENABLE_AUTO_FDO=ON -DENABLE_THIN_LTO=ON -DOB_STATIC_LINK_LGPL_DEPS=$STATIC_LINK_LGPL_DEPS_OPTION + build_package "$@" -DCMAKE_BUILD_RPM=ON + ;; + xdeb) + build_package "$@" -DCMAKE_BUILD_DEB=ON + ;; + xpackage) + # automatic determination of packaging type + build_package "$@" ;; xenable_smart_var_check) do_build "$@" -DCMAKE_BUILD_TYPE=Debug -DOB_USE_LLD=$LLD_OPTION -DENABLE_SMART_VAR_CHECK=ON -DOB_ENABLE_AVX2=ON diff --git a/cmake/DEB.cmake b/cmake/DEB.cmake new file mode 100644 index 000000000..dbc0db6ac --- /dev/null +++ b/cmake/DEB.cmake @@ -0,0 +1,61 @@ +set(CPACK_GENERATOR "DEB") +set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) +set(CPACK_DEB_COMPONENT_INSTALL ON) +set(CPACK_DEB_MAIN_COMPONENT "server") +set(CPACK_DEBIAN_SERVER_DEBUGINFO_PACKAGE ON) + +include(cmake/Pack.cmake) + +# rename server package name +set(CPACK_DEBIAN_SERVER_PACKAGE_NAME ${CPACK_PACKAGE_NAME}) +set(CPACK_DEBIAN_PACKAGE_RELEASE ${OB_RELEASEID}) +set(CPACK_DEBIAN_PACKAGE_NAME ${CPACK_PACKAGE_NAME}) + +set(CPACK_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION}) +set(CPACK_PACKAGE_CONTACT "${OceanBase_CE_HOMEPAGE_URL}") +set(CPACK_DEBIAN_PACKAGE_MAINTAINER "OceanBase") +set(CPACK_DEBIAN_PACKAGE_SECTION "database") +set(CPACK_DEBIAN_PACKAGE_PRIORITY "Optional") + +if (OB_BUILD_OPENSOURCE) + set(CPACK_DEBIAN_SERVER_PACKAGE_DEPENDS "jq, systemd") + + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/post_install.sh.template + ${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/postinst + @ONLY) + + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/pre_uninstall.sh.template + ${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/prerm + @ONLY) + + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/post_uninstall.sh.template + ${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/postrm + @ONLY) + + set(CPACK_DEBIAN_SERVER_PACKAGE_CONTROL_EXTRA + ${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/postinst + ${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/prerm + ${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/postrm) +endif() + +# add the deb post and pre script +if (OB_BUILD_OPENSOURCE) +install(FILES + tools/rpm/systemd/profile/postinst + tools/rpm/systemd/profile/prerm + tools/rpm/systemd/profile/postrm + DESTINATION profile + COMPONENT server) +endif() + +# install cpack to make everything work +include(CPack) + +#add deb target to create DEBS +add_custom_target(deb + COMMAND +make package + DEPENDS + observer obcdc_tailf obtable obtable_static + ob_admin ob_error ob_sql_proxy_parser_static + ${BITCODE_TO_ELF_LIST} + ) \ No newline at end of file diff --git a/cmake/Pack.cmake b/cmake/Pack.cmake new file mode 100644 index 000000000..b86fd6b0f --- /dev/null +++ b/cmake/Pack.cmake @@ -0,0 +1,368 @@ +set(CPACK_PACKAGING_INSTALL_PREFIX /home/admin/oceanbase) +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OceanBase is a distributed relational database") +set(CPACK_PACKAGE_VENDOR "OceanBase Inc.") +set(CPACK_PACKAGE_DESCRIPTION "OceanBase is a distributed relational database") + +if (OB_BUILD_OPENSOURCE) + set(CPACK_PACKAGE_NAME "oceanbase-ce") + set(CPACK_PACKAGE_VERSION "${OceanBase_CE_VERSION}") + set(CPACK_PACKAGE_VERSION_MAJOR "${OceanBase_CE_VERSION_MAJOR}") + set(CPACK_PACKAGE_VERSION_MINOR "${OceanBase_CE_VERSION_MINOR}") + set(CPACK_PACKAGE_VERSION_PATCH "${OceanBase_CE_VERSION_PATCH}") +else() + set(CPACK_PACKAGE_NAME "oceanbase") + set(CPACK_PACKAGE_VERSION "${OceanBase_VERSION}") + set(CPACK_PACKAGE_VERSION_MAJOR "${OceanBase_VERSION_MAJOR}") + set(CPACK_PACKAGE_VERSION_MINOR "${OceanBase_VERSION_MINOR}") + set(CPACK_PACKAGE_VERSION_PATCH "${OceanBase_VERSION_PATCH}") +endif() + +## TIPS +# +# - PATH is relative to the **ROOT directory** of project other than the cmake directory. + +set(BITCODE_TO_ELF_LIST "") + +if (OB_BUILD_OPENSOURCE) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/oceanbase-service.sh.template + ${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/oceanbase-service.sh + @ONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/telemetry.sh.template + ${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/telemetry.sh + @ONLY) +endif() + +## server +if (OB_BUILD_OPENSOURCE) +install(PROGRAMS + tools/import_time_zone_info.py + tools/import_srs_data.py + ${CMAKE_BINARY_DIR}/src/observer/observer + deps/3rd/home/admin/oceanbase/bin/obshell + DESTINATION bin + COMPONENT server) +else() +install(PROGRAMS + script/dooba/dooba + tools/import_time_zone_info.py + tools/import_srs_data.py + ${CMAKE_BINARY_DIR}/tools/ob_admin/ob_admin + tools/ob_admin/io_bench/bench_io.sh + ${CMAKE_BINARY_DIR}/src/observer/observer + DESTINATION bin + COMPONENT server) +endif() + +install(FILES + src/sql/fill_help_tables-ob.sql + src/share/parameter/default_parameter.json + src/share/system_variable/default_system_variable.json + tools/timezone_V1.log + tools/default_srs_data_mysql.sql + tools/upgrade/upgrade_pre.py + tools/upgrade/upgrade_post.py + tools/upgrade/upgrade_checker.py + tools/upgrade/upgrade_health_checker.py + tools/upgrade/oceanbase_upgrade_dep.yml + DESTINATION etc + COMPONENT server) + +install( + DIRECTORY src/share/inner_table/sys_package/ + DESTINATION admin + COMPONENT server) + +if (OB_BUILD_OPENSOURCE) +install(FILES + tools/rpm/systemd/profile/oceanbase.cnf + tools/rpm/systemd/profile/oceanbase-pre.json + tools/rpm/systemd/profile/oceanbase.service + tools/rpm/systemd/profile/oceanbase-service.sh + tools/rpm/systemd/profile/telemetry.sh + DESTINATION profile + COMPONENT server) +endif() + +## oceanbase-cdc +if (NOT OB_SO_CACHE AND OB_BUILD_CDC) +include(GNUInstallDirs) +install( + TARGETS obcdc obcdc_tailf + COMPONENT cdc + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libobcdc + ) + +get_property(CDCMSG_HEADER_DIR GLOBAL PROPERTY CDC_MSG_HEADER_DIR) +install( + DIRECTORY + ${CDCMSG_HEADER_DIR} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT cdc + ) +install( + DIRECTORY + ${PROJECT_SOURCE_DIR}/src/logservice/libobcdc/tests/scripts/ + DESTINATION ${CMAKE_INSTALL_RUNSTATEDIR} + COMPONENT cdc + ) + +if(OB_BUILD_OPENSOURCE) +install( + FILES + ${PROJECT_SOURCE_DIR}/src/logservice/libobcdc/tests/libobcdc.conf + ${PROJECT_SOURCE_DIR}/tools/upgrade/obcdc_compatiable_ob_info.yaml + DESTINATION ${CMAKE_INSTALL_SYSCONFDIR} + COMPONENT cdc + ) +else() +install( + FILES + ${PROJECT_SOURCE_DIR}/src/logservice/libobcdc/tests/libobcdc.conf + ${PROJECT_SOURCE_DIR}/tools/upgrade/obcdc_compatiable_ob_info.yaml + ${PROJECT_SOURCE_DIR}/src/logservice/libobcdc/tests/timezone_info.conf + DESTINATION ${CMAKE_INSTALL_SYSCONFDIR} + COMPONENT cdc + ) +endif() +endif() + +## oceanbase-sql-parser +if (OB_BUILD_LIBOB_SQL_PROXY_PARSER) + + if (ENABLE_THIN_LTO) + message(STATUS "add libob_sql_proxy_parser_static_to_elf") + add_custom_command( + OUTPUT libob_sql_proxy_parser_static_to_elf + COMMAND ${CMAKE_SOURCE_DIR}/cmake/script/bitcode_to_elfobj --ld=${OB_LD_BIN} --input=${CMAKE_BINARY_DIR}/src/sql/parser/libob_sql_proxy_parser_static.a --output=${CMAKE_BINARY_DIR}/src/sql/parser/libob_sql_proxy_parser_static.a + DEPENDS ob_sql_proxy_parser_static + COMMAND_EXPAND_LISTS) + list(APPEND BITCODE_TO_ELF_LIST libob_sql_proxy_parser_static_to_elf) + endif() + + install(PROGRAMS + ${CMAKE_BINARY_DIR}/src/sql/parser/libob_sql_proxy_parser_static.a + DESTINATION lib + COMPONENT sql-parser + ) +endif() + +install(FILES + src/objit/include/objit/common/ob_item_type.h + deps/oblib/src/common/sql_mode/ob_sql_mode.h + src/sql/parser/ob_sql_parser.h + src/sql/parser/parse_malloc.h + src/sql/parser/parser_proxy_func.h + src/sql/parser/parse_node.h + DESTINATION include + COMPONENT sql-parser) + +## oceanbsae-table +install(FILES + deps/oblib/src/common/data_buffer.h + deps/oblib/src/common/ob_accuracy.h + deps/oblib/src/common/ob_action_flag.h + deps/oblib/src/common/ob_common_utility.h + deps/oblib/src/common/ob_range.h + deps/oblib/src/common/ob_region.h + deps/oblib/src/common/ob_role.h + deps/oblib/src/common/ob_string_buf.h + deps/oblib/src/common/ob_string_buf.ipp + deps/oblib/src/common/ob_timeout_ctx.h + deps/oblib/src/common/ob_zerofill_info.h + deps/oblib/src/common/ob_zone.h + deps/oblib/src/common/object/ob_obj_type.h + deps/oblib/src/common/object/ob_object.h + deps/oblib/src/common/rowkey/ob_rowkey.h + deps/oblib/src/common/rowkey/ob_rowkey_info.h + deps/oblib/src/lib/alloc/abit_set.h + deps/oblib/src/lib/alloc/alloc_assist.h + deps/oblib/src/lib/alloc/alloc_func.h + deps/oblib/src/lib/alloc/alloc_struct.h + deps/oblib/src/lib/alloc/block_set.h + deps/oblib/src/lib/alloc/ob_malloc_allocator.h + deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.h + deps/oblib/src/lib/alloc/object_mgr.h + deps/oblib/src/lib/alloc/object_set.h + deps/oblib/src/lib/allocator/ob_allocator.h + deps/oblib/src/lib/allocator/ob_cached_allocator.h + deps/oblib/src/lib/allocator/ob_concurrent_fifo_allocator.h + deps/oblib/src/lib/allocator/ob_fifo_allocator.h + deps/oblib/src/lib/allocator/ob_lf_fifo_allocator.h + deps/oblib/src/lib/allocator/ob_malloc.h + deps/oblib/src/lib/allocator/ob_mod_define.h + deps/oblib/src/lib/allocator/ob_pcounter.h + deps/oblib/src/lib/allocator/ob_pooled_allocator.h + deps/oblib/src/lib/allocator/ob_retire_station.h + deps/oblib/src/lib/allocator/ob_small_allocator.h + deps/oblib/src/lib/allocator/ob_tc_malloc.h + deps/oblib/src/lib/allocator/page_arena.h + deps/oblib/src/lib/atomic/ob_atomic.h + deps/oblib/src/lib/atomic/ob_atomic_reference.h + deps/oblib/src/lib/charset/ob_charset.h + deps/oblib/src/lib/charset/ob_config.h + deps/oblib/src/lib/charset/ob_ctype.h + deps/oblib/src/lib/charset/ob_mysql_global.h + deps/oblib/src/lib/checksum/ob_crc64.h + deps/oblib/src/lib/container/ob_array.h + deps/oblib/src/lib/container/ob_array_helper.h + deps/oblib/src/lib/container/ob_array_iterator.h + deps/oblib/src/lib/container/ob_array_serialization.h + deps/oblib/src/lib/container/ob_array_wrap.h + deps/oblib/src/lib/container/ob_bit_set.h + deps/oblib/src/lib/container/ob_fixed_array.h + deps/oblib/src/lib/container/ob_iarray.h + deps/oblib/src/lib/container/ob_se_array.h + deps/oblib/src/lib/container/ob_vector.h + deps/oblib/src/lib/container/ob_vector.ipp + deps/oblib/src/lib/core_local/ob_core_local_storage.h + deps/oblib/src/lib/file/config.h + deps/oblib/src/lib/file/ob_string_util.h + deps/oblib/src/lib/hash/mprotect.h + deps/oblib/src/lib/hash/ob_array_index_hash_set.h + deps/oblib/src/lib/hash/ob_hashmap.h + deps/oblib/src/lib/hash/ob_hashset.h + deps/oblib/src/lib/hash/ob_hashtable.h + deps/oblib/src/lib/hash/ob_hashutils.h + deps/oblib/src/lib/hash/ob_iteratable_hashmap.h + deps/oblib/src/lib/hash/ob_linear_hash_map.h + deps/oblib/src/lib/hash/ob_placement_hashutils.h + deps/oblib/src/lib/hash/ob_pointer_hashmap.h + deps/oblib/src/lib/hash/ob_serialization.h + deps/oblib/src/lib/hash_func/murmur_hash.h + deps/oblib/src/lib/hash_func/ob_hash_func.h + deps/oblib/src/lib/json/ob_yson.h + deps/oblib/src/lib/json/ob_yson_encode.h + deps/oblib/src/lib/list/ob_dlink_node.h + deps/oblib/src/lib/list/ob_dlist.h + deps/oblib/src/lib/list/ob_list.h + deps/oblib/src/lib/lock/cond.h + deps/oblib/src/lib/lock/ob_lock.h + deps/oblib/src/lib/lock/ob_monitor.h + deps/oblib/src/lib/lock/mutex.h + deps/oblib/src/lib/lock/ob_bucket_lock.h + deps/oblib/src/lib/lock/ob_drw_lock.h + deps/oblib/src/lib/lock/ob_latch.h + deps/oblib/src/lib/lock/ob_lock_guard.h + deps/oblib/src/lib/lock/ob_mutex.h + deps/oblib/src/lib/lock/ob_small_spin_lock.h + deps/oblib/src/lib/lock/ob_spin_lock.h + deps/oblib/src/lib/lock/ob_spin_rwlock.h + deps/oblib/src/lib/lock/ob_thread_cond.h + deps/oblib/src/lib/lock/ob_rwlock.h + deps/oblib/src/lib/metrics/ob_counter.h + deps/oblib/src/lib/net/ob_addr.h + deps/oblib/src/lib/net/ob_net_util.h + deps/oblib/src/lib/number/ob_number_v2.h + deps/oblib/src/lib/ob_date_unit_type.h + deps/oblib/src/lib/ob_define.h + deps/oblib/src/lib/ob_errno.h + deps/oblib/src/lib/ob_name_def.h + deps/oblib/src/lib/ob_name_id_def.h + deps/oblib/src/lib/oblog/ob_log.h + deps/oblib/src/lib/oblog/ob_log_module.h + deps/oblib/src/lib/oblog/ob_log_print_kv.h + deps/oblib/src/lib/oblog/ob_trace_log.h + deps/oblib/src/lib/profile/ob_atomic_event.h + deps/oblib/src/lib/queue/ob_dedup_queue.h + deps/oblib/src/lib/queue/ob_fixed_queue.h + deps/oblib/src/lib/queue/ob_link.h + deps/oblib/src/lib/random/ob_random.h + deps/oblib/src/lib/resource/achunk_mgr.h + deps/oblib/src/lib/resource/ob_cache_washer.h + deps/oblib/src/lib/resource/ob_resource_mgr.h + deps/oblib/src/lib/stat/ob_latch_define.h + deps/oblib/src/lib/string/ob_fixed_length_string.h + deps/oblib/src/lib/string/ob_string.h + deps/oblib/src/lib/string/ob_strings.h + deps/oblib/src/lib/thread_local/ob_tsi_factory.h + deps/oblib/src/lib/thread_local/ob_tsi_utils.h + deps/oblib/src/lib/time/Time.h + deps/oblib/src/lib/time/ob_time_utility.h + deps/oblib/src/lib/timezone/ob_time_convert.h + deps/oblib/src/lib/timezone/ob_timezone_info.h + deps/oblib/src/lib/trace/ob_seq_event_recorder.h + deps/oblib/src/lib/trace/ob_trace_event.h + deps/oblib/src/lib/utility/ob_hang_fatal_error.h + deps/oblib/src/lib/utility/ob_macro_utils.h + deps/oblib/src/lib/utility/ob_print_kv.h + deps/oblib/src/lib/utility/ob_print_utils.h + deps/oblib/src/lib/utility/ob_rate_limiter.h + deps/oblib/src/lib/utility/ob_serialization_helper.h + deps/oblib/src/lib/utility/ob_template_utils.h + deps/oblib/src/lib/utility/ob_unify_serialize.h + deps/oblib/src/lib/utility/serialization.h + deps/oblib/src/lib/utility/utility.h + deps/oblib/src/lib/wait_event/ob_wait_class.h + deps/oblib/src/lib/wait_event/ob_wait_event.h + src/share/config/ob_common_config.h + src/share/config/ob_config.h + src/share/config/ob_config_helper.h + src/share/mysql_errno.h + src/share/object/ob_obj_cast.h + src/share/partition_table/ob_partition_location.h + src/share/table/ob_table.h + src/share/table/ob_table_rpc_proxy.h + src/share/table/ob_table_rpc_struct.h + src/libtable/src/libobtable.h + src/libtable/src/ob_table.h + src/libtable/src/ob_hkv_table.h + src/libtable/src/ob_pstore.h + src/libtable/src/ob_table_service_client.h + src/libtable/src/ob_table_service_config.h + src/libtable/src/ob_table_define.h + DESTINATION include + COMPONENT table) + +install(FILES + src/libtable/examples/ob_pstore_example.cpp + src/libtable/examples/ob_kvtable_example.cpp + src/libtable/examples/ob_table_example.cpp + src/libtable/examples/example_makefile.mk + DESTINATION examples + COMPONENT table) + +if (OB_BUILD_LIBOBTABLE) + + if (ENABLE_THIN_LTO) + message(STATUS "add libobtable_static_to_elf") + add_custom_command( + OUTPUT libobtable_static_to_elf + COMMAND ${CMAKE_SOURCE_DIR}/cmake/script/bitcode_to_elfobj --ld=${OB_LD_BIN} --input=${CMAKE_BINARY_DIR}/src/libtable/src/libobtable_static.a --output=${CMAKE_BINARY_DIR}/src/libtable/src/libobtable_static.a + DEPENDS obtable_static + COMMAND_EXPAND_LISTS) + list(APPEND BITCODE_TO_ELF_LIST libobtable_static_to_elf) + endif() + + install(PROGRAMS + ${CMAKE_BINARY_DIR}/src/libtable/src/libobtable.so + ${CMAKE_BINARY_DIR}/src/libtable/src/libobtable.so.1 + ${CMAKE_BINARY_DIR}/src/libtable/src/libobtable.so.1.0.0 + ${CMAKE_BINARY_DIR}/src/libtable/src/libobtable_static.a + DESTINATION lib + COMPONENT table) +endif() + +if(OB_BUILD_OPENSOURCE) +## oceanbase-libs +install(PROGRAMS + deps/3rd/usr/local/oceanbase/deps/devel/lib/libaio.so.1 + deps/3rd/usr/local/oceanbase/deps/devel/lib/libaio.so.1.0.1 + deps/3rd/usr/local/oceanbase/deps/devel/lib/libaio.so + deps/3rd/usr/local/oceanbase/deps/devel/lib/mariadb/libmariadb.so + deps/3rd/usr/local/oceanbase/deps/devel/lib/mariadb/libmariadb.so.3 + DESTINATION lib + COMPONENT libs +) +if(OB_BUILD_OBADMIN) + ## oceanbase-utils + install(PROGRAMS + ${CMAKE_BINARY_DIR}/tools/ob_admin/ob_admin + ${CMAKE_BINARY_DIR}/tools/ob_error/src/ob_error + DESTINATION /usr/bin + COMPONENT utils + ) + endif() +endif() diff --git a/cmake/RPM.cmake b/cmake/RPM.cmake index aad20a962..be472cb76 100644 --- a/cmake/RPM.cmake +++ b/cmake/RPM.cmake @@ -13,41 +13,32 @@ set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") #set(CPACK_RPM_DEBUGINFO_PACKAGE ON) #set(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX "/usr/src/debug") # RPM package informations. -set(CPACK_PACKAGING_INSTALL_PREFIX /home/admin/oceanbase) -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OceanBase is a distributed relational database") -set(CPACK_PACKAGE_VENDOR "OceanBase Inc.") + +include(cmake/Pack.cmake) + set(CPACK_RPM_PACKAGE_RELEASE ${OB_RELEASEID}) if (OB_BUILD_OPENSOURCE) -set(CPACK_PACKAGE_NAME "oceanbase-ce") -set(CPACK_PACKAGE_VERSION "${OceanBase_CE_VERSION}") -set(CPACK_PACKAGE_VERSION_MAJOR "${OceanBase_CE_VERSION_MAJOR}") -set(CPACK_PACKAGE_VERSION_MINOR "${OceanBase_CE_VERSION_MINOR}") -set(CPACK_PACKAGE_VERSION_PATCH "${OceanBase_CE_VERSION_PATCH}") -set(CPACK_RPM_PACKAGE_URL "${OceanBase_CE_HOMEPAGE_URL}") -set(CPACK_RPM_PACKAGE_RELEASE_DIST ON) -## set relocation path install prefix for each component -set(CPACK_RPM_DEVEL_PACKAGE_PREFIX /usr) -set(CPACK_RPM_UTILS_PACKAGE_PREFIX /usr) -list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/home") -list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/home/admin") -list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/home/admin/oceanbase") + set(CPACK_RPM_PACKAGE_URL "${OceanBase_CE_HOMEPAGE_URL}") + set(CPACK_RPM_PACKAGE_RELEASE_DIST ON) + ## set relocation path install prefix for each component + set(CPACK_RPM_DEVEL_PACKAGE_PREFIX /usr) + set(CPACK_RPM_UTILS_PACKAGE_PREFIX /usr) + list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/home") + list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/home/admin") + list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/home/admin/oceanbase") else() -set(CPACK_PACKAGE_NAME "oceanbase") -set(CPACK_PACKAGE_VERSION "${OceanBase_VERSION}") -set(CPACK_PACKAGE_VERSION_MAJOR "${OceanBase_VERSION_MAJOR}") -set(CPACK_PACKAGE_VERSION_MINOR "${OceanBase_VERSION_MINOR}") -set(CPACK_PACKAGE_VERSION_PATCH "${OceanBase_VERSION_PATCH}") -set(CPACK_RPM_PACKAGE_URL "${OceanBase_HOMEPAGE_URL}") + set(CPACK_RPM_PACKAGE_URL "${OceanBase_HOMEPAGE_URL}") endif() + set(CPACK_RPM_PACKAGE_GROUP "Applications/Databases") -set(CPACK_RPM_PACKAGE_DESCRIPTION "OceanBase is a distributed relational database") +set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION}) set(CPACK_RPM_PACKAGE_LICENSE "Mulan PubL v2.") set(CPACK_RPM_DEFAULT_USER "admin") set(CPACK_RPM_DEFAULT_GROUP "admin") if (OB_BUILD_OPENSOURCE) -set(DEBUG_INSTALL_POST "mv $RPM_BUILD_ROOT/../server/home/admin/oceanbase/bin/obshell %{_builddir}/obshell; %{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} %{_builddir}/%{?buildsubdir}; mv %{_builddir}/obshell $RPM_BUILD_ROOT/../server/home/admin/oceanbase/bin/obshell; %{nil}") + set(DEBUG_INSTALL_POST "mv $RPM_BUILD_ROOT/../server/home/admin/oceanbase/bin/obshell %{_builddir}/obshell; %{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} %{_builddir}/%{?buildsubdir}; mv %{_builddir}/obshell $RPM_BUILD_ROOT/../server/home/admin/oceanbase/bin/obshell; %{nil}") else() -set(DEBUG_INSTALL_POST "%{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} %{_builddir}/%{?buildsubdir};%{nil}") + set(DEBUG_INSTALL_POST "%{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} %{_builddir}/%{?buildsubdir};%{nil}") endif() set(CPACK_RPM_SPEC_MORE_DEFINE "%global _missing_build_ids_terminate_build 0 @@ -64,13 +55,6 @@ set(CPACK_RPM_SPEC_MORE_DEFINE if (OB_BUILD_OPENSOURCE) set(CPACK_RPM_PACKAGE_REQUIRES "jq, systemd") - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/oceanbase-service.sh.template - ${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/oceanbase-service.sh - @ONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/telemetry.sh.template - ${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/telemetry.sh - @ONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/post_install.sh.template ${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/post_install.sh @ONLY) @@ -87,361 +71,24 @@ if (OB_BUILD_OPENSOURCE) set(CPACK_RPM_SERVER_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/post_uninstall.sh) endif() -## TIPS -# -# - PATH is relative to the **ROOT directory** of project other than the cmake directory. - -set(BITCODE_TO_ELF_LIST "") - ## server -if (OB_BUILD_OPENSOURCE) +if (NOT OB_BUILD_OPENSOURCE) install(PROGRAMS - tools/import_time_zone_info.py - tools/import_srs_data.py - ${CMAKE_BINARY_DIR}/src/observer/observer - deps/3rd/home/admin/oceanbase/bin/obshell - DESTINATION bin - COMPONENT server) -else() -install(PROGRAMS - script/dooba/dooba - tools/import_time_zone_info.py - tools/import_srs_data.py - ${CMAKE_BINARY_DIR}/tools/ob_admin/ob_admin - tools/ob_admin/io_bench/bench_io.sh - ${CMAKE_BINARY_DIR}/src/observer/observer ${DEVTOOLS_DIR}/bin/obstack DESTINATION bin COMPONENT server) endif() -install(FILES - src/sql/fill_help_tables-ob.sql - src/share/parameter/default_parameter.json - src/share/system_variable/default_system_variable.json - tools/timezone_V1.log - tools/default_srs_data_mysql.sql - tools/upgrade/upgrade_pre.py - tools/upgrade/upgrade_post.py - tools/upgrade/upgrade_checker.py - tools/upgrade/upgrade_health_checker.py - tools/upgrade/oceanbase_upgrade_dep.yml - DESTINATION etc - COMPONENT server) - -install( - DIRECTORY src/share/inner_table/sys_package/ - DESTINATION admin - COMPONENT server) - +# add the rpm post and pre script if (OB_BUILD_OPENSOURCE) install(FILES - tools/rpm/systemd/profile/oceanbase.cnf - tools/rpm/systemd/profile/oceanbase-pre.json - tools/rpm/systemd/profile/oceanbase.service - tools/rpm/systemd/profile/oceanbase-service.sh tools/rpm/systemd/profile/post_install.sh tools/rpm/systemd/profile/post_uninstall.sh tools/rpm/systemd/profile/pre_uninstall.sh - tools/rpm/systemd/profile/telemetry.sh DESTINATION profile COMPONENT server) endif() -## oceanbase-cdc -if (NOT OB_SO_CACHE AND OB_BUILD_CDC) -include(GNUInstallDirs) -install( - TARGETS obcdc obcdc_tailf - COMPONENT cdc - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libobcdc - ) - -get_property(CDCMSG_HEADER_DIR GLOBAL PROPERTY CDC_MSG_HEADER_DIR) -install( - DIRECTORY - ${CDCMSG_HEADER_DIR} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT cdc - ) -install( - DIRECTORY - ${PROJECT_SOURCE_DIR}/src/logservice/libobcdc/tests/scripts/ - DESTINATION ${CMAKE_INSTALL_RUNSTATEDIR} - COMPONENT cdc - ) - -if(OB_BUILD_OPENSOURCE) -install( - FILES - ${PROJECT_SOURCE_DIR}/src/logservice/libobcdc/tests/libobcdc.conf - ${PROJECT_SOURCE_DIR}/tools/upgrade/obcdc_compatiable_ob_info.yaml - DESTINATION ${CMAKE_INSTALL_SYSCONFDIR} - COMPONENT cdc - ) -else() -install( - FILES - ${PROJECT_SOURCE_DIR}/src/logservice/libobcdc/tests/libobcdc.conf - ${PROJECT_SOURCE_DIR}/tools/upgrade/obcdc_compatiable_ob_info.yaml - ${PROJECT_SOURCE_DIR}/src/logservice/libobcdc/tests/timezone_info.conf - DESTINATION ${CMAKE_INSTALL_SYSCONFDIR} - COMPONENT cdc - ) -endif() -endif() - -## oceanbase-sql-parser -if (OB_BUILD_LIBOB_SQL_PROXY_PARSER) - - if (ENABLE_THIN_LTO) - message(STATUS "add libob_sql_proxy_parser_static_to_elf") - add_custom_command( - OUTPUT libob_sql_proxy_parser_static_to_elf - COMMAND ${CMAKE_SOURCE_DIR}/cmake/script/bitcode_to_elfobj --ld=${OB_LD_BIN} --input=${CMAKE_BINARY_DIR}/src/sql/parser/libob_sql_proxy_parser_static.a --output=${CMAKE_BINARY_DIR}/src/sql/parser/libob_sql_proxy_parser_static.a - DEPENDS ob_sql_proxy_parser_static - COMMAND_EXPAND_LISTS) - list(APPEND BITCODE_TO_ELF_LIST libob_sql_proxy_parser_static_to_elf) - endif() - - install(PROGRAMS - ${CMAKE_BINARY_DIR}/src/sql/parser/libob_sql_proxy_parser_static.a - DESTINATION lib - COMPONENT sql-parser - ) -endif() - -install(FILES - src/objit/include/objit/common/ob_item_type.h - deps/oblib/src/common/sql_mode/ob_sql_mode.h - src/sql/parser/ob_sql_parser.h - src/sql/parser/parse_malloc.h - src/sql/parser/parser_proxy_func.h - src/sql/parser/parse_node.h - DESTINATION include - COMPONENT sql-parser) - -install(FILES - src/objit/include/objit/common/ob_item_type.h - deps/oblib/src/common/sql_mode/ob_sql_mode.h - src/sql/parser/ob_sql_parser.h - src/sql/parser/parse_malloc.h - src/sql/parser/parser_proxy_func.h - src/sql/parser/parse_node.h - DESTINATION include - COMPONENT sql-parser) - -## oceanbsae-table -install(FILES - deps/oblib/src/common/data_buffer.h - deps/oblib/src/common/ob_accuracy.h - deps/oblib/src/common/ob_action_flag.h - deps/oblib/src/common/ob_common_utility.h - deps/oblib/src/common/ob_range.h - deps/oblib/src/common/ob_region.h - deps/oblib/src/common/ob_role.h - deps/oblib/src/common/ob_string_buf.h - deps/oblib/src/common/ob_string_buf.ipp - deps/oblib/src/common/ob_timeout_ctx.h - deps/oblib/src/common/ob_zerofill_info.h - deps/oblib/src/common/ob_zone.h - deps/oblib/src/common/object/ob_obj_type.h - deps/oblib/src/common/object/ob_object.h - deps/oblib/src/common/rowkey/ob_rowkey.h - deps/oblib/src/common/rowkey/ob_rowkey_info.h - deps/oblib/src/lib/alloc/abit_set.h - deps/oblib/src/lib/alloc/alloc_assist.h - deps/oblib/src/lib/alloc/alloc_func.h - deps/oblib/src/lib/alloc/alloc_struct.h - deps/oblib/src/lib/alloc/block_set.h - deps/oblib/src/lib/alloc/ob_malloc_allocator.h - deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.h - deps/oblib/src/lib/alloc/object_mgr.h - deps/oblib/src/lib/alloc/object_set.h - deps/oblib/src/lib/allocator/ob_allocator.h - deps/oblib/src/lib/allocator/ob_cached_allocator.h - deps/oblib/src/lib/allocator/ob_concurrent_fifo_allocator.h - deps/oblib/src/lib/allocator/ob_fifo_allocator.h - deps/oblib/src/lib/allocator/ob_lf_fifo_allocator.h - deps/oblib/src/lib/allocator/ob_malloc.h - deps/oblib/src/lib/allocator/ob_mod_define.h - deps/oblib/src/lib/allocator/ob_pcounter.h - deps/oblib/src/lib/allocator/ob_pooled_allocator.h - deps/oblib/src/lib/allocator/ob_retire_station.h - deps/oblib/src/lib/allocator/ob_small_allocator.h - deps/oblib/src/lib/allocator/ob_tc_malloc.h - deps/oblib/src/lib/allocator/page_arena.h - deps/oblib/src/lib/atomic/ob_atomic.h - deps/oblib/src/lib/atomic/ob_atomic_reference.h - deps/oblib/src/lib/charset/ob_charset.h - deps/oblib/src/lib/charset/ob_config.h - deps/oblib/src/lib/charset/ob_ctype.h - deps/oblib/src/lib/charset/ob_mysql_global.h - deps/oblib/src/lib/checksum/ob_crc64.h - deps/oblib/src/lib/container/ob_array.h - deps/oblib/src/lib/container/ob_array_helper.h - deps/oblib/src/lib/container/ob_array_iterator.h - deps/oblib/src/lib/container/ob_array_serialization.h - deps/oblib/src/lib/container/ob_array_wrap.h - deps/oblib/src/lib/container/ob_bit_set.h - deps/oblib/src/lib/container/ob_fixed_array.h - deps/oblib/src/lib/container/ob_iarray.h - deps/oblib/src/lib/container/ob_se_array.h - deps/oblib/src/lib/container/ob_vector.h - deps/oblib/src/lib/container/ob_vector.ipp - deps/oblib/src/lib/core_local/ob_core_local_storage.h - deps/oblib/src/lib/file/config.h - deps/oblib/src/lib/file/ob_string_util.h - deps/oblib/src/lib/hash/mprotect.h - deps/oblib/src/lib/hash/ob_array_index_hash_set.h - deps/oblib/src/lib/hash/ob_hashmap.h - deps/oblib/src/lib/hash/ob_hashset.h - deps/oblib/src/lib/hash/ob_hashtable.h - deps/oblib/src/lib/hash/ob_hashutils.h - deps/oblib/src/lib/hash/ob_iteratable_hashmap.h - deps/oblib/src/lib/hash/ob_linear_hash_map.h - deps/oblib/src/lib/hash/ob_placement_hashutils.h - deps/oblib/src/lib/hash/ob_pointer_hashmap.h - deps/oblib/src/lib/hash/ob_serialization.h - deps/oblib/src/lib/hash_func/murmur_hash.h - deps/oblib/src/lib/hash_func/ob_hash_func.h - deps/oblib/src/lib/json/ob_yson.h - deps/oblib/src/lib/json/ob_yson_encode.h - deps/oblib/src/lib/list/ob_dlink_node.h - deps/oblib/src/lib/list/ob_dlist.h - deps/oblib/src/lib/list/ob_list.h - deps/oblib/src/lib/lock/cond.h - deps/oblib/src/lib/lock/ob_lock.h - deps/oblib/src/lib/lock/ob_monitor.h - deps/oblib/src/lib/lock/mutex.h - deps/oblib/src/lib/lock/ob_bucket_lock.h - deps/oblib/src/lib/lock/ob_drw_lock.h - deps/oblib/src/lib/lock/ob_latch.h - deps/oblib/src/lib/lock/ob_lock_guard.h - deps/oblib/src/lib/lock/ob_mutex.h - deps/oblib/src/lib/lock/ob_small_spin_lock.h - deps/oblib/src/lib/lock/ob_spin_lock.h - deps/oblib/src/lib/lock/ob_spin_rwlock.h - deps/oblib/src/lib/lock/ob_thread_cond.h - deps/oblib/src/lib/lock/ob_rwlock.h - deps/oblib/src/lib/metrics/ob_counter.h - deps/oblib/src/lib/net/ob_addr.h - deps/oblib/src/lib/net/ob_net_util.h - deps/oblib/src/lib/number/ob_number_v2.h - deps/oblib/src/lib/ob_date_unit_type.h - deps/oblib/src/lib/ob_define.h - deps/oblib/src/lib/ob_errno.h - deps/oblib/src/lib/ob_name_def.h - deps/oblib/src/lib/ob_name_id_def.h - deps/oblib/src/lib/oblog/ob_log.h - deps/oblib/src/lib/oblog/ob_log_module.h - deps/oblib/src/lib/oblog/ob_log_print_kv.h - deps/oblib/src/lib/oblog/ob_trace_log.h - deps/oblib/src/lib/profile/ob_atomic_event.h - deps/oblib/src/lib/queue/ob_dedup_queue.h - deps/oblib/src/lib/queue/ob_fixed_queue.h - deps/oblib/src/lib/queue/ob_link.h - deps/oblib/src/lib/random/ob_random.h - deps/oblib/src/lib/resource/achunk_mgr.h - deps/oblib/src/lib/resource/ob_cache_washer.h - deps/oblib/src/lib/resource/ob_resource_mgr.h - deps/oblib/src/lib/stat/ob_latch_define.h - deps/oblib/src/lib/string/ob_fixed_length_string.h - deps/oblib/src/lib/string/ob_string.h - deps/oblib/src/lib/string/ob_strings.h - deps/oblib/src/lib/thread_local/ob_tsi_factory.h - deps/oblib/src/lib/thread_local/ob_tsi_utils.h - deps/oblib/src/lib/time/Time.h - deps/oblib/src/lib/time/ob_time_utility.h - deps/oblib/src/lib/timezone/ob_time_convert.h - deps/oblib/src/lib/timezone/ob_timezone_info.h - deps/oblib/src/lib/trace/ob_seq_event_recorder.h - deps/oblib/src/lib/trace/ob_trace_event.h - deps/oblib/src/lib/utility/ob_hang_fatal_error.h - deps/oblib/src/lib/utility/ob_macro_utils.h - deps/oblib/src/lib/utility/ob_print_kv.h - deps/oblib/src/lib/utility/ob_print_utils.h - deps/oblib/src/lib/utility/ob_rate_limiter.h - deps/oblib/src/lib/utility/ob_serialization_helper.h - deps/oblib/src/lib/utility/ob_template_utils.h - deps/oblib/src/lib/utility/ob_unify_serialize.h - deps/oblib/src/lib/utility/serialization.h - deps/oblib/src/lib/utility/utility.h - deps/oblib/src/lib/wait_event/ob_wait_class.h - deps/oblib/src/lib/wait_event/ob_wait_event.h - src/share/config/ob_common_config.h - src/share/config/ob_config.h - src/share/config/ob_config_helper.h - src/share/mysql_errno.h - src/share/object/ob_obj_cast.h - src/share/partition_table/ob_partition_location.h - src/share/table/ob_table.h - src/share/table/ob_table_rpc_proxy.h - src/share/table/ob_table_rpc_struct.h - src/libtable/src/libobtable.h - src/libtable/src/ob_table.h - src/libtable/src/ob_hkv_table.h - src/libtable/src/ob_pstore.h - src/libtable/src/ob_table_service_client.h - src/libtable/src/ob_table_service_config.h - src/libtable/src/ob_table_define.h - DESTINATION include - COMPONENT table) - -install(FILES - src/libtable/examples/ob_pstore_example.cpp - src/libtable/examples/ob_kvtable_example.cpp - src/libtable/examples/ob_table_example.cpp - src/libtable/examples/example_makefile.mk - DESTINATION examples - COMPONENT table) - -if (OB_BUILD_LIBOBTABLE) - - if (ENABLE_THIN_LTO) - message(STATUS "add libobtable_static_to_elf") - add_custom_command( - OUTPUT libobtable_static_to_elf - COMMAND ${CMAKE_SOURCE_DIR}/cmake/script/bitcode_to_elfobj --ld=${OB_LD_BIN} --input=${CMAKE_BINARY_DIR}/src/libtable/src/libobtable_static.a --output=${CMAKE_BINARY_DIR}/src/libtable/src/libobtable_static.a - DEPENDS obtable_static - COMMAND_EXPAND_LISTS) - list(APPEND BITCODE_TO_ELF_LIST libobtable_static_to_elf) - endif() - - install(PROGRAMS - ${CMAKE_BINARY_DIR}/src/libtable/src/libobtable.so - ${CMAKE_BINARY_DIR}/src/libtable/src/libobtable.so.1 - ${CMAKE_BINARY_DIR}/src/libtable/src/libobtable.so.1.0.0 - ${CMAKE_BINARY_DIR}/src/libtable/src/libobtable_static.a - DESTINATION lib - COMPONENT table) -endif() - -if(OB_BUILD_OPENSOURCE) -## oceanbase-libs -install(PROGRAMS - deps/3rd/usr/local/oceanbase/deps/devel/lib/libaio.so.1 - deps/3rd/usr/local/oceanbase/deps/devel/lib/libaio.so.1.0.1 - deps/3rd/usr/local/oceanbase/deps/devel/lib/libaio.so - deps/3rd/usr/local/oceanbase/deps/devel/lib/mariadb/libmariadb.so - deps/3rd/usr/local/oceanbase/deps/devel/lib/mariadb/libmariadb.so.3 - DESTINATION lib - COMPONENT libs -) -if(OB_BUILD_OBADMIN) - ## oceanbase-utils - install(PROGRAMS - ${CMAKE_BINARY_DIR}/tools/ob_admin/ob_admin - ${CMAKE_BINARY_DIR}/tools/ob_error/src/ob_error - DESTINATION /usr/bin - COMPONENT utils - ) - endif() -endif() - # install cpack to make everything work include(CPack) diff --git a/deps/init/oceanbase.el9.aarch64.deps b/deps/init/oceanbase.el9.aarch64.deps index 17b1d6693..421d7d4ca 100644 --- a/deps/init/oceanbase.el9.aarch64.deps +++ b/deps/init/oceanbase.el9.aarch64.deps @@ -13,6 +13,13 @@ os=9 arch=aarch64 repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/9/aarch64/ +#RANGE_IF_BUSINESS +[target-obshell] +os=8 +arch=aarch64 +repo=https://ob-yum.oceanbase-dev.com/8/aarch64/test/obshell/ +#RANGE_END + [deps] devdeps-gtest-1.8.0-132022101316.el8.aarch64.rpm devdeps-isa-l-static-2.22.0-22022092915.el8.aarch64.rpm @@ -49,6 +56,11 @@ obdevtools-llvm-11.0.1-312022092921.el8.aarch64.rpm [tools-deps] devdeps-oblogmsg-1.0-52022113019.el8.aarch64.rpm devdeps-rocksdb-6.22.1.1-52022100420.el8.aarch64.rpm +#RANGE_IF_BUSINESS +obshell-4.2.2.0-122024022614.el8.aarch64.rpm target=obshell +#RANGE_ELSE +#obshell-4.2.2.0-122024022614.el8.aarch64.rpm target=community +#RANGE_END [test-utils] ob-deploy-1.6.0-41.el8.aarch64.rpm target=community diff --git a/deps/init/oceanbase.el9.x86_64.deps b/deps/init/oceanbase.el9.x86_64.deps index 77d166d71..9403ca5d1 100644 --- a/deps/init/oceanbase.el9.x86_64.deps +++ b/deps/init/oceanbase.el9.x86_64.deps @@ -13,6 +13,13 @@ os=9 arch=x86_64 repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/9/x86_64/ +#RANGE_IF_BUSINESS +[target-obshell] +os=8 +arch=x86_64 +repo=https://ob-yum.oceanbase-dev.com/8/x86_64/test/obshell/ +#RANGE_END + [deps] devdeps-gtest-1.8.0-132022101316.el8.x86_64.rpm devdeps-isa-l-static-2.22.0-22022092915.el8.x86_64.rpm @@ -35,6 +42,7 @@ devdeps-icu-69.1-72022112416.el8.x86_64.rpm devdeps-cos-c-sdk-5.0.16-52023070517.el8.x86_64.rpm devdeps-cloud-qpl-1.1.0-272023061419.el8.x86_64.rpm devdeps-s3-cpp-sdk-1.11.156-102023122011.el8.x86_64.rpm +devdeps-protobuf-c-1.4.1-100000062023102016.el8.x86_64.rpm [deps-el9] devdeps-apr-1.6.5-232023090616.el9.x86_64.rpm target=el9 @@ -51,6 +59,11 @@ obdevtools-llvm-11.0.1-312022092921.el8.x86_64.rpm [tools-deps] devdeps-oblogmsg-1.0-52022113019.el8.x86_64.rpm devdeps-rocksdb-6.22.1.1-52022100420.el8.x86_64.rpm +#RANGE_IF_BUSINESS +obshell-4.2.2.0-122024022614.el8.x86_64.rpm target=obshell +#RANGE_ELSE +#obshell-4.2.2.0-122024022614.el8.x86_64.rpm target=community +#RANGE_END [test-utils] ob-deploy-1.6.0-41.el8.x86_64.rpm target=community diff --git a/deps/oblib/src/lib/oblog/ob_log.h b/deps/oblib/src/lib/oblog/ob_log.h index 71f3fa416..b8d4f2747 100644 --- a/deps/oblib/src/lib/oblog/ob_log.h +++ b/deps/oblib/src/lib/oblog/ob_log.h @@ -1256,7 +1256,7 @@ _Pragma("GCC diagnostic pop") check_reset_force_allows(); } /* not allow */ } -#ifndef OB_BUILD_RPM +#ifndef OB_BUILD_PACKAGE const int64_t threshold_us = 500 * 1000; #else const int64_t threshold_us = 1000 * 1000; diff --git a/package/deb/oceanbase-ce-build.sh b/package/deb/oceanbase-ce-build.sh new file mode 100644 index 000000000..6e4242b99 --- /dev/null +++ b/package/deb/oceanbase-ce-build.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +PROJECT_DIR=$1 +PROJECT_NAME=$2 +VERSION=$3 +RELEASE=$4 + +CURDIR=$PWD +TOP_DIR=`pwd`/../../ + +echo "[BUILD] args: TOP_DIR=${TOP_DIR} PROJECT_NAME=${PROJECT_NAME} VERSION=${VERSION} RELEASE=${RELEASE}" + +cd ${TOP_DIR} +./build.sh clean +./build.sh \ + deb \ + -DOB_RELEASEID=$RELEASE \ + -DBUILD_NUMBER=$RELEASE \ + --init \ + --make deb || exit 1 + +cd ${TOP_DIR}/build_deb +mv *.deb *.ddeb $CURDIR || exit 2 diff --git a/package/deb/oceanbase-ce-cdc-build.sh b/package/deb/oceanbase-ce-cdc-build.sh new file mode 100644 index 000000000..bf8425324 --- /dev/null +++ b/package/deb/oceanbase-ce-cdc-build.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +PROJECT_DIR=$1 +PROJECT_NAME=$2 +VERSION=$3 +RELEASE=$4 + +CURDIR=$PWD +TOP_DIR=`pwd`/../../ + +echo "[BUILD] args: TOP_DIR=${TOP_DIR} PROJECT_NAME=${PROJECT_NAME} VERSION=${VERSION} RELEASE=${RELEASE}" + +cd ${TOP_DIR} +./tools/upgrade/gen_obcdc_compatiable_info.py +./build.sh clean +./build.sh \ + deb \ + -DOB_BUILD_CDC=ON \ + -DOB_RELEASEID=$RELEASE \ + -DBUILD_NUMBER=$RELEASE \ + --init \ + --make deb || exit 1 + +cd ${TOP_DIR}/build_deb +mv *cdc*.deb *cdc*.ddeb $CURDIR || exit 2 diff --git a/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp b/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp index ca1bdaa24..d919986f8 100644 --- a/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp +++ b/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp @@ -765,7 +765,7 @@ int ObTenantMetaMemMgr::push_tablet_into_gc_queue(ObTablet *tablet) LOG_WARN("fail to push tablet into gc queue", K(ret), KPC(tablet)); } } -#ifndef OB_BUILD_RPM +#ifndef OB_BUILD_PACKAGE FLOG_INFO("push tablet into gc queue", K(ret), KP(tablet), K(common::lbt())); #endif return ret; diff --git a/src/storage/multi_data_source/runtime_utility/common_define.h b/src/storage/multi_data_source/runtime_utility/common_define.h index 0c4bc9e52..837d2955c 100644 --- a/src/storage/multi_data_source/runtime_utility/common_define.h +++ b/src/storage/multi_data_source/runtime_utility/common_define.h @@ -22,7 +22,7 @@ #include "src/share/scn.h" #include "src/share/ob_occam_time_guard.h" -#ifdef OB_BUILD_RPM +#ifdef OB_BUILD_PACKAGE #define MDS_ASSERT(x) (void)(x) #else #define MDS_ASSERT(x) \ diff --git a/src/storage/tablet/ob_i_tablet_mds_interface.ipp b/src/storage/tablet/ob_i_tablet_mds_interface.ipp index 904c48dba..6664d5212 100644 --- a/src/storage/tablet/ob_i_tablet_mds_interface.ipp +++ b/src/storage/tablet/ob_i_tablet_mds_interface.ipp @@ -181,7 +181,7 @@ inline int ObITabletMdsInterface::get_mds_data_from_tabletadd_block(block_info.macro_id_, block_info.occupy_size_))) { LOG_WARN("fail to add block", K(ret), K(block_info)); } -#ifndef OB_BUILD_RPM +#ifndef OB_BUILD_PACKAGE int tmp_ret = OB_SUCCESS; if (OB_FAIL(ret)) { // do nothing @@ -2386,7 +2386,7 @@ int ObTablet::inc_ref_with_macro_iter(ObMacroInfoIterator ¯o_iter, bool &inc } #endif } -#ifndef OB_BUILD_RPM +#ifndef OB_BUILD_PACKAGE if (0 != print_arr.count()) { FLOG_INFO("increase tablet's macro ref", K(ret), K(tablet_meta_.tablet_id_), K(tablet_meta_.ls_id_), K(print_arr)); print_arr.reuse(); @@ -2411,7 +2411,7 @@ int ObTablet::inc_ref_with_macro_iter(ObMacroInfoIterator ¯o_iter, bool &inc && OB_TMP_FAIL(MTL(ObSharedMacroBlockMgr*)->free_block(block_info.macro_id_, block_info.occupy_size_))) { LOG_WARN("fail to free block", K(ret), K(block_info)); } -#ifndef OB_BUILD_RPM +#ifndef OB_BUILD_PACKAGE if (OB_TMP_FAIL(tmp_ret)) { // do nothing } else if (OB_TMP_FAIL(print_arr.push_back(block_info.macro_id_))) { @@ -2422,7 +2422,7 @@ int ObTablet::inc_ref_with_macro_iter(ObMacroInfoIterator ¯o_iter, bool &inc } #endif } -#ifndef OB_BUILD_RPM +#ifndef OB_BUILD_PACKAGE if (0 != print_arr.count()) { FLOG_INFO("decrease tablet's macro ref", K(ret), K(tablet_meta_.tablet_id_), K(tablet_meta_.ls_id_), K(print_arr)); print_arr.reuse(); @@ -2626,7 +2626,7 @@ void ObTablet::dec_ref_with_macro_iter(ObMacroInfoIterator ¯o_iter) const ret = OB_SUCCESS; // ignore ret, continue } else { -#ifndef OB_BUILD_RPM +#ifndef OB_BUILD_PACKAGE if (OB_TMP_FAIL(print_arr.push_back(block_info.macro_id_))) { LOG_WARN("fail to push macro id into print array", K(tmp_ret)); } else if (MAX_PRINT_COUNT == print_arr.size()) { @@ -2637,7 +2637,7 @@ void ObTablet::dec_ref_with_macro_iter(ObMacroInfoIterator ¯o_iter) const } } } -#ifndef OB_BUILD_RPM +#ifndef OB_BUILD_PACKAGE if (0 != print_arr.size()) { FLOG_INFO("decrease tablet's macro ref", K(ret), K(tablet_meta_.tablet_id_), K(tablet_meta_.ls_id_), K(print_arr)); print_arr.reuse();