Sage Weil [Tue, 27 Jul 2021 18:11:56 +0000 (14:11 -0400)]
Merge PR #42406 into master
* refs/pull/42406/head:
mgr/nfs: remove unused 'realm' arg for 'nfs export create rgw'
doc/mgr/rook: update title
doc/mgr/nfs: reference customizing ingress
doc/mgr/nfs: add section for manual ganesha config; reframe
doc/mgr/nfs: document ingress in more detail
doc/mgr/nfs: typo
doc/mgr/nfs: add note about incomplete ingress
qa/suites/orch/cephadm: add rgw nfs export test
mgr/cephadm: ingress: tolerate no daemons
mgr/nfs: add --squash option to 'nfs export create rgw ...'
mgr/nfs: use bucket owner creds for rgw bucket export
mgr/cephadm: use new CEPH_IMAGE_TYPES for all daemons using ceph container image
qa/tasks/python: simple task to run python code
doc/mgr/nfs: revisions
mgr/nfs/export: nicer exceptions on cap update
test/test_intarith: adapt to the change in intarith.h
back in 2623fec1cdd5fd9b15ee67c4b115385c67129ef4, the vaiants of, for
instance, ctz() are consolidated to a single template. so the
ctz<>() dispatches by the size of argument after that change.
but the tests were not updated accordingly.
in this change:
* the tests are updated to use the template.
* instead of using integer literal postfix, use the macros like
UINT64_C to define integer constants for better portability on
different architectures where the lengths of integer *might* be
different from amd64. also, it's more readable than postfixes
like ULL in this context, as we really care about the exact
length of an integer in this context when counting the leading
zeros.
common/bloom_filter: return by return values not by input params
it'd be easier for the static analyzer (like GCC), to reason about if
a variable is initialized before being used.
this change also helps to improve the readability, and to silence the
false alarm like:
In file included from ../src/os/bluestore/BlueStore.h:42,
from ../src/os/bluestore/BlueStore.cc:26:
../src/common/bloom_filter.hpp: In member function 'void std::vector<_Tp, _Alloc>::_M_fill_insert(std::vector<_Tp, _Alloc>::iterator, std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = bloom_filter; _Alloc = mempool::pool_allocator<mempool::mempool_bluestore_fsck, bloom_filter>]':
../src/common/bloom_filter.hpp:118:46: warning: '*((void*)(& __tmp)+8).bloom_filter::table_size_' may be used uninitialized in this function [-Wmaybe-uninitialized]
118 | mempool::bloom_filter::alloc_byte.deallocate(bit_table_, table_size_);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
this change silences following false positive warning:
In file included from ../src/include/encoding.h:41,
from ../src/kv/KeyValueDB.h:12,
from ../src/os/bluestore/bluestore_common.h:20,
from ../src/os/bluestore/BlueFS.cc:5:
../src/include/denc.h: In function ‘std::enable_if_t<(is_same_v<T, bluefs_extent_t> || is_same_v<T, const bluefs_extent_t>)> _denc_friend(T&, P&) [with T = bluefs_extent_t; P = ceph::buffer::v15_2_0::p$
../src/include/denc.h:639:11: warning: ‘shift’ may be used uninitialized in this function [-Wmaybe-uninitialized]
639 | shift += 7;
| ~~~~~~^~~~
../src/include/denc.h:613:7: note: ‘shift’ was declared here
613 | int shift;
| ^~~~~
Sage Weil [Mon, 19 Jul 2021 17:46:38 +0000 (13:46 -0400)]
mgr/nfs: use bucket owner creds for rgw bucket export
The bucket owner can always read/write to the bucket, so use those creds
for the export. This is less complicated than setting up a dedicated
user anyway.
replace strict_iecstrtoll(const char *str,..) with
strict_iecstrtoll(std::string_view, ..). which is more convenient.
and both of them share the same implementation:
strict_sistrtoll() is but an alias of strict_si_cast<uint64_t>(..),
let's just drop the former. there are way too many thin wrappers in
strtol.{h,cc}. they don't offer lots of benefit to us.
this variant is better than strict_si_cast(const char*), because:
* we can just pass std::string to it, as std::string_view can be
constructed from a std::string implicitly
* strict_si_cast(std::string_view, ..) is the underlying
implementation of strict_si_cast(const char*,..), so less
indirection helps with the readability.
rgw,mon,common/strtol: use strict_iec_cast(std::string_view, ..)
this variant is better than strict_iec_cast(const char*), because:
* we can just pass std::string to it, as std::string_view can be
constructed from a std::string implicitly
* strict_iec_cast(std::string_view, ..) is the underlying
implementation of strict_iec_cast(const char*,..), so less
indirection helps with the readability.
* rgw,mon: use strict_iec_cast(std::string_view, ..) instead.
vstart.sh: set objectstore to "cyanstore" if --cyanstore is specified
in e6ed65db8b4e0a2f8026c2e35a12dd292c5f2b8c, "cyanstore" is added to the
help message of vstart.sh, but we should also check for this option, and
set the ceph option accordingly.
in this change, the option is checked and "objectstore" is updated
accordingly.
In file included from ../src/common/config.h:27,
from ../src/crimson/common/config_proxy.h:8,
from ../src/crimson/osd/main.cc:23:
../src/common/config_values.h: In copy constructor ‘ConfigValues::ConfigValues(const ConfigValues&)’:
../src/common/config_values.h:19:7: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
19 | class ConfigValues {
| ^~~~~~~~~~~~
* define OpenLDAP::OpenLDAP, so this library can be consumed in a simpler way.
* use OpenLDAP::OpenLDAP instead of OpenLDAP_LIBRARIES when appropriate
* do not link against unused ${OpenLDAP_LIBRARIES}
it was changed from a shared library to object library back in 3c0bba40b2fcc36a02bfe89647231e8983819a72, because we wanted to link both
rgw_a and rgw_admin_user against it.
but now that rgw_admin_user was dropped in c89b59428e66ae6d89d1fd27a4280045c57251cb, let's compile rgw_common
as a static library. it'd be much easier for us to apply various compile
options and linkages to it this way.
cmake: build rgw_kmip_client_impl as part of radosgw
instead compiling rgw_kmip as an object library, just include
rgw_kmip_client_impl.cc in radosgw. simpler this way, as
rgw_kmip_client_impl.cc includes rgw/rgw_common.h. while rgw_common.cc
is indirectly included by ${rgw_libs} as a part of rgw_a, so
it would be simpler if we just compile rgw_kmip_client_impl.cc
as a part of radosgw, and let radosgw link against ${rgw_libs},
which are able to take care of the include directories of 3rd party
libraries, like spawn/spawn.hpp, which is pulled in by rgw/rgw_common.h.
because fmt is packaged in EPEL, while librados is packaged
in RHEL, so we cannot have fmt as a runtime dependency of librados.
to address this issue, we should compile librados either with static library
or with header-only library of fmt. but because the fedora packaging
guideline does no encourage us to package static libraries, and it would
be complicated to package both static and dynamic library for fmt.
the simpler solution would be to compile Ceph with the header-only
version of fmt.
in this change, we compile ceph with the header-only version of fmt
on RHEL to address the runtime dependency issue.
* an interface library named "fmt-header-only" is introduced. it brings
the support to the header only fmt library.
* fmt::fmt is renamed to fmt
* an option named "WITH_FMT_HEADER_ONLY" is introduced
* fmt::fmt is an alias of "fmt-header-only" if "WITH_FMT_HEADER_ONLY"
is "ON", and an alias of "fmt" otherwise.
because fmt is packaged in EPEL, while librados is packaged
in RHEL, so we cannot have fmt as a runtime dependency of librados.
to address this issue an option "WITH_FMT_HEADER_ONLY" is introduced, so
that we can enable it when building Ceph with the header version of fmt.
and the built packages won't have runtime dependency of fmt.
We don't need to run an extra command (mgr module ls) to obtain the mgr
modules list since we already have this information in the mgr_map.
This workflow is already done for the monitoring stack or for configuring
the iscsi integration within the dashboard (during creation) via the
config_dashboard method.
The mgr_map is mocked in the tests with the dashboard module enabled so we
don't need _mon_command_mock_mgr_module_ls anymore.