From e6918187568dbd01842d8d1d2c808ce16a894239 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 21 Apr 2024 13:54:28 +0200 Subject: Adding upstream version 18.2.2. Signed-off-by: Daniel Baumann --- src/common/options/CMakeLists.txt | 112 + src/common/options/build_options.cc | 53 + src/common/options/build_options.h | 8 + src/common/options/ceph-exporter.yaml.in | 54 + src/common/options/cephfs-mirror.yaml.in | 94 + src/common/options/crimson.yaml.in | 119 + src/common/options/global.yaml.in | 6396 +++++++++++++++++++++ src/common/options/immutable-object-cache.yaml.in | 98 + src/common/options/legacy_config_opts.h | 11 + src/common/options/mds-client.yaml.in | 580 ++ src/common/options/mds.yaml.in | 1536 +++++ src/common/options/mgr.yaml.in | 362 ++ src/common/options/mon.yaml.in | 1340 +++++ src/common/options/osd.yaml.in | 1415 +++++ src/common/options/rbd-mirror.yaml.in | 210 + src/common/options/rbd.yaml.in | 881 +++ src/common/options/rgw.yaml.in | 3770 ++++++++++++ src/common/options/validate-options.py | 49 + src/common/options/y2c.py | 366 ++ 19 files changed, 17454 insertions(+) create mode 100644 src/common/options/CMakeLists.txt create mode 100644 src/common/options/build_options.cc create mode 100644 src/common/options/build_options.h create mode 100644 src/common/options/ceph-exporter.yaml.in create mode 100644 src/common/options/cephfs-mirror.yaml.in create mode 100644 src/common/options/crimson.yaml.in create mode 100644 src/common/options/global.yaml.in create mode 100644 src/common/options/immutable-object-cache.yaml.in create mode 100644 src/common/options/legacy_config_opts.h create mode 100644 src/common/options/mds-client.yaml.in create mode 100644 src/common/options/mds.yaml.in create mode 100644 src/common/options/mgr.yaml.in create mode 100644 src/common/options/mon.yaml.in create mode 100644 src/common/options/osd.yaml.in create mode 100644 src/common/options/rbd-mirror.yaml.in create mode 100644 src/common/options/rbd.yaml.in create mode 100644 src/common/options/rgw.yaml.in create mode 100755 src/common/options/validate-options.py create mode 100755 src/common/options/y2c.py (limited to 'src/common/options') diff --git a/src/common/options/CMakeLists.txt b/src/common/options/CMakeLists.txt new file mode 100644 index 000000000..f12a5513a --- /dev/null +++ b/src/common/options/CMakeLists.txt @@ -0,0 +1,112 @@ +set(common_options_srcs build_options.cc) +set(legacy_options_headers) +set(options_yamls) + +# to mimic the behavior of file(CONFIGURE ...) +file(GENERATE OUTPUT configure_file.cmake + CONTENT "configure_file(\${input_file} \${output_file} @ONLY)") +function(file_configure input_file output_file) + set(cmake_defs + -D input_file=${input_file} + -D output_file=${output_file}) + file(STRINGS ${input_file} subvars REGEX "@[^@]+@") + foreach(line ${subvars}) + string(REGEX REPLACE ".*@([^@]+)@.*" "\\1" + var "${line}") + set(value ${${var}}) + list(APPEND cmake_defs -D ${var}=${value}) + endforeach() + add_custom_command(OUTPUT ${output_file} + COMMAND ${CMAKE_COMMAND} ${cmake_defs} -P configure_file.cmake + DEPENDS ${input_file} + VERBATIM) +endfunction() + +function(add_options name) + set(yaml_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${name}.yaml.in) + set(yaml_file ${CMAKE_CURRENT_BINARY_DIR}/${name}.yaml) + file_configure("${yaml_in_file}" + "${yaml_file}" @ONLY) + list(APPEND options_yamls ${yaml_file}) + set(options_yamls ${options_yamls} PARENT_SCOPE) + set(cc_file "${name}_options.cc") + set(h_file "${PROJECT_BINARY_DIR}/include/${name}_legacy_options.h") + add_custom_command(PRE_BUILD + OUTPUT ${cc_file} ${h_file} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/y2c.py + --input ${yaml_file} + --output ${cc_file} + --legacy ${h_file} + --name ${name} + DEPENDS ${yaml_file}) + list(APPEND common_options_srcs ${cc_file}) + set(common_options_srcs ${common_options_srcs} PARENT_SCOPE) + list(APPEND legacy_options_headers ${h_file}) + set(legacy_options_headers ${legacy_options_headers} PARENT_SCOPE) +endfunction() + +set(osd_erasure_code_plugins "jerasure" "lrc") +if(WITH_EC_ISA_PLUGIN) + list(APPEND osd_erasure_code_plugins "isa") +endif() +string(REPLACE ";" " " osd_erasure_code_plugins "${osd_erasure_code_plugins}") + +set(keyring_paths + "/etc/ceph/$cluster.$name.keyring" + "/etc/ceph/$cluster.keyring" + "/etc/ceph/keyring" + "/etc/ceph/keyring.bin") +if(FREEBSD) + list(APPEND keyring_paths + "/usr/local/etc/ceph/$cluster.$name.keyring" + "/usr/local/etc/ceph/$cluster.keyring" + "/usr/local/etc/ceph/keyring" + "/usr/local/etc/ceph/keyring.bin") +endif() +string(REPLACE ";" "," keyring_paths "${keyring_paths}") + +set(ms_bind_retry_count 3) +set(ms_bind_retry_delay 5) +if(FREEBSD) + # FreeBSD does not use SO_REAUSEADDR so allow for a bit more time per default + set(ms_bind_retry_count 6) + set(ms_bind_retry_delay 6) +endif() + +set(mgr_disabled_modules "") +if(WITH_MGR) + # https://tracker.ceph.com/issues/45147 + if(Python3_VERSION VERSION_EQUAL 3.8) + set(mgr_disabled_modules "diskprediction_local") + message(STATUS "mgr module disabled for ${Python3_VERSION}: ${mgr_disabled_modules}") + endif() +endif() + +add_options(global) +add_options(cephfs-mirror) +add_options(crimson) +add_options(mgr) +add_options(mds) +add_options(mds-client) +add_options(mon) +add_options(osd) +add_options(rbd) +add_options(rbd-mirror) +add_options(immutable-object-cache) +add_options(ceph-exporter) + +# if set to empty string, system default luarocks package location (if exist) will be used +set(rgw_luarocks_location "") +if(WITH_RADOSGW_LUA_PACKAGES) + set(rgw_luarocks_location "/tmp/luarocks") +endif() +add_options(rgw) + +add_library(common-options-objs OBJECT + ${common_options_srcs}) +add_custom_target(legacy-option-headers + DEPENDS ${legacy_options_headers}) + +include(AddCephTest) +add_ceph_test(validate-options + ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/validate-options.py ${options_yamls}) diff --git a/src/common/options/build_options.cc b/src/common/options/build_options.cc new file mode 100644 index 000000000..867fc2efd --- /dev/null +++ b/src/common/options/build_options.cc @@ -0,0 +1,53 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + +#include "build_options.h" + +#include +#include + +std::vector