Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/ceph: Add a service module that enables the configuration of ceph through nixos #35299

Merged
merged 8 commits into from Mar 1, 2018

Conversation

lejonet
Copy link
Contributor

@lejonet lejonet commented Feb 21, 2018

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
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

…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.
@lejonet
Copy link
Contributor Author

lejonet commented Feb 26, 2018

@Mic92 I've now added a testcase, as requested

@grahamc
Copy link
Member

grahamc commented Feb 26, 2018

@@ -0,0 +1,147 @@
{ system ? builtins.currentSystem }:

with import ../lib/testing.nix { inherit system; };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Member

@grahamc grahamc Feb 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lejonet
Copy link
Contributor Author

lejonet commented Feb 26, 2018

@grahamc Test added to the main list in release.nix: 4f91fc4

@lejonet
Copy link
Contributor Author

lejonet commented Feb 28, 2018

@Mic92 I've now restructured the test to the structure of the mesos test with commit cc84fe5

@Mic92
Copy link
Member

Mic92 commented Mar 1, 2018

@GrahamcOfBorg test ceph

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Partial log (click to expand)

error: while evaluating anonymous function at /var/lib/gc-of-borg/.nix-test-rs/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/ogden/nixos/release.nix:19:72, called from /var/lib/gc-of-borg/.nix-test-rs/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/ogden/lib/attrsets.nix:282:43:
while evaluating ‘hydraJob’ at /var/lib/gc-of-borg/.nix-test-rs/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/ogden/lib/customisation.nix:168:14, called from /var/lib/gc-of-borg/.nix-test-rs/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/ogden/nixos/release.nix:19:80:
while evaluating the attribute ‘meta’ at /var/lib/gc-of-borg/.nix-test-rs/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/ogden/lib/customisation.nix:173:24:
while evaluating the attribute ‘maintainers’ at /var/lib/gc-of-borg/.nix-test-rs/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/ogden/nixos/tests/ceph.nix:4:5:
undefined variable ‘lejonet’ at /var/lib/gc-of-borg/.nix-test-rs/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/ogden/nixos/tests/ceph.nix:4:21

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

@Mic92
Copy link
Member

Mic92 commented Mar 1, 2018

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 ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in the name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatcha mean?

Copy link
Member

@Mic92 Mic92 Mar 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That handle (lejonet) does not exists in lib/maintainers.nix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: 29e78ce

LimitNOFILE = 1048576;
LimitNPROC = 1048576;
Environment = "CLUSTER=${clusterName}";
ExecReload = "/bin/kill -HUP $MAINPID";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be ${coreutils}/bin/kill -HUP $MAINPID

@Mic92 Mic92 merged commit 565f22d into NixOS:master Mar 1, 2018
@grahamc
Copy link
Member

grahamc commented Mar 1, 2018

Did we ever verify that the test passed?

@Mic92
Copy link
Member

Mic92 commented Mar 1, 2018

@grahamc I only executed them locally.

@Mic92
Copy link
Member

Mic92 commented Mar 1, 2018

@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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants