Commit Graph

400 Commits

Author SHA1 Message Date
Lucian Petrut
889247d557 include/compat: Add win32 compatibility layer
Windows provides socket and other related structures that are mostly
following the Posix standards, but using different headers.

Rather than adding lots of platform checks and require future commits
to do so as well, we're adding headers with the same names, which
in turn include the required Windows headers.

In a few cases, some functions declared by unistd.h are actually
defined by different Windows headers, so we'll need additional includes.

One thing to note here is that boost requires us to include aio.hpp
before the Windows socket headers.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2020-06-04 15:52:16 +00:00
Abutalib Aghayev
ab865ca002 os/bluestore: Enable writing data to HM-SMR hard drives.
Signed-off-by: Abutalib Aghayev <agayev@cs.cmu.edu>
2020-05-22 12:37:24 -04:00
Kefu Chai
47ce69aa57 cmake: remove cppcheck and iwyu targets
these targets are not used by any other targets, and are not integrated with CI.
so let's drop them.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-05-13 20:34:27 +08:00
Kefu Chai
067adbf9a0 mgr: do not load disabled modules
an option named "mgr_disabled_modules" is added in this change to
prevent mgr from loading modules listed in this option. because mgr
loads *all* modules found in the configured path, and per
https://tracker.ceph.com/issues/45147, python subinterpreter could hang
when loading numpy, so this behavior practically creates a deadlock
in mgr.

this issue is found when mgr uses python3.8 runtime. in development
environment, it'd be inconvenient to disable the offending mgr module
without changing the source code, even if we can choose to not install
them, for instance, the enduser can workaround this issue by
uninstalling `ceph-mgr-diskprediction-local`.

an option would be useful in this case, so we can add the module to the
list before mgr tries to load it.

as this issue is found with python3.8 + diskprediction_local (numpy), so
this mgr module is disabled by default if mgr is compiled with python3.8
runtime.

Fixes: https://tracker.ceph.com/issues/45147
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-30 19:11:22 +08:00
Kefu Chai
b557467df0
Merge pull request #34535 from changchengx/refine_build_liburing
cmake: refactor liburing support

Reviewed-by: Kefu Chai <kchai@redhat.com>
2020-04-18 11:39:32 +08:00
Changcheng Liu
36918d7f78 cmake: use cmake module to integrate liburing
1. WITH_LIBURING is used to set HAVE_LIBURING to decide
   use liburing in KernelDevice or not.
2. WITH_SYSTEM_LIBURING is to choose use system installed
   liburing or build the liburing from source code.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2020-04-17 23:22:56 +08:00
Kefu Chai
2b3adb5c5e cmake: rename Findfuse.cmake to FindFUSE.cmake
so its name is consistent with upstream name, and with the variables
exposed by FindFUSE.cmake.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-17 14:10:55 +08:00
Sage Weil
6d09963ec5 CMakeLists: 16.0.0
Signed-off-by: Sage Weil <sage@redhat.com>
2020-04-08 08:09:41 -05:00
Jianpeng Ma
9d76123fdf cmake: remove duplicated code.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
2020-04-08 11:08:02 +08:00
Sage Weil
895b856aee Merge remote-tracking branch 'gh/octopus' 2020-03-23 20:09:41 -05:00
Jenkins Build Slave User
dc6a0b5c3c 15.2.0 2020-03-23 17:47:45 +00:00
Adam C. Emerson
7f573bb334 build: Add WITH_BOOST_VALGRIND option
To build Boost.Context (and other libraries) with support to allow
them to be valground usefully, and to include the define to link
against them.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2020-03-20 00:51:49 -04:00
Jenkins Build Slave User
4536217610 15.1.1 2020-03-13 17:05:38 +00:00
Kefu Chai
f6389baff6 cmake: reduce the indent level
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-02-24 12:45:35 +08:00
Kefu Chai
a4e9566d23 cmake: use loop for applying new policies
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-02-24 12:32:54 +08:00
Lucian Petrut
d15481f1a5 cmake: [win32] Update cmake files
We'll update the cmake files in order to be able to build ceph
components for Windows targets.

Cross compiling using MINGW is the easiest approach for now.
Subsequently, we'll add support for Clang and MSVC.

