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
Modern RabbitMQ #34265
Modern RabbitMQ #34265
Conversation
@@ -1,21 +1,21 @@ | |||
{ stdenv, fetchurl, erlang, python, libxml2, libxslt, xmlto | |||
, docbook_xml_dtd_45, docbook_xsl, zip, unzip, rsync | |||
{ stdenv, fetchurl, erlang, elixir_1_5, python, libxml2, libxslt, xmlto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather use the name elixir
here and explicitly pass the correct elixir
version from all-packages.nix
.
@GrahamcOfBorg build rabbitmq |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failure for system: aarch64-linux
error: attribute 'rabbitmq' in selection path 'rabbitmq' not found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failure for system: x86_64-linux
error: attribute ‘rabbitmq’ in selection path ‘rabbitmq’ not found
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failure for system: x86_64-darwin
error: attribute 'rabbitmq' in selection path 'rabbitmq' not found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failure for system: x86_64-darwin
while evaluating the attribute '__impureHostDeps' of the derivation 'erlang-19.3.6.4' at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating 'unique' at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/lib/lists.nix:455:12, called from /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/pkgs/stdenv/generic/make-derivation.nix:137:13:
while evaluating 'concatMap' at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/lib/lists.nix:102:18, called from /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/pkgs/stdenv/generic/make-derivation.nix:137:25:
while evaluating anonymous function at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/pkgs/stdenv/generic/make-derivation.nix:137:40, called from undefined position:
while evaluating 'chooseDevOutputs' at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/lib/attrsets.nix:460:22, called from undefined position:
while evaluating 'optional' at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/lib/lists.nix:198:20, called from /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/pkgs/development/interpreters/erlang/generic-builder.nix:57:8:
while evaluating 'callPackageWith' at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/lib/customisation.nix:113:35, called from /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/pkgs/top-level/all-packages.nix:13416:13:
while evaluating 'makeOverridable' at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/lib/customisation.nix:72:24, called from /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/lib/customisation.nix:117:8:
while evaluating anonymous function at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/pkgs/os-specific/linux/systemd/default.nix:1:1, called from /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/lib/customisation.nix:74:12:
assertion failed at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/pkgs/os-specific/linux/systemd/default.nix:9:1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Success for system: x86_64-linux
gzipping man pages under /nix/store/8bb2njibgd65c8vqd560jxisl535jazx-rabbitmq-server-3.7.2/share/man/
strip is /nix/store/mdyy001q67hiks0g24ra53z7ckm4jfr4-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/8bb2njibgd65c8vqd560jxisl535jazx-rabbitmq-server-3.7.2/sbin
patching script interpreter paths in /nix/store/8bb2njibgd65c8vqd560jxisl535jazx-rabbitmq-server-3.7.2
/nix/store/8bb2njibgd65c8vqd560jxisl535jazx-rabbitmq-server-3.7.2/escript/rabbitmq-diagnostics: interpreter directive changed from " /usr/bin/env escript" to "/nix/store/2sd8mmc3kah6q8fm2jvi1838q5f4yc9g-erlang-19.3.6.4/bin/escript"
/nix/store/8bb2njibgd65c8vqd560jxisl535jazx-rabbitmq-server-3.7.2/escript/rabbitmq-plugins: interpreter directive changed from " /usr/bin/env escript" to "/nix/store/2sd8mmc3kah6q8fm2jvi1838q5f4yc9g-erlang-19.3.6.4/bin/escript"
/nix/store/8bb2njibgd65c8vqd560jxisl535jazx-rabbitmq-server-3.7.2/escript/rabbitmqctl: interpreter directive changed from " /usr/bin/env escript" to "/nix/store/2sd8mmc3kah6q8fm2jvi1838q5f4yc9g-erlang-19.3.6.4/bin/escript"
checking for references to /tmp/nix-build-rabbitmq-server-3.7.2.drv-0 in /nix/store/8bb2njibgd65c8vqd560jxisl535jazx-rabbitmq-server-3.7.2...
moving /nix/store/8bb2njibgd65c8vqd560jxisl535jazx-rabbitmq-server-3.7.2/sbin/* to /nix/store/8bb2njibgd65c8vqd560jxisl535jazx-rabbitmq-server-3.7.2/bin
/nix/store/8bb2njibgd65c8vqd560jxisl535jazx-rabbitmq-server-3.7.2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failure for system: aarch64-linux
escript /build/source/bootstrap/lib/erl_docgen/priv/bin/specs_gen.escript -I../../include -I../../src -o../specs/ ../../src/gen/wxRadioBox.erl
escript /build/source/bootstrap/lib/erl_docgen/priv/bin/specs_gen.escript -I../../include -I../../src -o../specs/ ../../src/gen/wxRadioButton.erl
escript /build/source/bootstrap/lib/erl_docgen/priv/bin/specs_gen.escript -I../../include -I../../src -o../specs/ ../../src/gen/wxRegion.erl
escript /build/source/bootstrap/lib/erl_docgen/priv/bin/specs_gen.escript -I../../include -I../../src -o../specs/ ../../src/gen/wxSashEvent.erl
escript /build/source/bootstrap/lib/erl_docgen/priv/bin/specs_gen.escript -I../../include -I../../src -o../specs/ ../../src/gen/wxSashLayoutWindow.erl
building of '/nix/store/r3066978pg0h9rbadmf9af7kxpi9v70p-erlang-19.3.6.4.drv' timed out after 3200 seconds
cannot build derivation '/nix/store/m345vq87z12r36w5dn8zy1r0cg5v3gcc-rebar-2.5.1.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/12nkp7wlz066kv8xcqaph1mijq25krmk-elixir-1.5.3.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/99611m0arba044f2f079m0m9niyi0v3f-rabbitmq-server-3.7.2.drv': 2 dependencies couldn't be built
error: build of '/nix/store/99611m0arba044f2f079m0m9niyi0v3f-rabbitmq-server-3.7.2.drv' failed
Tests are passing on I'm very much in favour of this PR but I want @grahamc to give the final OK. :) |
040e8c8
to
cd9abd9
Compare
Bumped rabbit to recently released 3.7.3, moved elixir version selection to all-packages.nix as suggested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since 3.6
is going to be supported until May 2018, I request that an up-to-date 3.6.x
is kept in nixpkgs.
Here is a patch to 3.6.14: https://gitlab.techcultivation.org/Profpatsch/nixpkgs-techcultivation/commit/38afdc9923f3b6aa601023b599a34dcc4af58f96
@Profpatsch I can easily do this for package itself, but I don't think I can do this in a clean way for NixOS module. If you are OK with the module working only with a new one, how'd you prefer the new and the old package named in all-packages? |
cd9abd9
to
0e9a5df
Compare
inherit (builtins) concatStringsSep; | ||
inherit (lib) mapAttrsToList; | ||
|
||
config_file_content = concatStringsSep "\n" (mapAttrsToList (name: value: "${name} = ${toString value}") cfg.configItems); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use lib.generators.toKeyValue
: lib.generators.toKeyValue {} cfg.configItems
.
That also does escaping for you.
|
||
config_file_content = concatStringsSep "\n" (mapAttrsToList (name: value: "${name} = ${toString value}") cfg.configItems); | ||
config_file = pkgs.writeText "rabbitmq.conf" config_file_content; | ||
config_file_wo_suffix = builtins.substring 0 ((builtins.stringLength config_file) - 5) config_file; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These _wo_suffix
paths seem a bit sketchy. Does rabbitmq add .config
automatically and is there no way around that?.
Took me a while to get that this code is shortening the storepath file string …
I’d to it like this: For the packages:
And then use
They should probably be named
Notice that I changed the (historical) |
fyi: I’ve created a PR (#35194) to update to I intend to merge the |
While we're at it, can we use |
I’m for it, I already disable wx for our rabbitmq docker image. As you can see in that source file, the wx beam files are put in nonetheless, so |
The deprecation for the We should still keep |
|
||
serviceConfig = { | ||
User = "nobody"; | ||
Group = "nogroup"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't be using nobody/nogroup - those are reserved for NFS. Instead either run with DynamicUser = true;
(preferred) if possible or alternatively create a user/group for this.
ExecStart = "${cfg.package}/bin/epmd -systemd"; | ||
Type = "notify"; | ||
StandardOutput = "journal"; | ||
StandardError = "journal"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
journal
is default anyway, so you don't have to set those.
I updated this patch without re-introducing version-selection logic described above, it's already too late. This depends on:
|
ca9bba1
to
b1addbb
Compare
- New dependency on 'getconf' binary for https://github.com/rabbitmq/rabbitmq-common/blob/3aa619e9ef81cfe6db0c776e6cd829ce234a7881/src/vm_memory_monitor.erl#L448 - New dependency on 'socat' for systemd notifications https://github.com/rabbitmq/rabbitmq-server/blob/4a3ee3a336bc82f2e56ec5d2292c80458ccc2974/src/rabbit.erl#L361 - elixir_1_6 for a new 'rabbitmqctl' tool - Replace patching with providing custom PATH, as we already have some other things here - Renamed package in all-packages.nix from a legacy spelling
- Use socket-activated epmd - that way there won't be any trouble when more than one erlang system is used within a single host. - Use new automation-friendly configuration file format - Use systemd notifications instead of buggy 'rabbitmqctl wait' for confirming successful server startup. 'wait' bug: rabbitmq/rabbitmq-server#463 - Use 'rabbitmqctl shutdown' instead of 'stop', because it's not pid-file based - Use sane systemd unit defaults from RabbitMQ repo: https://github.com/rabbitmq/rabbitmq-server/blob/master/docs/rabbitmq-server.service.example - Support for external plugins
b1addbb
to
3a4e927
Compare
@Profpatsch All dependencies are in |
@GrahamcOfBorg build rabbitmq-server |
Unexpected error: command failed with exit code 1 on x86_64-darwin (full log) Attempted: rabbitmq-server Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: rabbitmq-server Partial log (click to expand)
|
Failure on aarch64-linux (full log) Attempted: rabbitmq-server Partial log (click to expand)
|
I think the darwin failure is unrelated. Let’s try again. @GrahamcOfBorg build rabbitmq-server |
Success on x86_64-linux (full log) Attempted: rabbitmq-server Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: rabbitmq-server Partial log (click to expand)
|
Failure on aarch64-linux (full log) Attempted: rabbitmq-server Partial log (click to expand)
|
Motivation for this change
This series of commits upgrades RabbitMQ to latest stable version and modernizes corresponding NixOS module. Most important changes are:
Parts of Erlang infrastructure were also touched to make socket-activation real.
Every commit message also contains more detailed description, together with relevant links to RabbitMQ and Erlang/OTP repositories.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)