Lucian Petrut [Thu, 3 Oct 2019 08:33:31 +0000 (11:33 +0300)]
[win32] Add build scripts
This patch adds a couple of scripts that can be used for
building Ceph for Windows along with its dependencies.
For now, we're going to cross compile it using mingw.
It's supposed to run on Ubuntu (feel free to update
the command that's installing some of the dependencies
within win32_deps_build.sh if you're interested in other
distros).
This commit also adds a short readme, describing the focus of
the Windows porting effort, the building process and the current
status.
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com> Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Lucian Petrut [Wed, 5 Feb 2020 15:01:04 +0000 (15:01 +0000)]
cmake: [win32] Fix rocksdb cross compiling
In order to be able to cross compile rocksdb using mingw, we'll
have to do the following:
* pass on specified toolchain files
* pass the CMAKE_PREFIX_PATH. We'll have to replace the ";" separator
with something else (we went with "!"), otherwise CMake won't be
able to properly handle the command arguments
* pass on the received LZ4 lib location since it cannot be properly
detected when cross compiling.
Lucian Petrut [Wed, 5 Feb 2020 14:54:16 +0000 (14:54 +0000)]
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>
Sebastian Wagner [Wed, 12 Feb 2020 15:21:05 +0000 (16:21 +0100)]
mgr/orchestrator: Use CLICommand, except it's global variable
`CLICommand.COMMANDS` is a global varialbe that prevents
anyone from importing other modules, as the `COMMANS` are then
merged together. Let's use a meta class instead of a global variable.
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Yingxin Cheng [Mon, 10 Feb 2020 09:00:31 +0000 (17:00 +0800)]
crimson/net: remove duplicated error codes and conditions
The duplicated error codes and conditions were originally introduced to
match connection errors with both system category (thrown by seastar)
and generic category (thrown by standard library). Since error_code
with system category can be matched by error_condition with generic
category (see std::errc and
system_error_category::default_error_condition(int)), our duplicated
counterparts are not needed actually.
Matthew Oliver [Fri, 10 Jan 2020 03:17:11 +0000 (03:17 +0000)]
rgw: make radosgw-admin user create and modify distinct
Currently if you run 'radosgw-admin user create ..' when the user
already exists and you happen to specify, at least, '--uid' and
'--display-name' that match the existing user, radowgw-admin will
actaully go modify the existing user.
This behaviour is a little confusing, hence the bug this patch is
fixing. This patch instead simplifies the tool to make
'create' create and 'modify' modify.
Meaning when you go 'create' a user that already exists, you'll get an
error, as expected. If you want to modify a user, you actually have to
use 'modify'.
For exapmle, now:
$ radosgw-admin user create --uid="test-user" --display-name="test user"
could not create user: unable to create user, user: test-user exists
Signed-off-by: Matthew Oliver <moliver@suse.com> Fixes: https://tracker.ceph.com/issues/38619
Kefu Chai [Sun, 16 Feb 2020 11:05:09 +0000 (19:05 +0800)]
crimson/admin: no need to check for '\n'
as we don't need to mimic the behavior of classic OSD, what we need to
to fulfill the needs of ceph cli. see `admin_socket()` in
`src/pybind/ceph_daemon.py`, which sends a `\0` to indicate the end of a
command.
Kefu Chai [Sun, 16 Feb 2020 10:03:24 +0000 (18:03 +0800)]
crimson/asok: disconnect client when shutdown
track the established connection as well, please note, the current asok
implementation only allows a single connection at the same time, even
though unix domain socket allows multiple concurrent clients. so there
is no need to track multiple clients at this moment.
Kefu Chai [Sun, 16 Feb 2020 08:40:04 +0000 (16:40 +0800)]
crimson/asok: do not assume the order of param eval
* do not assume the order of parameter evaluation, before this change,
we have `do_with(cn.input(), cn.output(), std::move(cn) ...)`, see
https://en.cppreference.com/w/cpp/language/eval_order,
> side effects of the initialization of every parameter are
> indeterminately sequenced with respect to value computations and side
> effects of any other parameter.
we cannot move `cn` out and then call its member functions. so
introduce a struct for capturing its input and output.
* move `do_until_gate()` into `start()`, no need to check if
gate is stopped in `safe_action`, as `sestar::do_until()` will do
this for us.
Kefu Chai [Sun, 16 Feb 2020 02:03:36 +0000 (10:03 +0800)]
crimson: refactor asok command
* do not define another iterator type, use `map::const_iterator`
directly
* do not register hooks/commands with server block, register them
one by one, much simpler this way.
* encapsulate the hook metadata in `AdminSocketHook`, so each
`AdminSocketHook` instance is self-contained in the sense that
we don't need to use an extra type for keeping track of them.
Sage Weil [Sat, 15 Feb 2020 17:40:08 +0000 (11:40 -0600)]
cephadm: separate out require files in config-json
- Put files in a subsection of the config-json.
- Also, consolidate the sanity checks into one place (command_deploy)
instead of duplicating them in create_daemon_dirs.
Paul Cuzner [Wed, 29 Jan 2020 03:10:37 +0000 (16:10 +1300)]
cephadm: add alertmanager deployment feature
Deploy now accepts a daemon_type of alertmanager. Since alertmanager
is a cluster aware service, the monitoring metadata has been updated to
allow a daemon to use multiple ports. In addition, when config_json is
received, any 'key' prefixed by '_' is skipped when creating files in the
daemons etc directory. Keys that use the '_' prefix hold config data that
can be used elsewhere. In the case of the alertmanager a _peers parameter
is required which is used to add --cluster.peer=<ip>:<port> to the
container command to form the alertmanager cluster
Samuel Just [Fri, 17 Jan 2020 21:04:30 +0000 (13:04 -0800)]
crimson/common/errorator: restrict all_same_way to valid types
As with pass_further/discard_all, we don't want the returned handler
to work on types outside of the errorator at all. Otherwise, the
handler will transparently apply to any error.
Samuel Just [Fri, 17 Jan 2020 20:33:42 +0000 (12:33 -0800)]
crimson/common/errorator: fix errorator::pass_further and discard_all
Previously, both of these were invocable on all errors, but would
static_assert on invalid ones. What we actually want is for them
to only be invocable on valid errors. That way, we can do, for
instance:
}).handle_error(
roll_journal_segment_ertr::pass_further{},
SegmentManager::open_ertr::all_same_way([this](auto &&e) {
logger().error(
"error {} in close segment {}",
e,
current_journal_segment_id);
ceph_assert(0 == "error in close");
return;
})
to explicitely propogate any errors in roll_journal_segment_ertr
while asserting on anything else.