This patch provides the following changes:
* include winsock2.h, which provides ntohl on Windows
* avoid unsupported compiler flags when using msvc
* add a custom toolchain file for mingw
* update install command for ceph-common in order to work with mingw
* avoid running test sample when cross compiling
* link against the ws_32 lib
* set argeted Windows version
* skip yasm checks when targeting Windows
* allow multiple redefinitions when using mingw, picking the first one.
  this is a workaround for a mingw TLS bug:
  https://sourceforge.net/p/mingw-w64/bugs/816/

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2020-02-19 08:24:21 +00:00
Sebastian Wagner
615381659c cmake: Integrate Rook client generation
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
2020-02-13 11:33:55 +01:00
Jenkins Build Slave User
49b0421165 15.1.0 2020-01-29 22:10:24 +00:00
Sage Weil
ef6ed98766 ceph_release: octopus rc 15.1.0
Signed-off-by: Sage Weil <sage@redhat.com>
2020-01-13 14:44:05 -06:00
Kefu Chai
5fc657b40d cmake: drop WITH_PYTHON2 option
* drop WITH_PYTHON2 option
* print warning message if WITH_PYTHON3 is disabled
* drop MGR_PYTHON_VERSION option, as we don't support use different
  python version for python binding and ceph-mgr embedded python
  interpreter anymore. as before switching to python3-only build,
  we can build python3 and python2 python bindings, and ceph-mgr
  can use either of them. but after switching to python3-only
  build, ceph-mgr has to use whatever python version used to
  build python binding.
* move WITH_PYTHON3 option to $top_srcdir/CMakeLists.txt, as ceph-mgr
  and python binding will share this option.
* hardware ${PYTHON_VERSION} to 3
* hardware ${Python${PYTHON_VERSION}_VERSION_MAJOR} to 3
* only build boost library with python3
* s/Python_EXECUTABLE/Python3_EXECUTABLE/
* update the build scripts and packagings accordingly
* rename all cython${PYTHON_VERSION}_* targets to cython_*
* update distutils_install_module() so it does not take python_version
  parameter anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-12-19 10:58:58 +08:00
Thomas Bechtold
0127cd1e88 qa: Enable flake8 tox and fix failures
There were a couple of problems found by flake8 in the qa/
directory (most of them fixed now). Enabling flake8 during the usual
check runs hopefully avoids adding new issues in the future.

Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
2019-12-12 10:21:01 +01:00
Roman Penyaev
2268be9ff9 os/bluestore: introduce new io_uring IO engine
This implements low-level IO engine, which utilizes brand-new
io_uring IO interface: https://lwn.net/Articles/776428/

By default libaio is used.  If bluestore_ioring=true is set but kernel
does not support io_uring or architecture is not x86-64, libaio will be
used instead.

In current patch liburing library is used in order not to open code
everything.

In order to compile with liburing WITH_LIBURING=ON should be specified.

Signed-off-by: Roman Penyaev <rpenyaev@suse.de>
2019-12-10 17:22:15 +08:00
Jason Dillaman
1d866ef37d
Merge pull request #31279 from lixiaoy1/rwl-image-writeback-cache-seq1
rbd/cache: Replicated Write Log core codes part 1

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2019-12-02 09:16:10 -05:00
Sage Weil
0e0a3853c9 Merge PR #31579 into master
* refs/pull/31579/head:
	cmake: add cppcheck and iwyu static analysis targets

Reviewed-by: Brad Hubbard <bhubbard@redhat.com>
2019-11-25 21:49:18 -06:00
lixiaoy1
242d391408 librbd: add the framework for RWL writeback cache
Signed-off-by: Peterson, Scott <scott.d.peterson@intel.com>
Signed-off-by: Li, Xiaoyan <xiaoyan.li@intel.com>
Signed-off-by: Lu, Yuan <yuan.y.lu@intel.com>
Signed-off-by: Chamarthy, Mahati <mahati.chamarthy@intel.com>
2019-11-21 04:02:50 -05:00
Yuval Lifshitz
c876a0d817 cmake: add cppcheck and iwyu static analysis targets
Signed-off-by: Yuval Lifshitz <yuvalif@yahoo.com>
2019-11-18 19:43:14 +02:00
Yuval Lifshitz
354d775e04 rgw/pubsub: add kafka notification endpoint
Signed-off-by: Yuval Lifshitz <yuvalif@yahoo.com>
2019-11-05 19:25:03 +02:00
Ilsoo Byun
a83a25c076 cmake: require RocksDB 5.14 or higher
error: ‘class rocksdb::Env’ has no member named ‘SetAllowNonOwnerAccess’
       opt.env->SetAllowNonOwnerAccess(false);
                    ^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Ilsoo Byun <ilsoobyun@linecorp.com>
