Commit Graph

505 Commits

Author SHA1 Message Date
Kefu Chai
8e7f49c256
Merge pull request #45978 from tchaikov/wip-cmake-python3-exact
cmake/modules: use exact version of python3 when finding cython

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2022-04-22 07:10:02 +08:00
Kefu Chai
ea4ae6d2f1 cmake/modules: use exact version of python3 when finding cython
* CMakeLists.txt:
    always pass "EXACT" to find_package(Python3).
    because per cmake document, "EXACT" only takes effect when
    <Package>_FIND_VERSION_COUNT is greater than 1, where <Package>
    is "Python3". see also cmake/modules/FindPython/Support.cmake
* cmake/modules/AddCephTest.cmake:
    drop redundant find_package(Python3) calls. since Python3 is
    a mandatory requirement for building Ceph, we only need a
    single call of find_package(Python3..) in the top of the source
    tree. the only possible case to repeat it is to ensure that we
    have the correct version of Python3 used in following CMake
    script. but there is no need to repeat it if we just want to
    ensure that we have a python3 interpretor in place.
* cmake/modules/Distutils.cmake:
    always pass "EXACT" to find_package(Python3).
    we should always pass EXACT to find_package() when finding python3,
    this is a follow-up of e2babdfae8

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2022-04-21 06:52:18 +08:00
Kefu Chai
c51b3c3a17 cmake: try to find dml only if PMEM is enabled
as the feature dependent on DML library requires PMEM backend.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2022-04-21 06:28:09 +08:00
Ziye Yang
86cb8c75c3 Add the support to use DML library for PMEM device.
The purpose of this patch is to add the initial support to
offload memory/pmem operations by sync usage through hardware path
in DML library.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2022-04-19 14:51:12 +08:00
Ilya Dryomov
226e614c95 cmake: resurrect mutex debugging in all Debug builds
Commit 403f1ec288 ("cmake: make "WITH_CEPH_DEBUG_MUTEX" depend on
CMAKE_BUILD_TYPE") made WITH_CEPH_DEBUG_MUTEX depend on build type
being set to Debug, in CMakeLists.txt.  However, if CMAKE_BUILD_TYPE
isn't specified by the user, we may still set it to Debug later, in
src/CMakeLists.txt, and in that case WITH_CEPH_DEBUG_MUTEX doesn't
get enabled.  The result is that

  $ do_cmake.sh -DCMAKE_BUILD_TYPE=Debug ...

debug builds have mutex debugging enabled, while

  $ do_cmake.sh ...

builds, which are supposed to be the same, don't.  Jenkins builders
don't pass -DCMAKE_BUILD_TYPE=Debug so that commit effectively turned
off all ceph_mutex_is_locked* asserts in "make check".

Fixes: https://tracker.ceph.com/issues/55318
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2022-04-13 15:42:21 +02:00
Casey Bodley
90662cad56 cmake: WITH_SYSTEM_UTF8PROC defaults to OFF
change the default value of WITH_SYSTEM_UTF8PROC from ON to OFF, so that
centos/rhel users can build with the default cmake configuration. no other
WITH_SYSTEM_* variable in ceph defaults to ON, so this is consistent
with other bundled libraries like boost and rocksdb

unfortunately, this also means that users that do have system packages
must opt-in to using them with -DWITH_SYSTEM_UTF8PROC=ON

both deb and rpm builds dependended on the previous default value, so
their logic was negated to match the new default

Fixes: https://tracker.ceph.com/issues/55114

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-03-29 17:49:18 -04:00
Casey
ed60aeed0b cmake: add WITH_SYSTEM_ARROW to skip submodule build
relies on a hack to find the installed ParquetConfig.cmake

Signed-off-by: Casey <cbodley@redhat.com>
2022-03-14 10:19:02 -04:00
Casey Bodley
b10364dc21 cmake: add submodule for utf8proc at v2.2.0
adds utf8proc submodule, needed by the arrow submodule in centos. add a
WITH_SYSTEM_UTF8PROC option that controls whether or not utf8proc is
built from submodule

non-system utf8proc is built as a static library to avoid conflicts with
system-provided libraries

ceph.spec.in sets WITH_SYSTEM_UTF8PROC=OFF until it's available in
centos

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-03-14 10:19:02 -04:00
Casey Bodley
2ca6d75521 cmake: add submodule for Apache Arrow at v6.0.1
adds an arrow submodule. when WITH_RADOSGW_SELECT_PARQUET is enabled,
the submodule is built as an external project and rgw links against its
imported Arrow::Parquet target

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-03-14 10:19:02 -04:00
Casey Bodley
12555ea6e5 cmake/rgw: remove detection for curl_multi_wait
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-03-01 13:27:42 -05:00
Miaomiao Liu
9a9001a08f compressor: fix compilation issues about QATzip
Signed-off-by: Miaomiao Liu <miaomiao.liu@intel.com>
Signed-off-by: Hualong Feng <hualong.feng@intel.com>
2022-02-18 17:45:30 +08:00
Miaomiao Liu
082dcf0a58 cmake: replace BuildQatDrv.cmake with FindQatDrv.cmake
because QAT driver with version v1.7.l.4.14.0 or higher cannot be dowmloaded
directly by URL, FindQatDrv.cmake can find the locally installed QAT package and libraries

Signed-off-by: Miaomiao Liu <miaomiao.liu@intel.com>
Signed-off-by: Hualong Feng <hualong.feng@intel.com>
2022-02-08 14:06:07 +08:00
Arthur Outhenin-Chalandre
98236e3a1d
mgr/dashboard: monitoring: refactor into ceph-mixin
Mixin is a way to bundle dashboards, prometheus rules and alerts into
jsonnet package. Shifting to mixin will allow easier integration with
monitoring automation that some users may use.

This commit moves `/monitoring/grafana/dashboards` and
`/monitoring/prometheus` to `/monitoring/ceph-mixin`. Prometheus alerts
was also converted to Jsonnet using an automated way (from yaml to json
to jsonnet). This commit minimises any change made to the generated files
and should not change neithers the dashboards nor the Prometheus alerts.

In the future some configuration will also be added to jsonnet to add
more functionalities to the dashboards or alerts (i.e.: multi cluster).

Fixes: https://tracker.ceph.com/issues/53374
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
2022-02-03 13:08:20 +01:00
Andriy Tkachuk
bf24c479b9 rgw: add CORTX Motr SAL implementation
To build with Motr backend, use -DWITH_RADOSGW_MOTR=YES cmake
option. cortx-motr-devel rpm should be installed beforehand.

To connect to Motr cluster, add the following configuration
parameters to ceph.conf:

    [client]
            ...
            rgw backend store = motr
            motr profile fid  = 0x7000000000000001:0x4f
            motr ha endpoint  = inet:tcp:10.0.0.1@2001
    ...
    [client.rgw.8000]
            ...
            motr my endpoint  = inet:tcp:10.0.0.1@5001
            motr my fid       = 0x7200000000000001:0x29

The correct values for the Motr connection parameters can be
taken from `hctl status` cmd output after Motr cluster is
bootstrapped. In the example above, the values were taken from
the following output:

    Profile:
        0x7000000000000001:0x4f
    Services:
        centos8n1
        [started] hax       0x7200000000000001:0x6  inet:tcp:10.0.0.1@5001
        ...
        [unknown] m0_client 0x7200000000000001:0x29 inet:tcp:10.0.0.1@5001

Motr pkgs for the build/run can be taken from
https://github.com/Seagate/cortx-motr/releases/tag/2.0.0-rgw.

Co-authored-by: Sining Wu <sining.wu@seagate.com>

Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
2022-01-27 10:45:25 +00:00
Casey Bodley
077e234b74 cmake: disable parquet by default
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-01-14 14:50:47 -05:00
Samuel Just
fa08f32a53
Merge pull request #44410 from tchaikov/wip-cmake-cleanup
cmake: detect linux/blk/zoned support

Reviewed-by: Samuel Just <sjust@redhat.com>
2022-01-10 13:36:09 -08:00
Kefu Chai
76c35c6dd9 cmake: detect linux/blk/zoned support
* add find_package() support for detecting the existence of
  linux/blkzoned.h before using it.
* link against Linux::ZNS for adding the compilation definition of
  HAVE_ZNS instead of including it in the global config.h
* move the CMake option closer to where it is used for
  better readability. as this option takes effect only if
  crimson is compiled.
* make WITH_ZNS an option which depends on the value of
  CMAKE_SYSTEM_NAME. it is hidden and off if CMAKE_SYSTEM_NAME
  is not "Linux".

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2021-12-25 16:13:47 +08:00
Kefu Chai
997715e259 cmake: use new CMP0127 policy
CMP0127 is a new policy introduced by CMake 3.22. without specifying
the policy, we'd have following warning when configuring the building
system using CMake 3.22:

CMake Warning (dev) at /usr/share/cmake-3.22/Modules/CMakeDependentOption.cmake:84 (message):
  Policy CMP0127 is not set: cmake_dependent_option() supports full Condition
  Syntax.  Run "cmake --help-policy CMP0127" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  CMakeLists.txt:255 (CMAKE_DEPENDENT_OPTION)
This warning is for project developers.  Use -Wno-dev to suppress it.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2021-12-19 15:02:10 +08:00
Samuel Just
7d5e7cfcfc
Merge pull request #44197 from josephsawaya/zns-segment-manager
crimson/os/seastore: add ZNSSegmentManager

Reviewed-by: Samuel Just <sjust@redhat.com>
2021-12-15 18:30:08 -08:00
Joseph Sawaya
84b040ba7d crimson/os/seastore: add ZNSSegmentManager
This commit adds the ZNSSegmentManager, so SeaStore can
interface with ZNS devices using the linux/blkzoned
library.

Signed-off-by: Joseph Sawaya <jsawaya@redhat.com>
2021-12-14 20:27:59 +00:00
Yuri Weinstein
ebb64e4a3d
Merge pull request #43612 from adamemerson/wip-unleveling
build: Remove LevelDB support

Reviewed-by: Kefu Chai <kchai@redhat.com>
2021-12-10 15:33:05 -08:00
Adam C. Emerson
447564e4db build: Remove LevelDB support
Whereas new LevelDB packages are build with -fno-rtti and break our
attempts to compile against them,

and whereas LevelDB has been deprecated for some time, with the Ceph
team expending great effort to migrating OSDs off of it,

let it be therefore removed.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2021-11-01 12:42:17 -04:00
Sebastian Wagner
b830c555d2 monitoring/prometheus: Add cmake integration
Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
2021-10-22 13:37:31 +13:00
Soumya Koduri
963e8c05b7 rgw/dbstore: Fix DBstore build conflicts
Fixing build conflicts with latest sal multipart/writer changes.
Also enable WITH_RADOSGW_DBSTORE option by default.

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
2021-08-05 14:27:19 +05:30
Kefu Chai
065ff536a1 cmake: disable kvs rados cls by default
libcls_kvs was introduced back in
73d016fdb3, but we don't have an internal
user so far. to reduce the build time. let's disable the build of it by
default.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-08-04 10:21:10 +08:00
Ilya Dryomov
8248fbe2e4
Merge pull request #42570 from tchaikov/wip-libcryptsetup
librbd/crypto/luks: require libcryptsetup v2.0.5

Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
2021-08-02 21:35:16 +02:00
Kefu Chai
8de47b212b librbd/crypto/luks: require libcryptsetup v2.0.5
- ubuntu focal ships libcryptsetup-dev (2:2.2.2),
- centos 8 app stream comes with cryptsetup-devel-2.3.3.
- openSUSE Leap 15.3 packages libcryptsetup-devel-2.3.4
- openSUSE Leap 15.2 packages libcryptsetup-devel-2.0.5

so we can drop the support for libcryptsetup < 2.0.5

see also ea3c1bfb9e

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-07-31 11:24:58 +08:00
Soumya Koduri
0d1868805b rgw/dbstore: Use CEPH RGW logging in ceph context
When running dbstore as RGW backend, use the logging mechanism
and config values provided by default by RGW.
For other tests, set logfile and loglevel to the input values provided.

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
2021-07-28 12:15:07 +05:30
Soumya Koduri
67be96413d rgw/dbstore: DB backend for RGW
As part of Zipper, adding support for DB backend (using SQLite) for Stackable RGW.

The base class methods implemented are generic which could be extended to any backend database, not just SQLite.

More details on design/implementation can be found at -
https://docs.google.com/document/d/1xCoHT5DCujqbe1pnEfYpSaSqiBcW8z87CgQCC5LivOo/edit#

Current status:

[Done]
- User related APIs
- Bucket APIs
- Testcases (using Gtest) to test the DBStore APIs

[Not handled in the first pass]
- Quota
- Usage Stats
- Swift Users
- Multiple Zones/Zonegroups

[WIP]
- Object APIs

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
2021-07-28 12:10:16 +05:30
Kefu Chai
1c3c42fe52 cmake: s/OPENLDAP/OpenLDAP/
the upstream project of OpenLDAP is named "OpenLDAP", so rename OPENLDAP to
OpenLDAP for better readability.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-07-24 19:28:56 +08:00
Kefu Chai
aecb0bf250
Merge pull request #42448 from tchaikov/wip-rgw-lua-fs
rgw/rgw_lua: s/boost::filesystem/std::filesystem/

Reviewed-by: Yuval Lifshitz <ylifshit@redhat.com>
2021-07-24 19:12:26 +08:00
Kefu Chai
af79875460
Merge pull request #42255 from tchaikov/wip-cmake-mgr-cleanup
cmake: install mgr module separately

Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Reviewed-by: Sebastian Wagner <sewagner@redhat.com>
2021-07-23 09:51:52 +08:00
Kefu Chai
71e20279e9 rgw/rgw_lua: s/boost::filesystem/std::filesystem/
for less dependencies on 3rd party libraries, and to reduce the
compilation time.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-07-22 16:49:30 +08:00
Kefu Chai
e3245d12a0 cmake: s/NPM/NPM_EXECUTABLE/
so the naming is more consistent with other executables found by
find_program().

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-07-22 16:35:57 +08:00
Kefu Chai
b11d77a178
Merge pull request #42401 from tchaikov/wip-cmake-version
cmake: drop set(VERSION ...)

Reviewed-by: Guillaume Abrioux <gabrioux@redhat.com>
2021-07-22 08:58:10 +08:00
Kefu Chai
c7930b0a06 cmake: use string(APPEND ...) to concat strings
less repeating this way.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-07-20 20:20:06 +08:00
Kefu Chai
18cad0acb9 cmake: drop set(VERSION ...)
project(...). this is the authentic place to set version number.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-07-20 01:24:09 +08:00
Kefu Chai
0270f73e6e cmake: do not check policies introduced before 3.16
see

- https://cmake.org/cmake/help/latest/policy/CMP0065.html
- https://cmake.org/cmake/help/latest/policy/CMP0074.html
...
- https://cmake.org/cmake/help/latest/policy/CMP0093.html

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-07-19 14:43:08 +08:00
Kefu Chai
e33dfa7557 cmake: use add_compile_options() to pass compile options
add_definitions() is for adding "-D" define flags, while "-include" does
not define flags, so let's be explicit and use add_compile_options()
instead.

this change partially reverts 5fb90bb796.
back then, we were using ubuntu bionic for building windows packages.
but since we've switched to ubuntu focal, where cmake 3.16 is available,
there is no reason to stick with add_definitions() anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-07-19 14:43:08 +08:00
Kefu Chai
f2f7dfbdab cmake: require CMake v3.16
since we dropped the support of bionic, we now have the luxury of using
newer CMake! and by using CMake 3.16, we now have access to

* add_compile_definitions(), which was introduced in cmake 3.12

also, drop the comment of

> remove cmake/modules/FindPython* once 3.12 is required

because we need to support python 3.10 in future, better off keeping
the FindPython files around, so we can backport cmake changes from
upstream when necessary.

we are allowed to bump up the CMake's required to 3.16, because:

- ubuntu focal ships with cmake 3.16.3
- RHEL/CentOS8's AppStream has cmake 3.18

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-07-19 13:16:49 +08:00
Ilya Dryomov
eb953c1c0d
Merge pull request #41340 from tchaikov/wip-ceph-allocator
librbd: do not use ceph::allocator<>

Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
2021-05-20 16:40:14 +02:00
Casey Bodley
bf33951219 rgw: building the beast frontend is no longer optional
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2021-05-17 15:00:33 -04:00
Casey Bodley
a335304042 rgw: remove the fcgi frontend
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2021-05-17 15:00:33 -04:00
Kefu Chai
8b19c0aef7 librbd: do not use ceph::allocator<>
ceph::allocator was originally introduced to address
https://tracker.ceph.com/issues/39703, so that if tcmalloc < 2.6.2
detected, the homebrew allocator is used. otherwise std::allocator would
use the aligned_alloc() function which was not implemented by tcmalloc <
2.6.2. but the fix in tcmalloc implementing aligned_alloc() was
introduced in https://github.com/gperftools/gperftools/commit/d406f228.
that fix was included since gperftools 2.6.2.

- CentOS/RHEL8 includes gperftools 2.7,
- fedora 33 includes gperftools 2.8,
- ubuntu/focal comes with libgoogle-perftools-dev 2.7
- ubuntu/bionic ships libgoogle-perftools-dev 2.5. but since we
  detect libtcmalloc 2.6.2, when building on bionic, JeMalloc
  or libc allocator is used as fallback.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-14 21:45:26 +08:00
Lucian Petrut
0af38d179e win*.sh,cmake: Fix Windows linking errors
The Windows build is hitting linking errors after
bumping the Boost version to 1.75. The issue is that Boost
is now setting the zlib dependecy using INTERFACE_LINK_LIBRARIES,
which means that it's no longer located using the standard
"find_package" mechanism.

In order for the linker to locate zlib, we'll add it to the
linker search path.

[1] https://github.com/boostorg/boost_install/issues/47

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2021-05-07 09:23:30 +00:00
Kefu Chai
63d50348c6 cmake: let WITH_MGR_ROOK_CLIENT depend on WITH_MGR
it does not depend on WITH_MGR_DASHBOARD_FRONTEND, which is disabled by
default and is used for enable/disable the inclusion of dashboard
support. while root client is used by orchestrator. so it should depend
on WITH_MGR not WITH_MGR_DASHBOARD_FRONTEND.

this change addresses the regression introduced by
1003f1ffee

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-18 21:53:29 +08:00
Willem Jan Withagen
1003f1ffee cmake: Add an option for enabling rook client in dashboard
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
2021-04-15 10:40:17 +02:00
Kefu Chai
e09f8d7dd0
Merge pull request #40149 from tchaikov/wip-cmake-job-pool
cmake: use ninja job pool

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2021-04-14 15:06:50 +08:00
Kefu Chai
5ddda38da4 common: extract options into yaml
extract the options in common/options.cc into separate .yaml.in
files, and preprocess them using CMake before translating them into .cc
files using a python script.

this change paves the road to render the options using sphinx, and
will allow us to further annotate the options to include more metadata.

also, a this YAML file can be consumed by applications like dashboard
and Sphinx to consume these metadata in a simpler way.

* use @variable-name@ for substituting the variables in .yaml.in file
* use cmake variable of `mgr_disabled_modules` instead of C macro
  to define `mgr_disabled_modules` in global.yaml.in
* debian/control, ceph.spec.in, win32_deps_build.sh: add python3-yaml
  as build dep
* add y2c.py (short for YAML to C++) to translate .yaml to .cc file
* common/options/*.yaml.in: extract and split options into .yaml.in
  files, the subvars in it is then replaced with CMake variables,
  and copied to the corresponding .yaml files
* include/config-h.in.cmake: remove MGR_DISABLED_MODULES, as it
  is not a CMake variable.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-13 09:13:47 +08:00
Kefu Chai
8c44876be4 cmake: s/HAVE_MSGHDR/WITH_SYSTEMD/
as FreeBSD also has msghdr but it does not have systemd, or
flags like MFD_ALLOW_SEALING, O_TMPFILE or F_SEAL_GROW. so
use WITH_SYSTEMD for enabling journald backend of logging system.

also move the option of "WITH_SYSTEMD" up so that the src/CMakeLists.txt
is able to see the variable of WITH_SYSTEMD defined by it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-08 16:58:50 +08:00