mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
foundationdb: split into multiple, major-versioned packages to make upgrades user-controllable
Signed-off-by: Austin Seipp <aseipp@pobox.com>
This commit is contained in:
parent
55eec81118
commit
5a24d99fa6
4 changed files with 137 additions and 85 deletions
|
@ -4,6 +4,7 @@ with lib;
|
|||
|
||||
let
|
||||
cfg = config.services.foundationdb;
|
||||
pkg = cfg.package;
|
||||
|
||||
# used for initial cluster configuration
|
||||
initialIpAddr = if (cfg.publicAddress != "auto") then cfg.publicAddress else "127.0.0.1";
|
||||
|
@ -24,7 +25,7 @@ let
|
|||
group = ${cfg.group}
|
||||
|
||||
[fdbserver]
|
||||
command = ${pkgs.foundationdb}/bin/fdbserver
|
||||
command = ${pkg}/bin/fdbserver
|
||||
public_address = ${cfg.publicAddress}:$ID
|
||||
listen_address = ${cfg.listenAddress}
|
||||
datadir = ${cfg.dataDir}/$ID
|
||||
|
@ -36,7 +37,7 @@ let
|
|||
storage_memory = ${cfg.storageMemory}
|
||||
|
||||
${optionalString (cfg.tls != null) ''
|
||||
tls_plugin = ${pkgs.foundationdb}/libexec/plugins/FDBLibTLS.so
|
||||
tls_plugin = ${pkg}/libexec/plugins/FDBLibTLS.so
|
||||
tls_certificate_file = ${cfg.tls.certificate}
|
||||
tls_key_file = ${cfg.tls.key}
|
||||
tls_verify_peers = ${cfg.tls.allowedPeers}
|
||||
|
@ -50,7 +51,7 @@ let
|
|||
${fdbServers cfg.serverProcesses}
|
||||
|
||||
[backup_agent]
|
||||
command = ${pkgs.foundationdb}/libexec/backup_agent
|
||||
command = ${pkg}/libexec/backup_agent
|
||||
${backupAgents cfg.backupProcesses}
|
||||
'';
|
||||
in
|
||||
|
@ -59,6 +60,14 @@ in
|
|||
|
||||
enable = mkEnableOption "FoundationDB Server";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
description = ''
|
||||
The FoundationDB package to use for this server. This must be specified by the user
|
||||
in order to ensure migrations and upgrades are controlled appropriately.
|
||||
'';
|
||||
};
|
||||
|
||||
publicAddress = mkOption {
|
||||
type = types.str;
|
||||
default = "auto";
|
||||
|
@ -314,7 +323,7 @@ in
|
|||
meta.doc = ./foundationdb.xml;
|
||||
meta.maintainers = with lib.maintainers; [ thoughtpolice ];
|
||||
|
||||
environment.systemPackages = [ pkgs.foundationdb ];
|
||||
environment.systemPackages = [ pkg ];
|
||||
|
||||
users.extraUsers = optionalAttrs (cfg.user == "foundationdb") (singleton
|
||||
{ name = "foundationdb";
|
||||
|
@ -368,7 +377,7 @@ in
|
|||
ReadWritePaths = lib.concatStringsSep " " (map (x: "-" + x) rwpaths);
|
||||
};
|
||||
|
||||
path = [ pkgs.foundationdb pkgs.coreutils ];
|
||||
path = [ pkg pkgs.coreutils ];
|
||||
|
||||
preStart = ''
|
||||
rm -f ${cfg.pidfile} && \
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
<para><emphasis>Maintainer:</emphasis> Austin Seipp</para>
|
||||
|
||||
<para><emphasis>Default version:</emphasis> 5.1.x</para>
|
||||
<para><emphasis>Available version(s):</emphasis> 5.1.x</para>
|
||||
|
||||
<para>FoundationDB (or "FDB") is a distributed, open source, high performance,
|
||||
transactional key-value store. It can store petabytes of data and deliver
|
||||
|
@ -26,9 +26,17 @@ exceptional performance while maintaining consistency and ACID semantics
|
|||
|
||||
<programlisting>
|
||||
services.foundationdb.enable = true;
|
||||
services.foundationdb.package = pkgs.foundationdb51; # FoundationDB 5.1.x
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>The <option>services.foundationdb.package</option> option is required,
|
||||
and must always be specified. Because FoundationDB network protocols and
|
||||
on-disk storage formats may change between (major) versions, and upgrades must
|
||||
be explicitly handled by the user, you must always manually specify this
|
||||
yourself so that the NixOS module will use the proper version. Note that minor,
|
||||
bugfix releases are always compatible.</para>
|
||||
|
||||
<para>After running <command>nixos-rebuild</command>, you can verify whether
|
||||
FoundationDB is running by executing <command>fdbcli</command> (which is added
|
||||
to <option>environment.systemPackages</option>):
|
||||
|
|
|
@ -1,33 +1,18 @@
|
|||
{ stdenv, fetchurl, fetchFromGitHub
|
||||
, which, findutils, m4, gawk, python, openjdk, mono58, libressl_2_6
|
||||
, which, findutils, m4, gawk
|
||||
, python, openjdk, mono58, libressl_2_6
|
||||
, boost16x
|
||||
}:
|
||||
|
||||
let
|
||||
version = "5.1.7";
|
||||
branch = "release-5.1";
|
||||
rev = "9ad8d02386d4a6a5efecf898df80f2747695c627";
|
||||
sha256 = "1rc472ih24f9s5g3xmnlp3v62w206ny0pvvw02bzpix2sdrpbp06";
|
||||
makeFdb =
|
||||
{ version
|
||||
, branch
|
||||
, rev, sha256
|
||||
|
||||
# hysterical raisins dictate a version of boost this old. however,
|
||||
# we luckily do not need to build anything, we just need the header
|
||||
# files.
|
||||
boost152 = stdenv.mkDerivation rec {
|
||||
name = "boost-headers-1.52.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/boost/boost_1_52_0.tar.bz2";
|
||||
sha256 = "14mc7gsnnahdjaxbbslzk79rc0d12h1i681cd3srdwr3fzynlar2";
|
||||
};
|
||||
|
||||
buildPhase = ":";
|
||||
configurePhase = ":";
|
||||
installPhase = ''
|
||||
mkdir -p $out/include/
|
||||
cp -R boost $out/include/
|
||||
'';
|
||||
};
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
# fdb 6.0+ support boost 1.6x+, so default to it
|
||||
, boost ? boost16x
|
||||
}: stdenv.mkDerivation rec {
|
||||
name = "foundationdb-${version}";
|
||||
inherit version;
|
||||
|
||||
|
@ -37,8 +22,8 @@ in stdenv.mkDerivation rec {
|
|||
inherit rev sha256;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ gawk which m4 findutils boost152 mono58 ];
|
||||
buildInputs = [ python openjdk libressl_2_6 ];
|
||||
nativeBuildInputs = [ gawk which m4 findutils mono58 ];
|
||||
buildInputs = [ python openjdk libressl_2_6 boost ];
|
||||
|
||||
patches =
|
||||
[ ./fix-scm-version.patch
|
||||
|
@ -100,4 +85,47 @@ in stdenv.mkDerivation rec {
|
|||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ thoughtpolice ];
|
||||
};
|
||||
};
|
||||
|
||||
# hysterical raisins dictate a version of boost this old. however,
|
||||
# we luckily do not need to build anything, we just need the header
|
||||
# files.
|
||||
boost152 = stdenv.mkDerivation rec {
|
||||
name = "boost-headers-1.52.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/boost/boost_1_52_0.tar.bz2";
|
||||
sha256 = "14mc7gsnnahdjaxbbslzk79rc0d12h1i681cd3srdwr3fzynlar2";
|
||||
};
|
||||
|
||||
configurePhase = ":";
|
||||
buildPhase = ":";
|
||||
installPhase = "mkdir -p $out/include && cp -R boost $out/include/";
|
||||
};
|
||||
|
||||
in with builtins; {
|
||||
|
||||
foundationdb51 = makeFdb {
|
||||
version = "5.1.7";
|
||||
branch = "release-5.1";
|
||||
rev = "9ad8d02386d4a6a5efecf898df80f2747695c627";
|
||||
sha256 = "1rc472ih24f9s5g3xmnlp3v62w206ny0pvvw02bzpix2sdrpbp06";
|
||||
boost = boost152;
|
||||
};
|
||||
|
||||
foundationdb52 = makeFdb rec {
|
||||
version = "5.2.0pre1488_${substring 0 8 rev}";
|
||||
branch = "master";
|
||||
rev = "18f345487ed8d90a5c170d813349fa625cf05b4e";
|
||||
sha256 = "0mz30fxj6q99cvjzg39s5zm992i6h2l2cb70lc58bdhsz92dz3vc";
|
||||
boost = boost152;
|
||||
};
|
||||
|
||||
foundationdb60 = makeFdb rec {
|
||||
version = "6.0.0pre1636_${substring 0 8 rev}";
|
||||
branch = "master";
|
||||
rev = "1265a7b6d5e632dd562b3012e70f0727979806bd";
|
||||
sha256 = "0z1i5bkbszsbn8cc48rlhr29m54n2s0gq3dln0n7f97gf58mi5yf";
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -2421,6 +2421,13 @@ with pkgs;
|
|||
|
||||
fuseiso = callPackage ../tools/filesystems/fuseiso { };
|
||||
|
||||
fdbPackages = callPackage ../servers/foundationdb { stdenv = overrideCC stdenv gcc49; };
|
||||
|
||||
inherit (fdbPackages)
|
||||
foundationdb51
|
||||
foundationdb52
|
||||
foundationdb60;
|
||||
|
||||
foundationdb = callPackage ../servers/foundationdb { stdenv = overrideCC stdenv gcc49; };
|
||||
|
||||
fuse-7z-ng = callPackage ../tools/filesystems/fuse-7z-ng { };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue