Repository navigation
nixos/ceph: Add a service module that enables the configuration of ceph through nixos - #35299
Conversation
…ph through nixos All 5 daemon types can be enabled and configured through the module and the module both creates tho ceph.conf required but also creates and enables specific services for each daemon, based on the systemd service files that upstream provides.
…nality of both daemons and cluster
|
@Mic92 I've now added a testcase, as requested |
| @@ -0,0 +1,147 @@ | |||
| { system ? builtins.currentSystem }: | |||
|
|
|||
| with import ../lib/testing.nix { inherit system; }; | |||
There was a problem hiding this comment.
Can you add yourself to maintainers? https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/mesos.nix#L3
There was a problem hiding this comment.
I've added myself to the maintainers list, at L145, I should probably restructure the test after that mesos test, I just did it this way because I used networking.nix as a template.
| [ "0" "1" ]; | ||
| ''; | ||
| description = '' | ||
| A list of rados gateway daemons that should have a service created. |
There was a problem hiding this comment.
A very minor nit is that "should have a service created" sounds imperative. Instead, these are describing not what should happen but what services will exist, right?
There was a problem hiding this comment.
I actually had a hard time wording that and just decided to write something at the time and continue with the rest of the module, honestly.
I'm open to suggestions of better wording, the wording isn't just imperative, it sounds wonky.
|
@GrahamcOfBorg test ceph |
|
Failure on x86_64-linux (full log) Partial log (click to expand)
|
|
Success on aarch64-linux (full log) Partial log (click to expand)
|
|
Now ceph should be built already. |
| import ./make-test.nix ({pkgs, ...}: rec { | ||
| name = "All-in-one-basic-ceph-cluster"; | ||
| meta = with pkgs.stdenv.lib.maintainers; { | ||
| maintainers = [ lejonet ]; |
There was a problem hiding this comment.
That handle (lejonet) does not exists in lib/maintainers.nix
| LimitNOFILE = 1048576; | ||
| LimitNPROC = 1048576; | ||
| Environment = "CLUSTER=${clusterName}"; | ||
| ExecReload = "/bin/kill -HUP $MAINPID"; |
There was a problem hiding this comment.
should be ${coreutils}/bin/kill -HUP $MAINPID
|
Did we ever verify that the test passed? |
|
@grahamc I only executed them locally. |
|
@grahamc the build bot would have had a timeout because ceph was not yet build. I tested it on a slightly older head (older in hours). |
$aio->mustFail(
"ceph osd pool ls | grep 'aio-test'",
"ceph osd pool delete aio-other-test aio-other-test --yes-i-really-really-mean-it"@lejonet Why do we expect that the above two commands fail? In #330226 it fails with but I'm not sure that's what you wanted to test. |
The reason why those two commands were expected to fail was 1. The aio-test pool was renamed to aio-other-test and thus there shouldn't be a aio-test anymore and 2. To verify that you can't remove a pool. It can definitively be argued that this test doesn't need to test that, as that is pure ceph functionality and hopefully the ceph team has done those tests but for the sake of completeness I threw them into the test both because it goes quick to run those commands and we can then be sure that ceph functions as intended. |
|
@lejonet Ah OK, then it looks correct. It just not clear without comment whether pool deletion should fail because of |
All 5 daemon types can be enabled and configured through the module and the module both creates tho ceph.conf required but also creates and enables specific services for each daemon, based on the systemd service files that upstream provides.
Motivation for this change
In addition to the ceph package being broken, there isn't any module to configure a ceph cluster through nixos, which I'm aiming to fix.
I've successfully setup and am running a ceph cluster, on nixos, configured soley through this module.
Things done
build-use-sandboxinnix.confon non-NixOS)nix-shell -p nox --run "nox-review wip"./result/bin/)