2019-10-29 18:04:24 +09:00
Kefu Chai
d82ea5d738 cmake: refactor BuildDPDK
* extract `do_export_dpdk()` into a separated function
* no need to check for `dpdk-ext` target before calling `build_dpdk()`,
  as the name of this target should be hidden from the caller of this
  function.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-10-24 15:15:51 +08:00
Ricardo Dias
a398f985d4
Merge pull request #30694 from rjfd/wip-dashboard-fix-translations
mgr/dashboard: internationalization support with AOT enabled 

Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Tiago Melo <tmelo@suse.com>
2019-10-11 14:33:31 +01:00
Ricardo Dias
3fe39d4899
cmake: dashboard: support locale-dependent frontend builds
Fixes: https://tracker.ceph.com/issues/41988

Signed-off-by: Ricardo Dias <rdias@suse.com>
2019-10-10 15:30:54 +01:00
Willem Jan Withagen
f698f3c3ee cmake: Allow cephfs and ceph-mds to be build when building on FreeBSD
on FreeBSD keyutil absence prevents building KRBD and mount.
But on FreeBSD icephfs, ceph-fuse and ceph-mds do work, so we need
ceph-mds to be build.

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
2019-10-06 02:34:45 +02:00
Samuel Just
670e00a06a */CMakeLists: add EVENTTRACE as cmakedefine, require LTTNG
Because EVENTTRACE now implies LTTNG, also cleanup EVENTTRACE
conditions to assume LTTNG.

Also add missing eventtrace dependencies to rbd and
test/objectstore.

Signed-off-by: Samuel Just <sjust@redhat.com>
2019-09-27 15:55:18 -07:00
Kefu Chai
67bf182aa5 cmake: extract checks into CephChecks.cmake
also use case chosen in the macro definition as per suggested by cmake
document. see
https://cmake.org/cmake/help/latest/command/macro.html#invocation

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-09-11 12:47:26 +08:00
Kefu Chai
3234fb3982 cmake,run-make-check.sh,deb,rpm: disable SPDK by default
but we still enable it in `run-make-check.sh`

* cmake: disable SPDK by default
* run-make-check.sh: enable WITH_SPDK so at least we can ensure it
  builds
* deb,rpm: add uuid-dev / libuuid-devel as a "make check" dependency

Fixes: https://tracker.ceph.com/issues/41330
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-20 15:38:33 +08:00
Kefu Chai
6fb738abb9 cmake: make WITH_SPDK a dependent option
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-20 15:38:33 +08:00
Kefu Chai
bbb69fe793 cmake: require CMake v3.10.2
since we dropped the support of xenial, we now have the luxury of using
newer CMake! and by using CMake 3.10.2, we can prevent libfmt from
assuming that we are using C++11, and hence set `CMAKE_CXX_STANDARD` to
11, which will literally append `-std=gnu++11` to `CMAKE_CXX_FLAGS`.
the last `-std` option passed to `g++` takes precendence.
since we've switched over to C++17, and we are using C++17 features.
so, using cmake older than 3.8 breaks the build. because it is CMake 3.8
which stared support `CMAKE_CXX_STANDARD` 17.

- for bionic: https://packages.ubuntu.com/bionic/cmake : 3.10.2
- for CentOS7:
https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/c/ : 3.13.5

so in this change,

* bump up the required version to v3.10.2
* cleanups to wipe out the workaround for lower CMake versions
* use `PROJECT_VERSION` defined by `project()` command instead of
  `VERSION` explicitly defined.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-02 22:09:12 +08:00
Kefu Chai
1e33464c0a cmake: use exact version of python if minor version is specified
`find_package(Python ${version}...)` tries to find the greater python version
which is greater than `${version}`, on fc30, at the time of writing, both
python3.8 and python3.7 are offered. but `python3-Cython` is packaged only
for python3.7. so if user installs python3.8, this will prevent user from
building Ceph. as Ceph will not be able to find Cython python module, as it
will try to run `python3.8 -m cython --version`, where python3.8 is the
greatest python version available in the system. but since cython module is
not available to python3.8, cmake will fail to find cython even if is available
to python3.7.

in this change, if user specifies a python version with minor version, we
will use the exact specified version instead of trying to use a version
greater than the specified one.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-07-24 00:45:22 +08:00
Kefu Chai
492efbd694 cmake: use python2 by default
and s/PYTHON_EXECUTABLE/Python_EXECUTABLE/

