Tone Zhang [Tue, 30 Jan 2018 00:55:38 +0000 (00:55 +0000)]
cmake: fix libcephfs-test.jar build failure
When building Ceph Debian installation package, libcephfs-test.jar
build would fail if multi junit versions are installed on the host.
In src/java/CMakeLists.txt, the "junit" search order is "junit"
and then "junit4". In case multi junit versions are installed,
the lower version (like 3.8) is found firstly, but junit4 is
required only. The search result will cause the failure.
Fix the issue by change search order to firstly search junit4
by default.
Fixes: http://tracker.ceph.com/issues/22828 Signed-off-by: Tone Zhang <tone.zhang@arm.com>
Jason Dillaman [Wed, 17 Jan 2018 18:40:13 +0000 (13:40 -0500)]
librbd: simplified retrieving snapshots from image header
Added a new cls 'snapshot_get' method that retrieves all snapshot
specific details to avoid the need to add a new cls method to
retrieve each individual snapshot data field.
The cls 'get_snapshot_namespace' method has been dropped since Luminous
clients will treat that as a user-generated snapshot (and that's all
that is supported by Luminous clients). The cls 'get_snapshot_timestamp'
method has been deprecated and can be removed once <=Luminous clients
are no longer supported.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Tue, 16 Jan 2018 18:20:31 +0000 (13:20 -0500)]
cls/rbd: renamed image group add/remove/get operations
The methods are used by the luminous release of librbd but are essentially
no-ops since group support was removed from the API. However, we need to
prevent odd interactions once a new client creates a group and uses an
older client to manipulate the image.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Kefu Chai [Tue, 23 Jan 2018 04:58:10 +0000 (12:58 +0800)]
cmake: build ceph-mgr with specified version of python
* add an option named "MGR_PYTHON_VERSION", so we can build ceph-mgr
which use py3 for running plugins
* also drop the line to specify the "Python_ADDITIONAL_VERSIONS", because
2.7 is listed by all the the FindPythonInterp and FindPythonLibs in
cmake 2.8.12 and up.
* use ${MGR_PYTHON_EXECUTABLE} for holding the path to the python
interpreter used by mgr. because this variable might be overwritten by
"find_package(PythonInterp 2 REQUIRED)" when checking for building env
of pybinding for python2.
Kefu Chai [Tue, 23 Jan 2018 05:01:31 +0000 (13:01 +0800)]
cmake: add WITH_PYTHON2 option
* add WITH_PYTHON2 option, so we can build python3 bindings only.
* change the default value of WITH_PYTHON3 option to "OFF", as the
option() command in cmake only allow the initial value to be "ON" or
"OFF". we could use a cached string for this option, but i think it
would be more explicit to continue using the option() command.
* fix the installation dir of "ceph_rest_api.py". please note, we still
have a *default* python version, which is specified by the last element
of ${py_vers}. for instance, ${PYTHON_VERSION} will be 3 if ${py_vers}
is 2;3. in this change, 2 is still the default python version, if both
WITH_PYTHON2 and WITH_PYTHON3 are enabled.
Nathan Cutler [Wed, 24 Jan 2018 08:17:29 +0000 (09:17 +0100)]
build/ops: rpm: introduce _python_buildid macro
This eliminates several ugly conditional blocks. This commit also does some
cleanup like dropping the ceph-base runtime dependency on "python", which is
implicit in "python-requests".
Nathan Cutler [Wed, 24 Jan 2018 04:51:05 +0000 (05:51 +0100)]
build/ops: rpm: python3-ceph-argparse only if Python 2 available
The python3-ceph-argparse package is only necessary in environments where
Python 3 might not be available. For distros where Python 3 has become
standard with Python 2 an optional extension (instead of vice versa as
in the current status quo), the files in this package can (and should)
be included in ceph-common directly.
Nathan Cutler [Thu, 19 May 2016 18:03:29 +0000 (20:03 +0200)]
build/ops: rpm: override %_smp_mflags if not enough memory
Sometimes the build machine has lots of processor cores and not enough
memory to successfully build Ceph on all of them at once. Calculate
how many parallel build processes we can sustain with the memory we
have and set a lower build parallelism if necessary. Never exceed
the value set by %_smp_mflags even if memory is aplenty.
Credits to Tomáš Chvátal for the original idea and implementation.
John Spray [Thu, 23 Nov 2017 13:01:33 +0000 (08:01 -0500)]
mgr: load command definitions earlier
...and for all modules, not just the active ones.
This enables us to give better feedback to the user
when they try and use a command from a disabled module,
and also fixes the race between enabling a module and
trying to use its commands.
Fixes: http://tracker.ceph.com/issues/21683 Signed-off-by: John Spray <john.spray@redhat.com>
John Spray [Thu, 16 Nov 2017 11:45:45 +0000 (06:45 -0500)]
mgr: load all modules (not just active ones)
This is to enable us to learn more about the module
before it is enabled, such as whether its can_run method
return true.
We can also use this to enable loading a module's
commands before it is enabled, to give the user
a better response when they try to use a command
belong to a module that is not loaded.
With this macro, we can use a single Source0 line for all supported distros.
RH/CentOS/Fedora needs the prefix, while SUSE builds in the OBS use a local
tarball.
John Spray [Tue, 23 Jan 2018 12:43:12 +0000 (07:43 -0500)]
mgr: apply auth_service_required to client conns
Previously was using auth_cluster_required for all
connections, which meant that if someone had
disabled client cephx, they'd get BADAUTHORIZER
from their CLI when it tried to load mgr
command descriptions.
Disabling cephx on the admin CLI is odd, but the mon
tolerates it so the mgr should too.
Fixes: https://tracker.ceph.com/issues/22096 Signed-off-by: John Spray <john.spray@redhat.com>
Nathan Cutler [Tue, 23 Jan 2018 11:30:57 +0000 (12:30 +0100)]
spdk: update submodule to more recent upstream
This commit fast-forwards the SPDK submodule to upstream commit 93bd60e0de6b161567182d965239735bf467e85c to enable the py3-only build.
(Without said commit, SPDK configure script fails to find the python
interpreter in py3-only environment.)
Added a "rbd trash purge" command that deletes any expired
image from the trash, has also a command to alter the current
expiration date with the "--older-than" argument which accepts
again a valid argument for /bin/date, e.g.:
$rbd trash purge mypool --older-than "2017-08-20"
There is also the "threshold" argument which tries to remove the
oldest trashed images (by deferment end time) until the pool space
is freed up to a percentage point, e.g.:
$ rbd trash purge mypool --threshold 0.9
If mypool uses 1GB it will try to remove trashed images until the
pool usage becomes equal to or lower than 900MB.