From 6661e9b5f6977b60c92936287c2cd125d0684d84 Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Fri, 26 Feb 2021 19:29:37 +0900 Subject: [PATCH 01/13] elk7Version: 7.5.1 -> 7.11.1 --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c26fa534310d..f21bb6198904 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4863,7 +4863,7 @@ with pkgs; # The latest version used by elasticsearch, logstash, kibana and the the beats from elastic. # When updating make sure to update all plugins or they will break! elk6Version = "6.8.3"; - elk7Version = "7.10.2"; + elk7Version = "7.11.1"; elasticsearch6 = callPackage ../servers/search/elasticsearch/6.x.nix { util-linux = util-linuxMinimal; From 499807e106f095af85bbee40c3c98488128dc8bf Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Fri, 26 Feb 2021 19:30:29 +0900 Subject: [PATCH 02/13] elasticsearch/plugins: 7.5.1 -> 7.11.1 --- pkgs/servers/search/elasticsearch/plugins.nix | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/pkgs/servers/search/elasticsearch/plugins.nix b/pkgs/servers/search/elasticsearch/plugins.nix index 39af6976bf9b..38ca0b98f3b6 100644 --- a/pkgs/servers/search/elasticsearch/plugins.nix +++ b/pkgs/servers/search/elasticsearch/plugins.nix @@ -37,7 +37,7 @@ in src = fetchurl { url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${version}.zip"; sha256 = - if version == "7.10.2" then "sha256-HXNJy8WPExPeh5afjdLEFg+0WX0LYI/kvvaLGVUke5E=" + if version == "7.11.1" then "0mi6fmnjbqypa4n1w34dvlmyq793pz4wf1r5srcs7i84kkiddysy" else if version == "6.8.3" then "0vbaqyj0lfy3ijl1c9h92b0nh605h5mjs57bk2zhycdvbw5sx2lv" else throw "unsupported version ${version} for plugin ${pluginName}"; }; @@ -54,7 +54,7 @@ in src = fetchurl { url = "https://github.com/vhyza/elasticsearch-${pluginName}/releases/download/v${version}/elasticsearch-${pluginName}-${version}-plugin.zip"; sha256 = - if version == "7.10.2" then "sha256-mW4YNZ20qatyfHCDAmod/gVmkPYh15NrsYPgiBy1/T8=" + if version == "7.11.1" then "0r2k2ndgqiqh27lch8dbay1m09f00h5kjcan87chcvyf623l40a3" else if version == "6.8.3" then "12bshvp01pp2lgwd0cn9l58axg8gdimsh4g9wfllxi1bdpv4cy53" else throw "unsupported version ${version} for plugin ${pluginName}"; }; @@ -71,7 +71,7 @@ in src = fetchurl { url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${version}.zip"; sha256 = - if version == "7.10.2" then "sha256-PjA/pwoulkD2d6sHKqzcYxQpb1aS68/l047z5JTcV3Y=" + if version == "7.11.1" then "10ln81zyf04qi9wv10mck8iz0xwfvwp4ni0hl1gkgvh44lf1n855" else if version == "6.8.3" then "0ggdhf7w50bxsffmcznrjy14b578fps0f8arg3v54qvj94v9jc37" else throw "unsupported version ${version} for plugin ${pluginName}"; }; @@ -88,7 +88,7 @@ in src = fetchurl { url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${version}.zip"; sha256 = - if version == "7.10.2" then "sha256-yvxSkVyZDWeu7rcxxq1+IVsljZQKgWEURiXY9qycK1s=" + if version == "7.11.1" then "09grfvqjmm2rznc48z84awh54afh81qa16amfqw3amsb8dr6czm6" else if version == "6.8.3" then "0pmffz761dqjpvmkl7i7xsyw1iyyspqpddxp89rjsznfc9pak5im" else throw "unsupported version ${version} for plugin ${pluginName}"; }; @@ -105,7 +105,7 @@ in src = fetchurl { url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${version}.zip"; sha256 = - if version == "7.10.2" then "sha256-yOMiYJ2c/mcLDcTA99YrpQBiEBAa/mLtTqJlqTJ5tBc=" + if version == "7.11.1" then "0imkf3w2fmspb78vkf9k6kqx1crm4f82qgnbk1qa7gbsa2j47hbs" else if version == "6.8.3" then "0kfr4i2rcwinjn31xrc2piicasjanaqcgnbif9xc7lnak2nnzmll" else throw "unsupported version ${version} for plugin ${pluginName}"; }; @@ -122,7 +122,7 @@ in src = fetchurl { url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${esVersion}.zip"; sha256 = - if version == "7.10.2" then "sha256-fN2RQsY9OACE71pIw87XVJo4c3sUu/6gf/6wUt7ZNIE=" + if version == "7.11.1" then "0ahyb1plgwvq22id2kcx9g076ybb3kvybwakgcvsdjjdyi4cwgjs" else if version == "6.8.3" then "1mm6hj2m1db68n81rzsvlw6nisflr5ikzk5zv9nmk0z641n5vh1x" else throw "unsupported version ${version} for plugin ${pluginName}"; }; @@ -139,7 +139,7 @@ in src = fetchurl { url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${esVersion}.zip"; sha256 = - if version == "7.10.2" then "sha256-JdWt5LzSbs0MIEuLJIE1ceTnNeTYI5Jt2N0Xj7OBO6g=" + if version == "7.11.1" then "0i98b905k1zwm3y9pfhr40v2fm5qdsp3icygibhxf7drffygk4l7" else if version == "6.8.3" then "1s2klpvnhpkrk53p64zbga3b66czi7h1a13f58kfn2cn0zfavnbk" else throw "unsupported version ${version} for plugin ${pluginName}"; }; @@ -150,30 +150,30 @@ in }; }; - search-guard = - let - majorVersion = lib.head (builtins.splitVersion esVersion); - in - esPlugin rec { - pluginName = "search-guard"; - version = - # https://docs.search-guard.com/latest/search-guard-versions - if esVersion == "7.10.2" then "7.10.1-49.3.0" - else if esVersion == "6.8.3" then "${esVersion}-25.5" - else throw "unsupported version ${esVersion} for plugin ${pluginName}"; - src = fetchurl { - url = - if version == "7.10.1-49.3.0" then "https://maven.search-guard.com/search-guard-suite-release/com/floragunn/search-guard-suite-plugin/${version}/search-guard-suite-plugin-${version}.zip" - else "mirror://maven/com/floragunn/${pluginName}-${majorVersion}/${version}/${pluginName}-${majorVersion}-${version}.zip"; - sha256 = - if version == "7.10.1-49.3.0" then "sha256-vKH2+c+7WlncgljrvYH9lAqQTKzg9l0ABZ23Q/xdoK4=" - else if version == "6.8.3-25.5" then "0a7ys9qinc0fjyka03cx9rv0pm7wnvslk234zv5vrphkrj52s1cb" - else throw "unsupported version ${version} for plugin ${pluginName}"; - }; - meta = with lib; { - homepage = "https://search-guard.com"; - description = "Elasticsearch plugin that offers encryption, authentication, and authorisation. "; - license = licenses.asl20; - }; + search-guard = let + majorVersion = lib.head (builtins.splitVersion esVersion); + in esPlugin rec { + pluginName = "search-guard"; + version = + # https://docs.search-guard.com/latest/search-guard-versions + if esVersion == "7.11.1" then "${esVersion}-50.0.0" + else if esVersion == "6.8.3" then "${esVersion}-25.5" + else throw "unsupported version ${esVersion} for plugin ${pluginName}"; + src = + if esVersion == "7.11.1" then + fetchurl { + url = "https://maven.search-guard.com/search-guard-suite-release/com/floragunn/search-guard-suite-plugin/${version}/search-guard-suite-plugin-${version}.zip"; + sha256 = "1lippygiy0xcxxlakylhvj3bj2i681k6jcfjsprkfk7hlaqsqxkm"; + } + else if esVersion == "6.8.3" then + fetchurl { + url = "mirror://maven/com/floragunn/${pluginName}-${majorVersion}/${version}/${pluginName}-${majorVersion}-${version}.zip"; + sha256 = "0a7ys9qinc0fjyka03cx9rv0pm7wnvslk234zv5vrphkrj52s1cb"; + } + else throw "unsupported version ${version} for plugin ${pluginName}"; + meta = with lib; { + homepage = "https://search-guard.com"; + description = "Elasticsearch plugin that offers encryption, authentication, and authorisation. "; + license = licenses.asl20; }; } From 6c2478f462fc69b57496044b6e4e8ad309443d4a Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Fri, 26 Feb 2021 19:31:22 +0900 Subject: [PATCH 03/13] elasticsearch7: 7.5.1 -> 7.11.1; drop enableUnfree --- pkgs/servers/search/elasticsearch/7.x.nix | 54 +++++++++++------------ pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 7 +-- 3 files changed, 27 insertions(+), 35 deletions(-) diff --git a/pkgs/servers/search/elasticsearch/7.x.nix b/pkgs/servers/search/elasticsearch/7.x.nix index de194bcc7d29..2bf2cc0833b4 100644 --- a/pkgs/servers/search/elasticsearch/7.x.nix +++ b/pkgs/servers/search/elasticsearch/7.x.nix @@ -1,5 +1,4 @@ { elk7Version -, enableUnfree ? true , lib , stdenv , fetchurl @@ -18,19 +17,15 @@ let arch = elemAt info 0; plat = elemAt info 1; shas = - if enableUnfree - then { - x86_64-linux = "sha256-O3rjtvXyJI+kRBqiz2U2OMkCIQj4E+AIHaE8N4o14R4="; - x86_64-darwin = "sha256-AwuY2yMxf+v7U5/KD3Cf+Hv6ijjySEyj6pzF3RCsg24="; - } - else { - x86_64-linux = "sha256-cJrdkFIFgAI6wfQh34Z8yFuLrOCOKzgOsWZhU3S/3NQ="; - x86_64-darwin = "sha256-OhMVOdXei9D9cH+O5tBhdKvZ05TsImjMqUUsucRyWMo="; + { + x86_64-linux = "1ld7656b37l67vi4pyv0il865b168niqnbd4hzbvdnwrm35prp10"; + x86_64-darwin = "11b180y11xw5q01l7aw6lyn15lp9ks8xmakjg1j7gp3z6c90hpn3"; + aarch64-linux = "0s4ph79x17f90jk31wjwk259dk9dmhnmnkxdcn77m191wvf6m3wy"; }; in -stdenv.mkDerivation (rec { +stdenv.mkDerivation rec { + pname = "elasticsearch"; version = elk7Version; - pname = "elasticsearch${optionalString (!enableUnfree) "-oss"}"; src = fetchurl { url = "https://artifacts.elastic.co/downloads/elasticsearch/${pname}-${version}-${plat}-${arch}.tar.gz"; @@ -49,9 +44,13 @@ stdenv.mkDerivation (rec { "ES_CLASSPATH=\"\$ES_CLASSPATH:$out/\$additional_classpath_directory/*\"" ''; - nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ jre_headless util-linux ] - ++ optional enableUnfree zlib; + nativeBuildInputs = [ autoPatchelfHook makeWrapper ]; + + buildInputs = [ jre_headless util-linux zlib ]; + + runtimeDependencies = [ zlib ]; + + dontPatchELF = true; installPhase = '' mkdir -p $out @@ -69,22 +68,19 @@ stdenv.mkDerivation (rec { wrapProgram $out/bin/elasticsearch-plugin --set JAVA_HOME "${jre_headless}" ''; - passthru = { inherit enableUnfree; }; - - meta = { - description = "Open Source, Distributed, RESTful Search Engine"; - license = if enableUnfree then licenses.elastic else licenses.asl20; - platforms = platforms.unix; - maintainers = with maintainers; [ apeschar basvandijk ]; - }; -} // optionalAttrs enableUnfree { - dontPatchELF = true; - nativeBuildInputs = [ makeWrapper autoPatchelfHook ]; - runtimeDependencies = [ zlib ]; - postFixup = '' - for exe in $(find $out/modules/x-pack-ml/platform/linux-x86_64/bin -executable -type f); do + postFixup = lib.optionalString stdenv.hostPlatform.isLinux '' + for exe in $(find $out/modules/x-pack-ml/platform/${plat}-${arch}/bin -executable -type f); do echo "patching $exe..." patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$exe" done ''; -}) + + passthru = { enableUnfree = true; }; + + meta = { + description = "Open Source, Distributed, RESTful Search Engine"; + license = licenses.elastic; + platforms = platforms.unix; + maintainers = with maintainers; [ apeschar basvandijk ]; + }; +} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 37455858c0a0..c439e9fc02a7 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -213,6 +213,7 @@ mapAliases ({ ec2_ami_tools = ec2-ami-tools; # added 2021-10-08 ec2_api_tools = ec2-api-tools; # added 2021-10-08 elasticmq = throw "elasticmq has been removed in favour of elasticmq-server-bin"; # added 2021-01-17 + elasticsearch7-oss = throw "elasticsearch7-oss has been removed, as the distribution is no longer provided by upstream. https://github.com/NixOS/nixpkgs/pull/114456"; # added 2021-06-09 emacsPackagesGen = emacsPackagesFor; # added 2018-08-18 emacsPackagesNgGen = emacsPackagesFor; # added 2018-08-18 emacsPackagesNgFor = emacsPackagesFor; # added 2019-08-07 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f21bb6198904..30428bfc743b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4878,11 +4878,6 @@ with pkgs; util-linux = util-linuxMinimal; jre_headless = jdk11_headless; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731 }; - elasticsearch7-oss = callPackage ../servers/search/elasticsearch/7.x.nix { - enableUnfree = false; - util-linux = util-linuxMinimal; - jre_headless = jdk11_headless; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731 - }; elasticsearch = elasticsearch6; elasticsearch-oss = elasticsearch6-oss; @@ -4895,7 +4890,7 @@ with pkgs; elasticsearch = elasticsearch6-oss; }; elasticsearch7Plugins = elasticsearchPlugins.override { - elasticsearch = elasticsearch7-oss; + elasticsearch = elasticsearch7; }; elasticsearch-curator = callPackage ../tools/admin/elasticsearch-curator { From ce98cdc02d17792993096f0d09f48527a3ca4e87 Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Fri, 26 Feb 2021 19:31:39 +0900 Subject: [PATCH 04/13] logstash7: 7.5.1 -> 7.11.1 --- pkgs/tools/misc/logstash/7.x.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/misc/logstash/7.x.nix b/pkgs/tools/misc/logstash/7.x.nix index c0c67b19b10a..1e69fbc976d9 100644 --- a/pkgs/tools/misc/logstash/7.x.nix +++ b/pkgs/tools/misc/logstash/7.x.nix @@ -17,17 +17,20 @@ let shas = if enableUnfree then { - x86_64-linux = "sha256-5qv4fbFpLf6aduD7wyxXQ6FsCeUqrszRisNBx44vbMY="; - x86_64-darwin = "sha256-7H+Xpo8qF1ZZMkR5n92PVplEN4JsBEYar91zHQhE+Lo="; + x86_64-linux = "0yjaki7gjffrz86hvqgn1gzhd9dc9llcj50g2x1sgpyn88zk0z0p"; + x86_64-darwin = "0dqm66c89w1nvmbwqzphlqmf7avrycgv1nwd5b0k1z168fj0c3zm"; + aarch64-linux = "11hjhyb48mjagmvqyxb780n57kr619h6p4adl2vs1zm97g9gslx8"; } else { - x86_64-linux = "sha256-jiV2yGPwPgZ5plo3ftImVDLSOsk/XBzFkeeALSObLhU="; - x86_64-darwin = "sha256-UYG+GGr23eAc2GgNX/mXaGU0WKMjiQMPpD1wUvAVz0A="; + x86_64-linux = "14b1649avjcalcsi0ffkgznq6d93qdk6m3j0i73mwfqka5d3dvy3"; + x86_64-darwin = "0ypgdfklr5rxvsnc3czh231pa1z2h70366j1c6q5g64b3xnxpphs"; + aarch64-linux = "01ainayr8fwwfix7dmxfhhmb23ji65dn4lbjwnj2w0pl0ym9h9w2"; }; this = stdenv.mkDerivation rec { version = elk7Version; pname = "logstash${optionalString (!enableUnfree) "-oss"}"; + src = fetchurl { url = "https://artifacts.elastic.co/downloads/logstash/${pname}-${version}-${plat}-${arch}.tar.gz"; sha256 = shas.${stdenv.hostPlatform.system} or (throw "Unknown architecture"); From 06f7b8b2ce8758a68e6a9f66e8ed9a7ce448f1b1 Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Fri, 26 Feb 2021 19:32:09 +0900 Subject: [PATCH 05/13] kibana7: 7.5.1 -> 7.11.1; drop enableUnfree --- pkgs/development/tools/misc/kibana/7.x.nix | 23 +++++++++------------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 3 --- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/pkgs/development/tools/misc/kibana/7.x.nix b/pkgs/development/tools/misc/kibana/7.x.nix index a2b6f740db4c..7a2e0d1d3647 100644 --- a/pkgs/development/tools/misc/kibana/7.x.nix +++ b/pkgs/development/tools/misc/kibana/7.x.nix @@ -4,32 +4,27 @@ , stdenv , makeWrapper , fetchurl -, nodejs-10_x +, nodejs-14_x , coreutils , which }: with lib; let - nodejs = nodejs-10_x; + nodejs = nodejs-14_x; inherit (builtins) elemAt; info = splitString "-" stdenv.hostPlatform.system; arch = elemAt info 0; plat = elemAt info 1; shas = - if enableUnfree - then { - x86_64-linux = "sha256-lTPBppKm51zgKSQtSdO0PgZ/aomvaStwqwYYGNPY4Bo="; - x86_64-darwin = "sha256-d7xHmoASiywDlZCJX/CfUX1VIi4iOcDrqvK0su54MJc="; - } - else { - x86_64-linux = "sha256-+pkKpiXBpLHs72KKNtMJbqipw6eu5XC1xu/iLFCHGRQ="; - x86_64-darwin = "sha256-CyJ5iRXaPgXO2lyy+E24OcGtb9V3e1gMZRIu25bVyzk="; + { + x86_64-linux = "19p9s4sir982bb1zcldrbphhwfs9i11p0q28vgc421iqg10kjlf1"; + x86_64-darwin = "0qq557ngwwakifidyrccga4cadj9k9pzhjwy4msmbcgf5pb86qyc"; + aarch64-linux = "183cp1h8d3n7xfcpcys4hf36palczxa409afyp62kzyzckngy0j8"; }; -in -stdenv.mkDerivation rec { - pname = "kibana${optionalString (!enableUnfree) "-oss"}"; +in stdenv.mkDerivation rec { + pname = "kibana"; version = elk7Version; src = fetchurl { @@ -58,7 +53,7 @@ stdenv.mkDerivation rec { meta = { description = "Visualize logs and time-stamped data"; homepage = "http://www.elasticsearch.org/overview/kibana"; - license = if enableUnfree then licenses.elastic else licenses.asl20; + license = licenses.elastic; maintainers = with maintainers; [ offline basvandijk ]; platforms = with platforms; unix; }; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index c439e9fc02a7..38189f6ae296 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -377,6 +377,7 @@ mapAliases ({ json_glib = json-glib; # added 2018-02-25 kdecoration-viewer = throw "kdecoration-viewer has been removed from nixpkgs, as there is no upstream activity"; # 2020-06-16 k9copy = throw "k9copy has been removed from nixpkgs, as there is no upstream activity"; # 2020-11-06 + kibana7-oss = throw "kibana7-oss has been removed, as the distribution is no longer provided by upstream. https://github.com/NixOS/nixpkgs/pull/114456"; # added 2021-06-09 kodiGBM = kodi-gbm; kodiPlain = kodi; kodiPlainWayland = kodi-wayland; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 30428bfc743b..b7caf86fe49f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6699,9 +6699,6 @@ with pkgs; enableUnfree = false; }; kibana7 = callPackage ../development/tools/misc/kibana/7.x.nix { }; - kibana7-oss = callPackage ../development/tools/misc/kibana/7.x.nix { - enableUnfree = false; - }; kibana = kibana6; kibana-oss = kibana6-oss; From 98469f2c55c99156e2ff92e0b537fd1231a931ad Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Fri, 26 Feb 2021 19:32:38 +0900 Subject: [PATCH 06/13] beats7: 7.5.1 -> 7.11.1 --- pkgs/misc/logging/beats/7.x.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/misc/logging/beats/7.x.nix b/pkgs/misc/logging/beats/7.x.nix index 99a79fecedc5..b8b82ed4b308 100644 --- a/pkgs/misc/logging/beats/7.x.nix +++ b/pkgs/misc/logging/beats/7.x.nix @@ -8,10 +8,10 @@ let beat = package: extraArgs: buildGoModule (rec { owner = "elastic"; repo = "beats"; rev = "v${version}"; - sha256 = "sha256-zr0a0LBR4G9okS2pUixDYtYZ0yCp4G6j08jx/zlIKOA="; + sha256 = "0gjyzprgj9nskvlkm2bf125b7qn3608llz4kh1fyzsvrw6zb7sm8"; }; - vendorSha256 = "sha256-xmw432vY1T2EixkDcXdGrnMdc8fYOI4R2lEjbkav3JQ="; + vendorSha256 = "04cwf96fh60ld3ndjzzssgirc9ssb53yq71j6ksx36m3y1x7fq9c"; subPackages = [ package ]; From b7f455600275ef6579d2e47373cab3678a0ceed9 Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Fri, 26 Feb 2021 20:03:26 +0900 Subject: [PATCH 07/13] nixos/tests/elk: propagate pkgs and system to test runner --- nixos/tests/elk.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/tests/elk.nix b/nixos/tests/elk.nix index 2a1a4cba2956..7225ae1f823d 100644 --- a/nixos/tests/elk.nix +++ b/nixos/tests/elk.nix @@ -215,7 +215,7 @@ let '! curl --silent --show-error "${esUrl}/_cat/indices" | grep logstash | grep ^' ) ''; - }) {}; + }) { inherit pkgs system; }; in pkgs.lib.mapAttrs mkElkTest { ELK-6 = if enableUnfree From 35db6bc5543d352ea7e54375ba12acd70033a7f9 Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Fri, 26 Feb 2021 20:03:50 +0900 Subject: [PATCH 08/13] nixos/tests/elk: remove OSS ELK-7 test --- nixos/tests/elk.nix | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/nixos/tests/elk.nix b/nixos/tests/elk.nix index 7225ae1f823d..f0ec06195a72 100644 --- a/nixos/tests/elk.nix +++ b/nixos/tests/elk.nix @@ -216,7 +216,7 @@ let ) ''; }) { inherit pkgs system; }; -in pkgs.lib.mapAttrs mkElkTest { +in pkgs.lib.mapAttrs mkElkTest ({ ELK-6 = if enableUnfree then { @@ -233,20 +233,13 @@ in pkgs.lib.mapAttrs mkElkTest { journalbeat = pkgs.journalbeat6; metricbeat = pkgs.metricbeat6; }; - ELK-7 = - if enableUnfree - then { - elasticsearch = pkgs.elasticsearch7; - logstash = pkgs.logstash7; - kibana = pkgs.kibana7; - journalbeat = pkgs.journalbeat7; - metricbeat = pkgs.metricbeat7; - } - else { - elasticsearch = pkgs.elasticsearch7-oss; - logstash = pkgs.logstash7-oss; - kibana = pkgs.kibana7-oss; - journalbeat = pkgs.journalbeat7; - metricbeat = pkgs.metricbeat7; - }; -} +} // pkgs.lib.optionalAttrs enableUnfree { + ELK-7 = + { + elasticsearch = pkgs.elasticsearch7; + logstash = pkgs.logstash7; + kibana = pkgs.kibana7; + journalbeat = pkgs.journalbeat7; + metricbeat = pkgs.metricbeat7; + }; +}) From 8fba8ef596a35142eda60ecd7f7355a04c0b6bee Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Mon, 1 Mar 2021 16:23:06 +0900 Subject: [PATCH 09/13] elasticsearch7: remove manual elf patching The options as specified were not a coherent set. There were three things to consider: autoPatchelfHook, the regular rpath fixup (controlled by dontPatchELF) and the elf interpreter rewrite in the postFixup hook. The autoPatchelfHook will set the interpreter, so the explicit invocation of patchelf to do so in postFixup should not be required. The autoPatchelfHook will rewrite rpaths entirely, so disabling the rpath minimizing via dontPatchELF should have no effect. --- pkgs/servers/search/elasticsearch/7.x.nix | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pkgs/servers/search/elasticsearch/7.x.nix b/pkgs/servers/search/elasticsearch/7.x.nix index 2bf2cc0833b4..c254b733837b 100644 --- a/pkgs/servers/search/elasticsearch/7.x.nix +++ b/pkgs/servers/search/elasticsearch/7.x.nix @@ -50,8 +50,6 @@ stdenv.mkDerivation rec { runtimeDependencies = [ zlib ]; - dontPatchELF = true; - installPhase = '' mkdir -p $out cp -R bin config lib modules plugins $out @@ -68,13 +66,6 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/elasticsearch-plugin --set JAVA_HOME "${jre_headless}" ''; - postFixup = lib.optionalString stdenv.hostPlatform.isLinux '' - for exe in $(find $out/modules/x-pack-ml/platform/${plat}-${arch}/bin -executable -type f); do - echo "patching $exe..." - patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$exe" - done - ''; - passthru = { enableUnfree = true; }; meta = { From 1faa5d5915d877d966e5b54a5a228694037122cf Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Mon, 22 Mar 2021 14:44:43 +0900 Subject: [PATCH 10/13] elasticsearch/plugins: build with "modules" from elasticsearch Fixes dependency error while building search-guard: Exception in thread "main" java.lang.IllegalArgumentException: Missing plugin [lang-painless], dependency of [search-guard-7] --- pkgs/servers/search/elasticsearch/plugins.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/search/elasticsearch/plugins.nix b/pkgs/servers/search/elasticsearch/plugins.nix index 38ca0b98f3b6..f05c5579dbb3 100644 --- a/pkgs/servers/search/elasticsearch/plugins.nix +++ b/pkgs/servers/search/elasticsearch/plugins.nix @@ -4,13 +4,14 @@ let esVersion = elasticsearch.version; esPlugin = - a@{ pluginName - , installPhase ? '' + a@{ + pluginName, + installPhase ? '' mkdir -p $out/config mkdir -p $out/plugins - ln -s ${elasticsearch}/lib $out/lib + ln -s ${elasticsearch}/lib ${elasticsearch}/modules $out ES_HOME=$out ${elasticsearch}/bin/elasticsearch-plugin install --batch -v file://$src - rm $out/lib + rm $out/lib $out/modules '' , ... }: From a9952f0093b6316c87eb64083c09363ca95dba43 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 3 Nov 2021 11:41:53 +0100 Subject: [PATCH 11/13] Revert "nixos/tests/elk: remove OSS ELK-7 test" This reverts commit 35db6bc5543d352ea7e54375ba12acd70033a7f9. --- nixos/tests/elk.nix | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/nixos/tests/elk.nix b/nixos/tests/elk.nix index f0ec06195a72..7225ae1f823d 100644 --- a/nixos/tests/elk.nix +++ b/nixos/tests/elk.nix @@ -216,7 +216,7 @@ let ) ''; }) { inherit pkgs system; }; -in pkgs.lib.mapAttrs mkElkTest ({ +in pkgs.lib.mapAttrs mkElkTest { ELK-6 = if enableUnfree then { @@ -233,13 +233,20 @@ in pkgs.lib.mapAttrs mkElkTest ({ journalbeat = pkgs.journalbeat6; metricbeat = pkgs.metricbeat6; }; -} // pkgs.lib.optionalAttrs enableUnfree { - ELK-7 = - { - elasticsearch = pkgs.elasticsearch7; - logstash = pkgs.logstash7; - kibana = pkgs.kibana7; - journalbeat = pkgs.journalbeat7; - metricbeat = pkgs.metricbeat7; - }; -}) + ELK-7 = + if enableUnfree + then { + elasticsearch = pkgs.elasticsearch7; + logstash = pkgs.logstash7; + kibana = pkgs.kibana7; + journalbeat = pkgs.journalbeat7; + metricbeat = pkgs.metricbeat7; + } + else { + elasticsearch = pkgs.elasticsearch7-oss; + logstash = pkgs.logstash7-oss; + kibana = pkgs.kibana7-oss; + journalbeat = pkgs.journalbeat7; + metricbeat = pkgs.metricbeat7; + }; +} From 15e4c45cc753015cf9dbd6262c30c39d6232db59 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 3 Nov 2021 12:24:41 +0100 Subject: [PATCH 12/13] nixos/tests/elk: Restructure attribute layout to avoid ELK-7 (non-OSS) on Hydra ... or any other tool that respects the recurseForDerivations attribute. --- nixos/tests/elk.nix | 53 +++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/nixos/tests/elk.nix b/nixos/tests/elk.nix index 7225ae1f823d..e37bae7479b4 100644 --- a/nixos/tests/elk.nix +++ b/nixos/tests/elk.nix @@ -1,12 +1,15 @@ +# To run the test on the unfree ELK use the folllowing command: +# cd path/to/nixpkgs +# NIXPKGS_ALLOW_UNFREE=1 nix-build -A nixosTests.elk.unfree.ELK-6 + { system ? builtins.currentSystem, config ? {}, pkgs ? import ../.. { inherit system config; }, - enableUnfree ? false - # To run the test on the unfree ELK use the folllowing command: - # NIXPKGS_ALLOW_UNFREE=1 nix-build nixos/tests/elk.nix -A ELK-6 --arg enableUnfree true }: let + inherit (pkgs) lib; + esUrl = "http://localhost:9200"; mkElkTest = name : elk : @@ -216,37 +219,39 @@ let ) ''; }) { inherit pkgs system; }; -in pkgs.lib.mapAttrs mkElkTest { - ELK-6 = - if enableUnfree - then { +in { + ELK-6 = mkElkTest { + name = "elk-6-oss"; + elasticsearch = pkgs.elasticsearch6-oss; + logstash = pkgs.logstash6-oss; + kibana = pkgs.kibana6-oss; + journalbeat = pkgs.journalbeat6; + metricbeat = pkgs.metricbeat6; + }; + # We currently only package upstream binaries. + # Feel free to package an SSPL licensed source-based package! + # ELK-7 = mkElkTest { + # name = "elk-7"; + # elasticsearch = pkgs.elasticsearch7-oss; + # logstash = pkgs.logstash7-oss; + # kibana = pkgs.kibana7-oss; + # journalbeat = pkgs.journalbeat7; + # metricbeat = pkgs.metricbeat7; + # }; + unfree = lib.dontRecurseIntoAttrs { + ELK-6 = mkElkTest "elk-6" { elasticsearch = pkgs.elasticsearch6; logstash = pkgs.logstash6; kibana = pkgs.kibana6; journalbeat = pkgs.journalbeat6; metricbeat = pkgs.metricbeat6; - } - else { - elasticsearch = pkgs.elasticsearch6-oss; - logstash = pkgs.logstash6-oss; - kibana = pkgs.kibana6-oss; - journalbeat = pkgs.journalbeat6; - metricbeat = pkgs.metricbeat6; }; - ELK-7 = - if enableUnfree - then { + ELK-7 = mkElkTest "elk-7" { elasticsearch = pkgs.elasticsearch7; logstash = pkgs.logstash7; kibana = pkgs.kibana7; journalbeat = pkgs.journalbeat7; metricbeat = pkgs.metricbeat7; - } - else { - elasticsearch = pkgs.elasticsearch7-oss; - logstash = pkgs.logstash7-oss; - kibana = pkgs.kibana7-oss; - journalbeat = pkgs.journalbeat7; - metricbeat = pkgs.metricbeat7; }; + }; } From 58c4cebf6fa50521ff500e19b144b3af3ce31337 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 3 Nov 2021 12:34:47 +0100 Subject: [PATCH 13/13] elasticsearch/plugin: Fix rebase error --- pkgs/servers/search/elasticsearch/plugins.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/servers/search/elasticsearch/plugins.nix b/pkgs/servers/search/elasticsearch/plugins.nix index f05c5579dbb3..f71d7b9cc76c 100644 --- a/pkgs/servers/search/elasticsearch/plugins.nix +++ b/pkgs/servers/search/elasticsearch/plugins.nix @@ -177,4 +177,5 @@ in description = "Elasticsearch plugin that offers encryption, authentication, and authorisation. "; license = licenses.asl20; }; + }; }