it's a regression introduced by 5e2bd7fc4d

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-07-22 16:07:56 +08:00
Kefu Chai
5e2bd7fc4d cmake: update FindPython* modules
use the ones shiped from the latest cmake. which

* enables us to find the recent python intepreter and development files,
* find intepreter and development in a single `find_pacakge()` command,
  simpler this way and less error prone.

and to accomodate this change:

* all `PYTHON${PYTHON_VERSION}_*` variables are renamed to
  `Python${PYTHON_VERSION}_*` if we use `find_package(Python2...)` or
  `find_package(Python3...)` to find python2 or python3 instead of using
  `find_package(Python...)`.
* use "2" explicitly when using python2, as `Python_*` variables are not
  defined anymore
* when compiling python support of ceph-mgr, continue using `Python_*`
  variables. because we find the python interpreter and development
  files using `find_pacakge(Python...)` for ceph-mgr.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-07-20 22:35:07 +08:00
Kefu Chai
7910bd6f02
Merge pull request #28802 from lixiaoy1/cmake_pmdk
cmake: pmem/pmdk changes to cmake

Reviewed-by: Kefu Chai <kchai@redhat.com>
2019-07-12 14:55:34 +08:00
lixiaoy1
4959835c07 cmake: Add the support to use system PMDK library
Signed-off-by: Scott Peterson <scott.d.peterson@intel.com>
Signed-off-by: Xiaoyan Li <xiaoyan.li@intel.com>
2019-07-10 11:43:27 -04:00
lixiaoy1
d994f02d69 cmake: update HAVE_PMEM to HAVE_BLUESTORE_PMEM
Signed-off-by: Scott Peterson <scott.d.peterson@intel.com>
Signed-off-by: Xiaoyan Li <xiaoyan.li@intel.com>
2019-07-10 11:43:05 -04:00
Kefu Chai
a4ddc4bd85
Merge pull request #27834 from rzarzynski/wip-nss-drop-cms
rgw, common, build: drop NSS support

Reviewed-by: Casey Bodley <cbodley@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2019-07-05 11:03:33 +08:00
Kefu Chai
d0d8932506 CMakeLists.txt: s/Remote block storage/RADOS Block Device/
RBD is short for RADOS Block Device, not Remote Block Storage.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-06-29 23:47:48 +08:00
Kefu Chai
1400867d92 CMakeLists.txt: fix typo in error message
krbd depends on rbd, so we cannot build krbd without rbd.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-06-29 23:35:48 +08:00
Radoslaw Zarzynski
b9986374aa build, common, crypto, rgw: drop USE_OPENSSL as OpenSSL is obligatory.
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2019-06-26 22:11:29 +02:00
Radoslaw Zarzynski
79edb93d06 common, crypto, build: get rid of NSS entirely.
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2019-06-26 22:10:17 +02:00
Casey Bodley
13b07e5e6b cmake: fix WITH_UBSAN
CMake Error at cmake/modules/FindSanitizers.cmake:28 (message):
  Unsupported sanitizer: undefined-behavior

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2019-06-24 11:35:27 -04:00
Kefu Chai
c028de2f93 cmake: rewrite Findgenl to support components argument
* rename genl to nl:
  "genl" is not very specific without more context. and libnl is actually
  a library suite. so it would be better if we can rename the library to
  be found to "libnl", and by following the naming convention of CMake,
  in this change, Findgenl.cmake is renamed to Findnl.cmake
* Findnl.cmake: support the component argument, in our specific case,
  what we want is "libnl-genl" library, which is one of the libraries
  offered by libnl. so let's just make it a component.
* Findnl.cmake: should pass the names of the required variables instead of
  their values to `find_package_handle_standard_args()`. before this
  change, we pass `GENL_LIBRARIES` to this function. it was correct at the
  first glance. but it is not able to handle the case where case where
  libnl-genl is not installed. so the fix is to pass all the names of
  required library paths to this function. in this change, their name
  are concatenated to a single variable -- `nl_LIBRARIES`, and the
  value of this variable is passed to
  `find_package_handle_standard_args()`. and the error message would
  be more specific this way if libnl-genl is not found:
    Could NOT find nl (missing: nl_genl_LIBRARY)
* Findnl.cmake: add nl::<component> as imported library, it helps the
  consumer of these libraries to import them -- no need to
  specify the `target_include_directories()` separately anymore.
* move the find_package() code to where it is used. it helps to improve
  the readability.
* remove `HAVE_GENL` variable: it's not used anywhere.
* drop the messages of "Not using foobar", they do not help.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-06-19 21:21:00 +08:00