git.iko.soy/typeable/nixpkgs
on master help sign in
Merge staging-next into staging
commit177bd4ed530b9b008b9c164d484ff7dc282af363 authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> dateWed 16 Mar 2022, 18:01 (5 years ago) parent899bab1026b628
38 files changed+804−479
nixos/doc/manual/from_md/release-notes/rl-2205.section.xml+46 nixos/doc/manual/release-notes/rl-2205.section.md+13 nixos/modules/services/cluster/hadoop/conf.nix+11−11 nixos/modules/services/cluster/hadoop/default.nix+72−25 nixos/modules/services/cluster/hadoop/hdfs.nix+148−147 nixos/modules/services/cluster/hadoop/yarn.nix+85−13 nixos/modules/services/web-apps/nextcloud.nix+1−10 nixos/tests/all-tests.nix+3−3 nixos/tests/hadoop/default.nix+7 nixos/tests/hadoop/hadoop.nix+150−123 nixos/tests/hadoop/hdfs.nix+43−18 nixos/tests/hadoop/yarn.nix+21−13 nixos/tests/nextcloud/default.nix+1−1 pkgs/applications/networking/cluster/fluxcd/default.nix+4−4 pkgs/applications/networking/cluster/hadoop/default.nix+39−26 pkgs/applications/science/computer-architecture/qtrvsim/default.nix+2−2 pkgs/data/icons/kora-icon-theme/default.nix+2−2 pkgs/development/compilers/open-watcom/v2.nix+3−3 pkgs/development/libraries/libarchive-qt/default.nix+5−4 pkgs/development/node-packages/default.nix+1−1 pkgs/development/python-modules/bumps/default.nix+23−10 pkgs/development/python-modules/cloudscraper/default.nix+10−6 pkgs/development/python-modules/google-cloud-storage/default.nix+6−2 pkgs/development/python-modules/qcengine/default.nix+2−2 pkgs/development/python-modules/samsungtvws/default.nix+2−2 pkgs/development/tools/database/prisma-engines/default.nix+3−3 pkgs/development/tools/jp/default.nix+8−8 pkgs/development/tools/k6/default.nix+2−2 pkgs/development/tools/stylua/default.nix+3−3 pkgs/servers/nextcloud/default.nix+6−11 pkgs/servers/piping-server-rust/default.nix+3−3 pkgs/tools/archivers/p7zip/default.nix+24−11 pkgs/tools/archivers/p7zip/update.sh+47 pkgs/tools/backup/btrbk/default.nix+2−2 pkgs/tools/misc/up/default.nix−2 pkgs/tools/networking/frp/default.nix+3−3 pkgs/tools/system/syslog-ng/default.nix+2−2 pkgs/top-level/all-packages.nix+1−1
nixos/doc/manual/from_md/release-notes/rl-2205.section.xml+46
@@ -580,6 +580,25 @@
580580 because Python 2 is being retired from nixpkgs.
581581 </para>
582582 </listitem>
583+ <listitem>
584+ <para>
585+ Services in the <literal>hadoop</literal> module previously
586+ set <literal>openFirewall</literal> to true by default. This
587+ has now been changed to false. Node definitions for multi-node
588+ clusters would need <literal>openFirewall = true;</literal> to
589+ be added to to hadoop services when upgrading from NixOS
590+ 21.11.
591+ </para>
592+ </listitem>
593+ <listitem>
594+ <para>
595+ <literal>services.hadoop.yarn.nodemanager</literal> now uses
596+ cgroup-based CPU limit enforcement by default. Additionally,
597+ the option <literal>useCGroups</literal> was added to
598+ nodemanagers as an easy way to switch back to the old
599+ behavior.
600+ </para>
601+ </listitem>
583602 <listitem>
584603 <para>
585604 The <literal>wafHook</literal> hook now honors
@@ -1184,6 +1203,33 @@
11841203 using the PyPy interpreter were added.
11851204 </para>
11861205 </listitem>
1206+ <listitem>
1207+ <para>
1208+ Some improvements have been made to the
1209+ <literal>hadoop</literal> module:
1210+ </para>
1211+ <itemizedlist spacing="compact">
1212+ <listitem>
1213+ <para>
1214+ A <literal>gatewayRole</literal> option has been added,
1215+ for deploying hadoop cluster configuration files to a node
1216+ that does not have any active services
1217+ </para>
1218+ </listitem>
1219+ <listitem>
1220+ <para>
1221+ Support for older versions of hadoop have been added to
1222+ the module
1223+ </para>
1224+ </listitem>
1225+ <listitem>
1226+ <para>
1227+ Overriding and extending site XML files has been made
1228+ easier
1229+ </para>
1230+ </listitem>
1231+ </itemizedlist>
1232+ </listitem>
11871233 <listitem>
11881234 <para>
11891235 If you are using Wayland you can choose to use the Ozone
nixos/doc/manual/release-notes/rl-2205.section.md+13
@@ -248,6 +248,14 @@ In addition to numerous new and upgraded packages, this release has the followin
248248
249249- The MoinMoin wiki engine (`services.moinmoin`) has been removed, because Python 2 is being retired from nixpkgs.
250250
251+- Services in the `hadoop` module previously set `openFirewall` to true by default.
252+ This has now been changed to false. Node definitions for multi-node clusters would need
253+ `openFirewall = true;` to be added to to hadoop services when upgrading from NixOS 21.11.
254+
255+- `services.hadoop.yarn.nodemanager` now uses cgroup-based CPU limit enforcement by default.
256+ Additionally, the option `useCGroups` was added to nodemanagers as an easy way to switch
257+ back to the old behavior.
258+
251259- The `wafHook` hook now honors `NIX_BUILD_CORES` when `enableParallelBuilding` is not set explicitly. Packages can restore the old behaviour by setting `enableParallelBuilding=false`.
252260
253261- `pkgs.claws-mail-gtk2`, representing Claws Mail's older release version three, was removed in order to get rid of Python 2.
@@ -440,6 +448,11 @@ In addition to numerous new and upgraded packages, this release has the followin
440448
441449- The `writers.writePyPy2`/`writers.writePyPy3` and corresponding `writers.writePyPy2Bin`/`writers.writePyPy3Bin` convenience functions to create executable Python 2/3 scripts using the PyPy interpreter were added.
442450
451+- Some improvements have been made to the `hadoop` module:
452+ - A `gatewayRole` option has been added, for deploying hadoop cluster configuration files to a node that does not have any active services
453+ - Support for older versions of hadoop have been added to the module
454+ - Overriding and extending site XML files has been made easier
455+
443456- If you are using Wayland you can choose to use the Ozone Wayland support
444457 in Chrome and several Electron apps by setting the environment variable
445458 `NIXOS_OZONE_WL=1` (for example via
nixos/modules/services/cluster/hadoop/conf.nix+11−11
@@ -1,6 +1,6 @@
11{ cfg, pkgs, lib }:
22let
3− propertyXml = name: value: ''
3+ propertyXml = name: value: lib.optionalString (value != null) ''
44 <property>
55 <name>${name}</name>
66 <value>${builtins.toString value}</value>
@@ -29,16 +29,16 @@ let
2929 export HADOOP_LOG_DIR=/tmp/hadoop/$USER
3030 '';
3131in
32−pkgs.runCommand "hadoop-conf" {} ''
32+pkgs.runCommand "hadoop-conf" {} (with cfg; ''
3333 mkdir -p $out/
34− cp ${siteXml "core-site.xml" cfg.coreSite}/* $out/
35− cp ${siteXml "hdfs-site.xml" cfg.hdfsSite}/* $out/
36− cp ${siteXml "mapred-site.xml" cfg.mapredSite}/* $out/
37− cp ${siteXml "yarn-site.xml" cfg.yarnSite}/* $out/
38− cp ${siteXml "httpfs-site.xml" cfg.httpfsSite}/* $out/
39− cp ${cfgFile "container-executor.cfg" cfg.containerExecutorCfg}/* $out/
34+ cp ${siteXml "core-site.xml" (coreSite // coreSiteInternal)}/* $out/
35+ cp ${siteXml "hdfs-site.xml" (hdfsSiteDefault // hdfsSite // hdfsSiteInternal)}/* $out/
36+ cp ${siteXml "mapred-site.xml" (mapredSiteDefault // mapredSite)}/* $out/
37+ cp ${siteXml "yarn-site.xml" (yarnSiteDefault // yarnSite // yarnSiteInternal)}/* $out/
38+ cp ${siteXml "httpfs-site.xml" httpfsSite}/* $out/
39+ cp ${cfgFile "container-executor.cfg" containerExecutorCfg}/* $out/
4040 cp ${pkgs.writeTextDir "hadoop-user-functions.sh" userFunctions}/* $out/
4141 cp ${pkgs.writeTextDir "hadoop-env.sh" hadoopEnv}/* $out/
42− cp ${cfg.log4jProperties} $out/log4j.properties
43− ${lib.concatMapStringsSep "\n" (dir: "cp -r ${dir}/* $out/") cfg.extraConfDirs}
44−''
42+ cp ${log4jProperties} $out/log4j.properties
43+ ${lib.concatMapStringsSep "\n" (dir: "cp -r ${dir}/* $out/") extraConfDirs}
44+'')
nixos/modules/services/cluster/hadoop/default.nix+72−25
@@ -21,24 +21,50 @@ with lib;
2121 <link xlink:href="https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/core-default.xml"/>
2222 '';
2323 };
24+ coreSiteInternal = mkOption {
25+ default = {};
26+ type = types.attrsOf types.anything;
27+ internal = true;
28+ description = ''
29+ Internal option to add configs to core-site.xml based on module options
30+ '';
31+ };
2432
25− hdfsSite = mkOption {
33+ hdfsSiteDefault = mkOption {
2634 default = {
2735 "dfs.namenode.rpc-bind-host" = "0.0.0.0";
36+ "dfs.namenode.http-address" = "0.0.0.0:9870";
37+ "dfs.namenode.servicerpc-bind-host" = "0.0.0.0";
38+ "dfs.namenode.http-bind-host" = "0.0.0.0";
2839 };
2940 type = types.attrsOf types.anything;
41+ description = ''
42+ Default options for hdfs-site.xml
43+ '';
44+ };
45+ hdfsSite = mkOption {
46+ default = {};
47+ type = types.attrsOf types.anything;
3048 example = literalExpression ''
3149 {
3250 "dfs.nameservices" = "namenode1";
3351 }
3452 '';
3553 description = ''
36− Hadoop hdfs-site.xml definition
54+ Additional options and overrides for hdfs-site.xml
3755 <link xlink:href="https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/hdfs-default.xml"/>
3856 '';
3957 };
58+ hdfsSiteInternal = mkOption {
59+ default = {};
60+ type = types.attrsOf types.anything;
61+ internal = true;
62+ description = ''
63+ Internal option to add configs to hdfs-site.xml based on module options
64+ '';
65+ };
4066
41− mapredSite = mkOption {
67+ mapredSiteDefault = mkOption {
4268 default = {
4369 "mapreduce.framework.name" = "yarn";
4470 "yarn.app.mapreduce.am.env" = "HADOOP_MAPRED_HOME=${cfg.package}/lib/${cfg.package.untarDir}";
@@ -54,18 +80,25 @@ with lib;
5480 }
5581 '';
5682 type = types.attrsOf types.anything;
83+ description = ''
84+ Default options for mapred-site.xml
85+ '';
86+ };
87+ mapredSite = mkOption {
88+ default = {};
89+ type = types.attrsOf types.anything;
5790 example = literalExpression ''
58− options.services.hadoop.mapredSite.default // {
91+ {
5992 "mapreduce.map.java.opts" = "-Xmx900m -XX:+UseParallelGC";
6093 }
6194 '';
6295 description = ''
63− Hadoop mapred-site.xml definition
96+ Additional options and overrides for mapred-site.xml
6497 <link xlink:href="https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml"/>
6598 '';
6699 };
67100
68− yarnSite = mkOption {
101+ yarnSiteDefault = mkOption {
69102 default = {
70103 "yarn.nodemanager.admin-env" = "PATH=$PATH";
71104 "yarn.nodemanager.aux-services" = "mapreduce_shuffle";
@@ -77,19 +110,34 @@ with lib;
77110 "yarn.nodemanager.linux-container-executor.path" = "/run/wrappers/yarn-nodemanager/bin/container-executor";
78111 "yarn.nodemanager.log-dirs" = "/var/log/hadoop/yarn/nodemanager";
79112 "yarn.resourcemanager.bind-host" = "0.0.0.0";
80− "yarn.resourcemanager.scheduler.class" = "org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler";
113+ "yarn.resourcemanager.scheduler.class" = "org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler";
81114 };
82115 type = types.attrsOf types.anything;
116+ description = ''
117+ Default options for yarn-site.xml
118+ '';
119+ };
120+ yarnSite = mkOption {
121+ default = {};
122+ type = types.attrsOf types.anything;
83123 example = literalExpression ''
84− options.services.hadoop.yarnSite.default // {
124+ {
85125 "yarn.resourcemanager.hostname" = "''${config.networking.hostName}";
86126 }
87127 '';
88128 description = ''
89− Hadoop yarn-site.xml definition
129+ Additional options and overrides for yarn-site.xml
90130 <link xlink:href="https://hadoop.apache.org/docs/current/hadoop-yarn/hadoop-yarn-common/yarn-default.xml"/>
91131 '';
92132 };
133+ yarnSiteInternal = mkOption {
134+ default = {};
135+ type = types.attrsOf types.anything;
136+ internal = true;
137+ description = ''
138+ Internal option to add configs to yarn-site.xml based on module options
139+ '';
140+ };
93141
94142 httpfsSite = mkOption {
95143 default = { };
@@ -123,6 +171,7 @@ with lib;
123171 "yarn.nodemanager.linux-container-executor.group"="hadoop";
124172 "min.user.id"=1000;
125173 "feature.terminal.enabled"=1;
174+ "feature.mount-cgroup.enabled" = 1;
126175 };
127176 type = types.attrsOf types.anything;
128177 example = literalExpression ''
@@ -148,6 +197,8 @@ with lib;
148197 description = "Directories containing additional config files to be added to HADOOP_CONF_DIR";
149198 };
150199
200+ gatewayRole.enable = mkEnableOption "gateway role for deploying hadoop configs";
201+
151202 package = mkOption {
152203 type = types.package;
153204 default = pkgs.hadoop;
@@ -157,20 +208,16 @@ with lib;
157208 };
158209
159210
160− config = mkMerge [
161− (mkIf (builtins.hasAttr "yarn" config.users.users ||
162− builtins.hasAttr "hdfs" config.users.users ||
163− builtins.hasAttr "httpfs" config.users.users) {
164− users.groups.hadoop = {
165− gid = config.ids.gids.hadoop;
166− };
167− environment = {
168− systemPackages = [ cfg.package ];
169− etc."hadoop-conf".source = let
170− hadoopConf = "${import ./conf.nix { inherit cfg pkgs lib; }}/";
171− in "${hadoopConf}";
172− };
173− })
174−
175− ];
211+ config = mkIf cfg.gatewayRole.enable {
212+ users.groups.hadoop = {
213+ gid = config.ids.gids.hadoop;
214+ };
215+ environment = {
216+ systemPackages = [ cfg.package ];
217+ etc."hadoop-conf".source = let
218+ hadoopConf = "${import ./conf.nix { inherit cfg pkgs lib; }}/";
219+ in "${hadoopConf}";
220+ variables.HADOOP_CONF_DIR = "/etc/hadoop-conf/";
221+ };
222+ };
176223}
nixos/modules/services/cluster/hadoop/hdfs.nix+148−147
@@ -1,191 +1,191 @@
1−{ config, lib, pkgs, ...}:
1+{ config, lib, pkgs, ... }:
22with lib;
33let
44 cfg = config.services.hadoop;
5+
6+ # Config files for hadoop services
57 hadoopConf = "${import ./conf.nix { inherit cfg pkgs lib; }}/";
6− restartIfChanged = mkOption {
7− type = types.bool;
8− description = ''
9− Automatically restart the service on config change.
10− This can be set to false to defer restarts on clusters running critical applications.
11− Please consider the security implications of inadvertently running an older version,
12− and the possibility of unexpected behavior caused by inconsistent versions across a cluster when disabling this option.
13− '';
14− default = false;
15− };
8+
9+ # Generator for HDFS service options
10+ hadoopServiceOption = { serviceName, firewallOption ? true, extraOpts ? null }: {
11+ enable = mkEnableOption serviceName;
12+ restartIfChanged = mkOption {
13+ type = types.bool;
14+ description = ''
15+ Automatically restart the service on config change.
16+ This can be set to false to defer restarts on clusters running critical applications.
17+ Please consider the security implications of inadvertently running an older version,
18+ and the possibility of unexpected behavior caused by inconsistent versions across a cluster when disabling this option.
19+ '';
20+ default = false;
21+ };
22+ extraFlags = mkOption{
23+ type = with types; listOf str;
24+ default = [];
25+ description = "Extra command line flags to pass to ${serviceName}";
26+ example = [
27+ "-Dcom.sun.management.jmxremote"
28+ "-Dcom.sun.management.jmxremote.port=8010"
29+ ];
30+ };
31+ extraEnv = mkOption{
32+ type = with types; attrsOf str;
33+ default = {};
34+ description = "Extra environment variables for ${serviceName}";
35+ };
36+ } // (optionalAttrs firewallOption {
37+ openFirewall = mkOption {
38+ type = types.bool;
39+ default = false;
40+ description = "Open firewall ports for ${serviceName}.";
41+ };
42+ }) // (optionalAttrs (extraOpts != null) extraOpts);
43+
44+ # Generator for HDFS service configs
45+ hadoopServiceConfig =
46+ { name
47+ , serviceOptions ? cfg.hdfs."${toLower name}"
48+ , description ? "Hadoop HDFS ${name}"
49+ , User ? "hdfs"
50+ , allowedTCPPorts ? [ ]
51+ , preStart ? ""
52+ , environment ? { }
53+ , extraConfig ? { }
54+ }: (
55+
56+ mkIf serviceOptions.enable ( mkMerge [{
57+ systemd.services."hdfs-${toLower name}" = {
58+ inherit description preStart;
59+ environment = environment // serviceOptions.extraEnv;
60+ wantedBy = [ "multi-user.target" ];
61+ inherit (serviceOptions) restartIfChanged;
62+ serviceConfig = {
63+ inherit User;
64+ SyslogIdentifier = "hdfs-${toLower name}";
65+ ExecStart = "${cfg.package}/bin/hdfs --config ${hadoopConf} ${toLower name} ${escapeShellArgs serviceOptions.extraFlags}";
66+ Restart = "always";
67+ };
68+ };
69+
70+ services.hadoop.gatewayRole.enable = true;
71+
72+ networking.firewall.allowedTCPPorts = mkIf
73+ ((builtins.hasAttr "openFirewall" serviceOptions) && serviceOptions.openFirewall)
74+ allowedTCPPorts;
75+ } extraConfig])
76+ );
77+
1678in
1779{
1880 options.services.hadoop.hdfs = {
19− namenode = {
20− enable = mkEnableOption "Whether to run the HDFS NameNode";
81+
82+ namenode = hadoopServiceOption { serviceName = "HDFS NameNode"; } // {
2183 formatOnInit = mkOption {
2284 type = types.bool;
2385 default = false;
2486 description = ''
25− Format HDFS namenode on first start. This is useful for quickly spinning up ephemeral HDFS clusters with a single namenode.
26− For HA clusters, initialization involves multiple steps across multiple nodes. Follow [this guide](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html)
27− to initialize an HA cluster manually.
28− '';
29− };
30− inherit restartIfChanged;
31− openFirewall = mkOption {
32− type = types.bool;
33− default = true;
34− description = ''
35− Open firewall ports for namenode
36− '';
37− };
38− };
39− datanode = {
40− enable = mkEnableOption "Whether to run the HDFS DataNode";
41− inherit restartIfChanged;
42− openFirewall = mkOption {
43− type = types.bool;
44− default = true;
45− description = ''
46− Open firewall ports for datanode
87+ Format HDFS namenode on first start. This is useful for quickly spinning up
88+ ephemeral HDFS clusters with a single namenode.
89+ For HA clusters, initialization involves multiple steps across multiple nodes.
90+ Follow this guide to initialize an HA cluster manually:
91+ <link xlink:href="https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html"/>
4792 '';
4893 };
4994 };
50− journalnode = {
51− enable = mkEnableOption "Whether to run the HDFS JournalNode";
52− inherit restartIfChanged;
53− openFirewall = mkOption {
54− type = types.bool;
55− default = true;
56− description = ''
57− Open firewall ports for journalnode
58− '';
95+
96+ datanode = hadoopServiceOption { serviceName = "HDFS DataNode"; } // {
97+ dataDirs = mkOption {
98+ default = null;
99+ description = "Tier and path definitions for datanode storage.";
100+ type = with types; nullOr (listOf (submodule {
101+ options = {
102+ type = mkOption {
103+ type = enum [ "SSD" "DISK" "ARCHIVE" "RAM_DISK" ];
104+ description = ''
105+ Storage types ([SSD]/[DISK]/[ARCHIVE]/[RAM_DISK]) for HDFS storage policies.
106+ '';
107+ };
108+ path = mkOption {
109+ type = path;
110+ example = [ "/var/lib/hadoop/hdfs/dn" ];
111+ description = "Determines where on the local filesystem a data node should store its blocks.";
112+ };
113+ };
114+ }));
59115 };
60116 };
61− zkfc = {
62− enable = mkEnableOption "Whether to run the HDFS ZooKeeper failover controller";
63− inherit restartIfChanged;
117+
118+ journalnode = hadoopServiceOption { serviceName = "HDFS JournalNode"; };
119+
120+ zkfc = hadoopServiceOption {
121+ serviceName = "HDFS ZooKeeper failover controller";
122+ firewallOption = false;
64123 };
65− httpfs = {
66− enable = mkEnableOption "Whether to run the HDFS HTTPfs server";
124+
125+ httpfs = hadoopServiceOption { serviceName = "HDFS JournalNode"; } // {
67126 tempPath = mkOption {
68127 type = types.path;
69128 default = "/tmp/hadoop/httpfs";
70− description = ''
71− HTTPFS_TEMP path used by HTTPFS
72− '';
73− };
74− inherit restartIfChanged;
75− openFirewall = mkOption {
76− type = types.bool;
77− default = true;
78− description = ''
79− Open firewall ports for HTTPFS
80− '';
129+ description = "HTTPFS_TEMP path used by HTTPFS";
81130 };
82131 };
132+
83133 };
84134
85135 config = mkMerge [
86− (mkIf cfg.hdfs.namenode.enable {
87− systemd.services.hdfs-namenode = {
88− description = "Hadoop HDFS NameNode";
89− wantedBy = [ "multi-user.target" ];
90− inherit (cfg.hdfs.namenode) restartIfChanged;
91−
92− preStart = (mkIf cfg.hdfs.namenode.formatOnInit ''
93− ${cfg.package}/bin/hdfs --config ${hadoopConf} namenode -format -nonInteractive || true
94− '');
95−
96− serviceConfig = {
97− User = "hdfs";
98− SyslogIdentifier = "hdfs-namenode";
99− ExecStart = "${cfg.package}/bin/hdfs --config ${hadoopConf} namenode";
100− Restart = "always";
101− };
102− };
103−
104− networking.firewall.allowedTCPPorts = (mkIf cfg.hdfs.namenode.openFirewall [
136+ (hadoopServiceConfig {
137+ name = "NameNode";
138+ allowedTCPPorts = [
105139 9870 # namenode.http-address
106140 8020 # namenode.rpc-address
107− 8022 # namenode. servicerpc-address
108− ]);
141+ 8022 # namenode.servicerpc-address
142+ 8019 # dfs.ha.zkfc.port
143+ ];
144+ preStart = (mkIf cfg.hdfs.namenode.formatOnInit
145+ "${cfg.package}/bin/hdfs --config ${hadoopConf} namenode -format -nonInteractive || true"
146+ );
109147 })
110− (mkIf cfg.hdfs.datanode.enable {
111− systemd.services.hdfs-datanode = {
112− description = "Hadoop HDFS DataNode";
113− wantedBy = [ "multi-user.target" ];
114− inherit (cfg.hdfs.datanode) restartIfChanged;
115−
116− serviceConfig = {
117− User = "hdfs";
118− SyslogIdentifier = "hdfs-datanode";
119− ExecStart = "${cfg.package}/bin/hdfs --config ${hadoopConf} datanode";
120− Restart = "always";
121− };
122− };
123148
124− networking.firewall.allowedTCPPorts = (mkIf cfg.hdfs.datanode.openFirewall [
149+ (hadoopServiceConfig {
150+ name = "DataNode";
151+ # port numbers for datanode changed between hadoop 2 and 3
152+ allowedTCPPorts = if versionAtLeast cfg.package.version "3" then [
125153 9864 # datanode.http.address
126154 9866 # datanode.address
127155 9867 # datanode.ipc.address
128− ]);
156+ ] else [
157+ 50075 # datanode.http.address
158+ 50010 # datanode.address
159+ 50020 # datanode.ipc.address
160+ ];
161+ extraConfig.services.hadoop.hdfsSiteInternal."dfs.datanode.data.dir" = let d = cfg.hdfs.datanode.dataDirs; in
162+ if (d!= null) then (concatMapStringsSep "," (x: "["+x.type+"]file://"+x.path) cfg.hdfs.datanode.dataDirs) else d;
129163 })
130− (mkIf cfg.hdfs.journalnode.enable {
131− systemd.services.hdfs-journalnode = {
132− description = "Hadoop HDFS JournalNode";
133− wantedBy = [ "multi-user.target" ];
134− inherit (cfg.hdfs.journalnode) restartIfChanged;
135−
136− serviceConfig = {
137− User = "hdfs";
138− SyslogIdentifier = "hdfs-journalnode";
139− ExecStart = "${cfg.package}/bin/hdfs --config ${hadoopConf} journalnode";
140− Restart = "always";
141− };
142− };
143164
144− networking.firewall.allowedTCPPorts = (mkIf cfg.hdfs.journalnode.openFirewall [
165+ (hadoopServiceConfig {
166+ name = "JournalNode";
167+ allowedTCPPorts = [
145168 8480 # dfs.journalnode.http-address
146169 8485 # dfs.journalnode.rpc-address
147− ]);
170+ ];
148171 })
149− (mkIf cfg.hdfs.zkfc.enable {
150− systemd.services.hdfs-zkfc = {
151− description = "Hadoop HDFS ZooKeeper failover controller";
152− wantedBy = [ "multi-user.target" ];
153− inherit (cfg.hdfs.zkfc) restartIfChanged;
154−
155− serviceConfig = {
156− User = "hdfs";
157− SyslogIdentifier = "hdfs-zkfc";
158− ExecStart = "${cfg.package}/bin/hdfs --config ${hadoopConf} zkfc";
159− Restart = "always";
160− };
161− };
162− })
163− (mkIf cfg.hdfs.httpfs.enable {
164− systemd.services.hdfs-httpfs = {
165− description = "Hadoop httpfs";
166− wantedBy = [ "multi-user.target" ];
167− inherit (cfg.hdfs.httpfs) restartIfChanged;
168−
169− environment.HTTPFS_TEMP = cfg.hdfs.httpfs.tempPath;
170172
171− preStart = ''
172− mkdir -p $HTTPFS_TEMP
173− '';
173+ (hadoopServiceConfig {
174+ name = "zkfc";
175+ description = "Hadoop HDFS ZooKeeper failover controller";
176+ })
174177
175− serviceConfig = {
176− User = "httpfs";
177− SyslogIdentifier = "hdfs-httpfs";
178− ExecStart = "${cfg.package}/bin/hdfs --config ${hadoopConf} httpfs";
179− Restart = "always";
180− };
181− };
182− networking.firewall.allowedTCPPorts = (mkIf cfg.hdfs.httpfs.openFirewall [
178+ (hadoopServiceConfig {
179+ name = "HTTPFS";
180+ environment.HTTPFS_TEMP = cfg.hdfs.httpfs.tempPath;
181+ preStart = "mkdir -p $HTTPFS_TEMP";
182+ User = "httpfs";
183+ allowedTCPPorts = [
183184 14000 # httpfs.http.port
184− ]);
185+ ];
185186 })
186− (mkIf (
187− cfg.hdfs.namenode.enable || cfg.hdfs.datanode.enable || cfg.hdfs.journalnode.enable || cfg.hdfs.zkfc.enable
188− ) {
187+
188+ (mkIf cfg.gatewayRole.enable {
189189 users.users.hdfs = {
190190 description = "Hadoop HDFS user";
191191 group = "hadoop";
@@ -199,5 +199,6 @@ in
199199 isSystemUser = true;
200200 };
201201 })
202+
202203 ];
203204}
nixos/modules/services/cluster/hadoop/yarn.nix+85−13
@@ -13,23 +13,77 @@ let
1313 '';
1414 default = false;
1515 };
16+ extraFlags = mkOption{
17+ type = with types; listOf str;
18+ default = [];
19+ description = "Extra command line flags to pass to the service";
20+ example = [
21+ "-Dcom.sun.management.jmxremote"
22+ "-Dcom.sun.management.jmxremote.port=8010"
23+ ];
24+ };
25+ extraEnv = mkOption{
26+ type = with types; attrsOf str;
27+ default = {};
28+ description = "Extra environment variables";
29+ };
1630in
1731{
1832 options.services.hadoop.yarn = {
1933 resourcemanager = {
20− enable = mkEnableOption "Whether to run the Hadoop YARN ResourceManager";
21− inherit restartIfChanged;
34+ enable = mkEnableOption "Hadoop YARN ResourceManager";
35+ inherit restartIfChanged extraFlags extraEnv;
36+
2237 openFirewall = mkOption {
2338 type = types.bool;
24− default = true;
39+ default = false;
2540 description = ''
2641 Open firewall ports for resourcemanager
2742 '';
2843 };
2944 };
3045 nodemanager = {
31− enable = mkEnableOption "Whether to run the Hadoop YARN NodeManager";
32− inherit restartIfChanged;
46+ enable = mkEnableOption "Hadoop YARN NodeManager";
47+ inherit restartIfChanged extraFlags extraEnv;
48+
49+ resource = {
50+ cpuVCores = mkOption {
51+ description = "Number of vcores that can be allocated for containers.";
52+ type = with types; nullOr ints.positive;
53+ default = null;
54+ };
55+ maximumAllocationVCores = mkOption {
56+ description = "The maximum virtual CPU cores any container can be allocated.";
57+ type = with types; nullOr ints.positive;
58+ default = null;
59+ };
60+ memoryMB = mkOption {
61+ description = "Amount of physical memory, in MB, that can be allocated for containers.";
62+ type = with types; nullOr ints.positive;
63+ default = null;
64+ };
65+ maximumAllocationMB = mkOption {
66+ description = "The maximum physical memory any container can be allocated.";
67+ type = with types; nullOr ints.positive;
68+ default = null;
69+ };
70+ };
71+
72+ useCGroups = mkOption {
73+ type = types.bool;
74+ default = true;
75+ description = ''
76+ Use cgroups to enforce resource limits on containers
77+ '';
78+ };
79+
80+ localDir = mkOption {
81+ description = "List of directories to store localized files in.";
82+ type = with types; nullOr (listOf path);
83+ example = [ "/var/lib/hadoop/yarn/nm" ];
84+ default = null;
85+ };
86+
3387 addBinBash = mkOption {
3488 type = types.bool;
3589 default = true;
@@ -39,7 +93,7 @@ in
3993 };
4094 openFirewall = mkOption {
4195 type = types.bool;
42− default = true;
96+ default = false;
4397 description = ''
4498 Open firewall ports for nodemanager.
4599 Because containers can listen on any ephemeral port, TCP ports 1024–65535 will be opened.
@@ -49,10 +103,7 @@ in
49103 };
50104
51105 config = mkMerge [
52− (mkIf (
53− cfg.yarn.resourcemanager.enable || cfg.yarn.nodemanager.enable
54− ) {
55−
106+ (mkIf cfg.gatewayRole.enable {
56107 users.users.yarn = {
57108 description = "Hadoop YARN user";
58109 group = "hadoop";
@@ -65,15 +116,19 @@ in
65116 description = "Hadoop YARN ResourceManager";
66117 wantedBy = [ "multi-user.target" ];
67118 inherit (cfg.yarn.resourcemanager) restartIfChanged;
119+ environment = cfg.yarn.resourcemanager.extraEnv;
68120
69121 serviceConfig = {
70122 User = "yarn";
71123 SyslogIdentifier = "yarn-resourcemanager";
72124 ExecStart = "${cfg.package}/bin/yarn --config ${hadoopConf} " +
73− " resourcemanager";
125+ " resourcemanager ${escapeShellArgs cfg.yarn.resourcemanager.extraFlags}";
74126 Restart = "always";
75127 };
76128 };
129+
130+ services.hadoop.gatewayRole.enable = true;
131+
77132 networking.firewall.allowedTCPPorts = (mkIf cfg.yarn.resourcemanager.openFirewall [
78133 8088 # resourcemanager.webapp.address
79134 8030 # resourcemanager.scheduler.address
@@ -94,6 +149,7 @@ in
94149 description = "Hadoop YARN NodeManager";
95150 wantedBy = [ "multi-user.target" ];
96151 inherit (cfg.yarn.nodemanager) restartIfChanged;
152+ environment = cfg.yarn.nodemanager.extraEnv;
97153
98154 preStart = ''
99155 # create log dir
@@ -101,8 +157,9 @@ in
101157 chown yarn:hadoop /var/log/hadoop/yarn/nodemanager
102158
103159 # set up setuid container executor binary
160+ umount /run/wrappers/yarn-nodemanager/cgroup/cpu || true
104161 rm -rf /run/wrappers/yarn-nodemanager/ || true
105− mkdir -p /run/wrappers/yarn-nodemanager/{bin,etc/hadoop}
162+ mkdir -p /run/wrappers/yarn-nodemanager/{bin,etc/hadoop,cgroup/cpu}
106163 cp ${cfg.package}/lib/${cfg.package.untarDir}/bin/container-executor /run/wrappers/yarn-nodemanager/bin/
107164 chgrp hadoop /run/wrappers/yarn-nodemanager/bin/container-executor
108165 chmod 6050 /run/wrappers/yarn-nodemanager/bin/container-executor
@@ -114,11 +171,26 @@ in
114171 SyslogIdentifier = "yarn-nodemanager";
115172 PermissionsStartOnly = true;
116173 ExecStart = "${cfg.package}/bin/yarn --config ${hadoopConf} " +
117− " nodemanager";
174+ " nodemanager ${escapeShellArgs cfg.yarn.nodemanager.extraFlags}";
118175 Restart = "always";
119176 };
120177 };
121178
179+ services.hadoop.gatewayRole.enable = true;
180+
181+ services.hadoop.yarnSiteInternal = with cfg.yarn.nodemanager; {
182+ "yarn.nodemanager.local-dirs" = localDir;
183+ "yarn.scheduler.maximum-allocation-vcores" = resource.maximumAllocationVCores;
184+ "yarn.scheduler.maximum-allocation-mb" = resource.maximumAllocationMB;
185+ "yarn.nodemanager.resource.cpu-vcores" = resource.cpuVCores;
186+ "yarn.nodemanager.resource.memory-mb" = resource.memoryMB;
187+ } // mkIf useCGroups {
188+ "yarn.nodemanager.linux-container-executor.cgroups.hierarchy" = "/hadoop-yarn";
189+ "yarn.nodemanager.linux-container-executor.resources-handler.class" = "org.apache.hadoop.yarn.server.nodemanager.util.CgroupsLCEResourcesHandler";
190+ "yarn.nodemanager.linux-container-executor.cgroups.mount" = "true";
191+ "yarn.nodemanager.linux-container-executor.cgroups.mount-path" = "/run/wrappers/yarn-nodemanager/cgroup";
192+ };
193+
122194 networking.firewall.allowedTCPPortRanges = [
123195 (mkIf (cfg.yarn.nodemanager.openFirewall) {from = 1024; to = 65535;})
124196 ];
nixos/modules/services/web-apps/nextcloud.nix+1−10
@@ -153,7 +153,7 @@ in {
153153 package = mkOption {
154154 type = types.package;
155155 description = "Which package to use for the Nextcloud instance.";
156− relatedPackages = [ "nextcloud21" "nextcloud22" "nextcloud23" ];
156+ relatedPackages = [ "nextcloud22" "nextcloud23" ];
157157 };
158158 phpPackage = mkOption {
159159 type = types.package;
@@ -571,15 +571,6 @@ in {
571571 nextcloud defined in an overlay, please set `services.nextcloud.package` to
572572 `pkgs.nextcloud`.
573573 ''
574− # 21.03 will not be an official release - it was instead 21.05.
575− # This versionOlder statement remains set to 21.03 for backwards compatibility.
576− # See https://github.com/NixOS/nixpkgs/pull/108899 and
577− # https://github.com/NixOS/rfcs/blob/master/rfcs/0080-nixos-release-schedule.md.
578− # FIXME(@Ma27) remove this else-if as soon as 21.05 is EOL! This is only here
579− # to ensure that users who are on Nextcloud 19 with a stateVersion <21.05 with
580− # no explicit services.nextcloud.package don't upgrade to v21 by accident (
581− # nextcloud20 throws an eval-error because it's dropped).
582− else if versionOlder stateVersion "21.03" then nextcloud20
583574 else if versionOlder stateVersion "21.11" then nextcloud21
584575 else if versionOlder stateVersion "22.05" then nextcloud22
585576 else nextcloud23
nixos/tests/all-tests.nix+3−3
@@ -189,9 +189,9 @@ in
189189 grocy = handleTest ./grocy.nix {};
190190 grub = handleTest ./grub.nix {};
191191 gvisor = handleTest ./gvisor.nix {};
192− hadoop.all = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./hadoop/hadoop.nix {};
193− hadoop.hdfs = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./hadoop/hdfs.nix {};
194− hadoop.yarn = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./hadoop/yarn.nix {};
192+ hadoop = import ./hadoop { inherit handleTestOn; package=pkgs.hadoop; };
193+ hadoop_3_2 = import ./hadoop { inherit handleTestOn; package=pkgs.hadoop_3_2; };
194+ hadoop2 = import ./hadoop { inherit handleTestOn; package=pkgs.hadoop2; };
195195 haka = handleTest ./haka.nix {};
196196 haproxy = handleTest ./haproxy.nix {};
197197 hardened = handleTest ./hardened.nix {};
nixos/tests/hadoop/default.nixnew file+7
@@ -0,0 +1,7 @@
1+{ handleTestOn, package, ... }:
2+
3+{
4+ all = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./hadoop.nix { inherit package; };
5+ hdfs = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./hdfs.nix { inherit package; };
6+ yarn = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./yarn.nix { inherit package; };
7+}
nixos/tests/hadoop/hadoop.nix+150−123
@@ -1,121 +1,148 @@
11# This test is very comprehensive. It tests whether all hadoop services work well with each other.
22# Run this when updating the Hadoop package or making significant changes to the hadoop module.
33# For a more basic test, see hdfs.nix and yarn.nix
4−import ../make-test-python.nix ({pkgs, ...}: {
5−
6− nodes = let
7− package = pkgs.hadoop;
8− coreSite = {
9− "fs.defaultFS" = "hdfs://ns1";
10− };
11− hdfsSite = {
12− "dfs.namenode.rpc-bind-host" = "0.0.0.0";
13− "dfs.namenode.http-bind-host" = "0.0.0.0";
14− "dfs.namenode.servicerpc-bind-host" = "0.0.0.0";
15−
16− # HA Quorum Journal Manager configuration
17− "dfs.nameservices" = "ns1";
18− "dfs.ha.namenodes.ns1" = "nn1,nn2";
19− "dfs.namenode.shared.edits.dir.ns1.nn1" = "qjournal://jn1:8485;jn2:8485;jn3:8485/ns1";
20− "dfs.namenode.shared.edits.dir.ns1.nn2" = "qjournal://jn1:8485;jn2:8485;jn3:8485/ns1";
21− "dfs.namenode.rpc-address.ns1.nn1" = "nn1:8020";
22− "dfs.namenode.rpc-address.ns1.nn2" = "nn2:8020";
23− "dfs.namenode.servicerpc-address.ns1.nn1" = "nn1:8022";
24− "dfs.namenode.servicerpc-address.ns1.nn2" = "nn2:8022";
25− "dfs.namenode.http-address.ns1.nn1" = "nn1:9870";
26− "dfs.namenode.http-address.ns1.nn2" = "nn2:9870";
27−
28− # Automatic failover configuration
29− "dfs.client.failover.proxy.provider.ns1" = "org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider";
30− "dfs.ha.automatic-failover.enabled.ns1" = "true";
31− "dfs.ha.fencing.methods" = "shell(true)";
32− "ha.zookeeper.quorum" = "zk1:2181";
33− };
34− yarnSiteHA = {
35− "yarn.resourcemanager.zk-address" = "zk1:2181";
36− "yarn.resourcemanager.ha.enabled" = "true";
37− "yarn.resourcemanager.ha.rm-ids" = "rm1,rm2";
38− "yarn.resourcemanager.hostname.rm1" = "rm1";
39− "yarn.resourcemanager.hostname.rm2" = "rm2";
40− "yarn.resourcemanager.ha.automatic-failover.enabled" = "true";
41− "yarn.resourcemanager.cluster-id" = "cluster1";
42− # yarn.resourcemanager.webapp.address needs to be defined even though yarn.resourcemanager.hostname is set. This shouldn't be necessary, but there's a bug in
43− # hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/amfilter/AmFilterInitializer.java:70
44− # that causes AM containers to fail otherwise.
45− "yarn.resourcemanager.webapp.address.rm1" = "rm1:8088";
46− "yarn.resourcemanager.webapp.address.rm2" = "rm2:8088";
47− };
48− in {
49− zk1 = { ... }: {
50− services.zookeeper.enable = true;
51− networking.firewall.allowedTCPPorts = [ 2181 ];
52− };
53−
54− # HDFS cluster
55− nn1 = {pkgs, options, ...}: {
56− services.hadoop = {
57− inherit package coreSite hdfsSite;
58− hdfs.namenode.enable = true;
59− hdfs.zkfc.enable = true;
4+import ../make-test-python.nix ({ package, ... }: {
5+ name = "hadoop-combined";
6+
7+ nodes =
8+ let
9+ coreSite = {
10+ "fs.defaultFS" = "hdfs://ns1";
11+ };
12+ hdfsSite = {
13+ # HA Quorum Journal Manager configuration
14+ "dfs.nameservices" = "ns1";
15+ "dfs.ha.namenodes.ns1" = "nn1,nn2";
16+ "dfs.namenode.shared.edits.dir.ns1" = "qjournal://jn1:8485;jn2:8485;jn3:8485/ns1";
17+ "dfs.namenode.rpc-address.ns1.nn1" = "nn1:8020";
18+ "dfs.namenode.rpc-address.ns1.nn2" = "nn2:8020";
19+ "dfs.namenode.servicerpc-address.ns1.nn1" = "nn1:8022";
20+ "dfs.namenode.servicerpc-address.ns1.nn2" = "nn2:8022";
21+ "dfs.namenode.http-address.ns1.nn1" = "nn1:9870";
22+ "dfs.namenode.http-address.ns1.nn2" = "nn2:9870";
23+
24+ # Automatic failover configuration
25+ "dfs.client.failover.proxy.provider.ns1" = "org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider";
26+ "dfs.ha.automatic-failover.enabled.ns1" = "true";
27+ "dfs.ha.fencing.methods" = "shell(true)";
28+ "ha.zookeeper.quorum" = "zk1:2181";
29+ };
30+ yarnSite = {
31+ "yarn.resourcemanager.zk-address" = "zk1:2181";
32+ "yarn.resourcemanager.ha.enabled" = "true";
33+ "yarn.resourcemanager.ha.rm-ids" = "rm1,rm2";
34+ "yarn.resourcemanager.hostname.rm1" = "rm1";
35+ "yarn.resourcemanager.hostname.rm2" = "rm2";
36+ "yarn.resourcemanager.ha.automatic-failover.enabled" = "true";
37+ "yarn.resourcemanager.cluster-id" = "cluster1";
38+ # yarn.resourcemanager.webapp.address needs to be defined even though yarn.resourcemanager.hostname is set. This shouldn't be necessary, but there's a bug in
39+ # hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/amfilter/AmFilterInitializer.java:70
40+ # that causes AM containers to fail otherwise.
41+ "yarn.resourcemanager.webapp.address.rm1" = "rm1:8088";
42+ "yarn.resourcemanager.webapp.address.rm2" = "rm2:8088";
43+ };
44+ in
45+ {
46+ zk1 = { ... }: {
47+ services.zookeeper.enable = true;
48+ networking.firewall.allowedTCPPorts = [ 2181 ];
6049 };
61− };
62− nn2 = {pkgs, options, ...}: {
63− services.hadoop = {
64− inherit package coreSite hdfsSite;
65− hdfs.namenode.enable = true;
66− hdfs.zkfc.enable = true;
50+
51+ # HDFS cluster
52+ nn1 = { ... }: {
53+ services.hadoop = {
54+ inherit package coreSite hdfsSite;
55+ hdfs.namenode = {
56+ enable = true;
57+ openFirewall = true;
58+ };
59+ hdfs.zkfc.enable = true;
60+ };
61+ };
62+ nn2 = { ... }: {
63+ services.hadoop = {
64+ inherit package coreSite hdfsSite;
65+ hdfs.namenode = {
66+ enable = true;
67+ openFirewall = true;
68+ };
69+ hdfs.zkfc.enable = true;
70+ };
6771 };
68− };
6972
70− jn1 = {pkgs, options, ...}: {
71− services.hadoop = {
72− inherit package coreSite hdfsSite;
73− hdfs.journalnode.enable = true;
73+ jn1 = { ... }: {
74+ services.hadoop = {
75+ inherit package coreSite hdfsSite;
76+ hdfs.journalnode = {
77+ enable = true;
78+ openFirewall = true;
79+ };
80+ };
7481 };
75− };
76− jn2 = {pkgs, options, ...}: {
77− services.hadoop = {
78− inherit package coreSite hdfsSite;
79− hdfs.journalnode.enable = true;
82+ jn2 = { ... }: {
83+ services.hadoop = {
84+ inherit package coreSite hdfsSite;
85+ hdfs.journalnode = {
86+ enable = true;
87+ openFirewall = true;
88+ };
89+ };
8090 };
81− };
82− jn3 = {pkgs, options, ...}: {
83− services.hadoop = {
84− inherit package coreSite hdfsSite;
85− hdfs.journalnode.enable = true;
91+ jn3 = { ... }: {
92+ services.hadoop = {
93+ inherit package coreSite hdfsSite;
94+ hdfs.journalnode = {
95+ enable = true;
96+ openFirewall = true;
97+ };
98+ };
99+ };
100+
101+ dn1 = { ... }: {
102+ services.hadoop = {
103+ inherit package coreSite hdfsSite;
104+ hdfs.datanode = {
105+ enable = true;
106+ openFirewall = true;
107+ };
108+ };
86109 };
87− };
88110
89− dn1 = {pkgs, options, ...}: {
90− services.hadoop = {
91− inherit package coreSite hdfsSite;
92− hdfs.datanode.enable = true;
111+ # YARN cluster
112+ rm1 = { options, ... }: {
113+ services.hadoop = {
114+ inherit package coreSite hdfsSite yarnSite;
115+ yarn.resourcemanager = {
116+ enable = true;
117+ openFirewall = true;
118+ };
119+ };
93120 };
94− };
95−
96− # YARN cluster
97− rm1 = {pkgs, options, ...}: {
98− services.hadoop = {
99− inherit package coreSite hdfsSite;
100− yarnSite = options.services.hadoop.yarnSite.default // yarnSiteHA;
101− yarn.resourcemanager.enable = true;
121+ rm2 = { options, ... }: {
122+ services.hadoop = {
123+ inherit package coreSite hdfsSite yarnSite;
124+ yarn.resourcemanager = {
125+ enable = true;
126+ openFirewall = true;
127+ };
128+ };
102129 };
103− };
104− rm2 = {pkgs, options, ...}: {
105− services.hadoop = {
106− inherit package coreSite hdfsSite;
107− yarnSite = options.services.hadoop.yarnSite.default // yarnSiteHA;
108− yarn.resourcemanager.enable = true;
130+ nm1 = { options, ... }: {
131+ virtualisation.memorySize = 2048;
132+ services.hadoop = {
133+ inherit package coreSite hdfsSite yarnSite;
134+ yarn.nodemanager = {
135+ enable = true;
136+ openFirewall = true;
137+ };
138+ };
109139 };
110− };
111− nm1 = {pkgs, options, ...}: {
112− virtualisation.memorySize = 2048;
113− services.hadoop = {
114− inherit package coreSite hdfsSite;
115− yarnSite = options.services.hadoop.yarnSite.default // yarnSiteHA;
116− yarn.nodemanager.enable = true;
140+ client = { options, ... }: {
141+ services.hadoop = {
142+ gatewayRole.enable = true;
143+ inherit package coreSite hdfsSite yarnSite;
144+ };
117145 };
118− };
119146 };
120147
121148 testScript = ''
@@ -173,26 +200,26 @@ import ../make-test-python.nix ({pkgs, ...}: {
173200 # DN should have started by now, but confirm anyway
174201 dn1.wait_for_unit("hdfs-datanode")
175202 # Print states of namenodes
176− dn1.succeed("sudo -u hdfs hdfs haadmin -getAllServiceState | systemd-cat")
203+ client.succeed("sudo -u hdfs hdfs haadmin -getAllServiceState | systemd-cat")
177204 # Wait for cluster to exit safemode
178− dn1.succeed("sudo -u hdfs hdfs dfsadmin -safemode wait")
179− dn1.succeed("sudo -u hdfs hdfs haadmin -getAllServiceState | systemd-cat")
205+ client.succeed("sudo -u hdfs hdfs dfsadmin -safemode wait")
206+ client.succeed("sudo -u hdfs hdfs haadmin -getAllServiceState | systemd-cat")
180207 # test R/W
181− dn1.succeed("echo testfilecontents | sudo -u hdfs hdfs dfs -put - /testfile")
182− assert "testfilecontents" in dn1.succeed("sudo -u hdfs hdfs dfs -cat /testfile")
208+ client.succeed("echo testfilecontents | sudo -u hdfs hdfs dfs -put - /testfile")
209+ assert "testfilecontents" in client.succeed("sudo -u hdfs hdfs dfs -cat /testfile")
183210
184211 # Test NN failover
185212 nn1.succeed("systemctl stop hdfs-namenode")
186− assert "active" in dn1.succeed("sudo -u hdfs hdfs haadmin -getAllServiceState")
187− dn1.succeed("sudo -u hdfs hdfs haadmin -getAllServiceState | systemd-cat")
188− assert "testfilecontents" in dn1.succeed("sudo -u hdfs hdfs dfs -cat /testfile")
213+ assert "active" in client.succeed("sudo -u hdfs hdfs haadmin -getAllServiceState")
214+ client.succeed("sudo -u hdfs hdfs haadmin -getAllServiceState | systemd-cat")
215+ assert "testfilecontents" in client.succeed("sudo -u hdfs hdfs dfs -cat /testfile")
189216
190217 nn1.succeed("systemctl start hdfs-namenode")
191218 nn1.wait_for_open_port(9870)
192219 nn1.wait_for_open_port(8022)
193220 nn1.wait_for_open_port(8020)
194− assert "standby" in dn1.succeed("sudo -u hdfs hdfs haadmin -getAllServiceState")
195− dn1.succeed("sudo -u hdfs hdfs haadmin -getAllServiceState | systemd-cat")
221+ assert "standby" in client.succeed("sudo -u hdfs hdfs haadmin -getAllServiceState")
222+ client.succeed("sudo -u hdfs hdfs haadmin -getAllServiceState | systemd-cat")
196223
197224 #### YARN tests ####
198225
@@ -208,21 +235,21 @@ import ../make-test-python.nix ({pkgs, ...}: {
208235 nm1.wait_for_unit("yarn-nodemanager")
209236 nm1.wait_for_open_port(8042)
210237 nm1.wait_for_open_port(8040)
211− nm1.wait_until_succeeds("yarn node -list | grep Nodes:1")
212− nm1.succeed("sudo -u yarn yarn rmadmin -getAllServiceState | systemd-cat")
213− nm1.succeed("sudo -u yarn yarn node -list | systemd-cat")
238+ client.wait_until_succeeds("yarn node -list | grep Nodes:1")
239+ client.succeed("sudo -u yarn yarn rmadmin -getAllServiceState | systemd-cat")
240+ client.succeed("sudo -u yarn yarn node -list | systemd-cat")
214241
215242 # Test RM failover
216243 rm1.succeed("systemctl stop yarn-resourcemanager")
217− assert "standby" not in nm1.succeed("sudo -u yarn yarn rmadmin -getAllServiceState")
218− nm1.succeed("sudo -u yarn yarn rmadmin -getAllServiceState | systemd-cat")
244+ assert "standby" not in client.succeed("sudo -u yarn yarn rmadmin -getAllServiceState")
245+ client.succeed("sudo -u yarn yarn rmadmin -getAllServiceState | systemd-cat")
219246 rm1.succeed("systemctl start yarn-resourcemanager")
220247 rm1.wait_for_unit("yarn-resourcemanager")
221248 rm1.wait_for_open_port(8088)
222− assert "standby" in nm1.succeed("sudo -u yarn yarn rmadmin -getAllServiceState")
223− nm1.succeed("sudo -u yarn yarn rmadmin -getAllServiceState | systemd-cat")
249+ assert "standby" in client.succeed("sudo -u yarn yarn rmadmin -getAllServiceState")
250+ client.succeed("sudo -u yarn yarn rmadmin -getAllServiceState | systemd-cat")
224251
225− assert "Estimated value of Pi is" in nm1.succeed("HADOOP_USER_NAME=hdfs yarn jar $(readlink $(which yarn) | sed -r 's~bin/yarn~lib/hadoop-*/share/hadoop/mapreduce/hadoop-mapreduce-examples-*.jar~g') pi 2 10")
226− assert "SUCCEEDED" in nm1.succeed("yarn application -list -appStates FINISHED")
252+ assert "Estimated value of Pi is" in client.succeed("HADOOP_USER_NAME=hdfs yarn jar $(readlink $(which yarn) | sed -r 's~bin/yarn~lib/hadoop-*/share/hadoop/mapreduce/hadoop-mapreduce-examples-*.jar~g') pi 2 10")
253+ assert "SUCCEEDED" in client.succeed("yarn application -list -appStates FINISHED")
227254 '';
228255})
nixos/tests/hadoop/hdfs.nix+43−18
@@ -1,32 +1,46 @@
11# Test a minimal HDFS cluster with no HA
2−import ../make-test-python.nix ({...}: {
3− nodes = {
4− namenode = {pkgs, ...}: {
2+import ../make-test-python.nix ({ package, lib, ... }:
3+with lib;
4+{
5+ name = "hadoop-hdfs";
6+
7+ nodes = let
8+ coreSite = {
9+ "fs.defaultFS" = "hdfs://namenode:8020";
10+ "hadoop.proxyuser.httpfs.groups" = "*";
11+ "hadoop.proxyuser.httpfs.hosts" = "*";
12+ };
13+ in {
14+ namenode = { pkgs, ... }: {
515 services.hadoop = {
6− package = pkgs.hadoop;
16+ inherit package;
717 hdfs = {
818 namenode = {
919 enable = true;
20+ openFirewall = true;
1021 formatOnInit = true;
1122 };
12− httpfs.enable = true;
13− };
14− coreSite = {
15− "fs.defaultFS" = "hdfs://namenode:8020";
16− "hadoop.proxyuser.httpfs.groups" = "*";
17− "hadoop.proxyuser.httpfs.hosts" = "*";
23+ httpfs = {
24+ # The NixOS hadoop module only support webHDFS on 3.3 and newer
25+ enable = mkIf (versionAtLeast package.version "3.3") true;
26+ openFirewall = true;
27+ };
1828 };
29+ inherit coreSite;
1930 };
2031 };
21− datanode = {pkgs, ...}: {
32+ datanode = { pkgs, ... }: {
2233 services.hadoop = {
23− package = pkgs.hadoop;
24− hdfs.datanode.enable = true;
25− coreSite = {
26− "fs.defaultFS" = "hdfs://namenode:8020";
27− "hadoop.proxyuser.httpfs.groups" = "*";
28− "hadoop.proxyuser.httpfs.hosts" = "*";
34+ inherit package;
35+ hdfs.datanode = {
36+ enable = true;
37+ openFirewall = true;
38+ dataDirs = [{
39+ type = "DISK";
40+ path = "/tmp/dn1";
41+ }];
2942 };
43+ inherit coreSite;
3044 };
3145 };
3246 };
@@ -37,21 +51,32 @@ import ../make-test-python.nix ({...}: {
3751 namenode.wait_for_unit("hdfs-namenode")
3852 namenode.wait_for_unit("network.target")
3953 namenode.wait_for_open_port(8020)
54+ namenode.succeed("ss -tulpne | systemd-cat")
55+ namenode.succeed("cat /etc/hadoop*/hdfs-site.xml | systemd-cat")
4056 namenode.wait_for_open_port(9870)
4157
4258 datanode.wait_for_unit("hdfs-datanode")
4359 datanode.wait_for_unit("network.target")
60+ '' + ( if versionAtLeast package.version "3" then ''
4461 datanode.wait_for_open_port(9864)
4562 datanode.wait_for_open_port(9866)
4663 datanode.wait_for_open_port(9867)
4764
48− namenode.succeed("curl -f http://namenode:9870")
4965 datanode.succeed("curl -f http://datanode:9864")
66+ '' else ''
67+ datanode.wait_for_open_port(50075)
68+ datanode.wait_for_open_port(50010)
69+ datanode.wait_for_open_port(50020)
70+
71+ datanode.succeed("curl -f http://datanode:50075")
72+ '' ) + ''
73+ namenode.succeed("curl -f http://namenode:9870")
5074
5175 datanode.succeed("sudo -u hdfs hdfs dfsadmin -safemode wait")
5276 datanode.succeed("echo testfilecontents | sudo -u hdfs hdfs dfs -put - /testfile")
5377 assert "testfilecontents" in datanode.succeed("sudo -u hdfs hdfs dfs -cat /testfile")
5478
79+ '' + optionalString ( versionAtLeast package.version "3.3" ) ''
5580 namenode.wait_for_unit("hdfs-httpfs")
5681 namenode.wait_for_open_port(14000)
5782 assert "testfilecontents" in datanode.succeed("curl -f \"http://namenode:14000/webhdfs/v1/testfile?user.name=hdfs&op=OPEN\" 2>&1")
nixos/tests/hadoop/yarn.nix+21−13
@@ -1,22 +1,30 @@
11# This only tests if YARN is able to start its services
2−import ../make-test-python.nix ({...}: {
2+import ../make-test-python.nix ({ package, ... }: {
3+ name = "hadoop-yarn";
4+
35 nodes = {
4− resourcemanager = {pkgs, ...}: {
5− services.hadoop.package = pkgs.hadoop;
6− services.hadoop.yarn.resourcemanager.enable = true;
7− services.hadoop.yarnSite = {
8− "yarn.resourcemanager.scheduler.class" = "org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler";
6+ resourcemanager = { ... }: {
7+ services.hadoop = {
8+ inherit package;
9+ yarn.resourcemanager = {
10+ enable = true;
11+ openFirewall = true;
12+ };
913 };
1014 };
11− nodemanager = {pkgs, ...}: {
12− services.hadoop.package = pkgs.hadoop;
13− services.hadoop.yarn.nodemanager.enable = true;
14− services.hadoop.yarnSite = {
15− "yarn.resourcemanager.hostname" = "resourcemanager";
16− "yarn.nodemanager.log-dirs" = "/tmp/userlogs";
15+ nodemanager = { options, lib, ... }: {
16+ services.hadoop = {
17+ inherit package;
18+ yarn.nodemanager = {
19+ enable = true;
20+ openFirewall = true;
21+ };
22+ yarnSite = options.services.hadoop.yarnSite.default // {
23+ "yarn.resourcemanager.hostname" = "resourcemanager";
24+ "yarn.nodemanager.log-dirs" = "/tmp/userlogs";
25+ };
1726 };
1827 };
19−
2028 };
2129
2230 testScript = ''
nixos/tests/nextcloud/default.nix+1−1
@@ -18,4 +18,4 @@ foldl
1818 };
1919 })
2020{ }
21− [ 21 22 23 ]
21+ [ 22 23 ]
pkgs/applications/networking/cluster/fluxcd/default.nix+4−4
@@ -1,9 +1,9 @@
11{ lib, buildGoModule, fetchFromGitHub, fetchzip, installShellFiles }:
22
33let
4− version = "0.27.3";
5− sha256 = "08ax1033456hfm5qz0r671xm5ig0047nqp7xffyn9za498bm4i5q";
6− manifestsSha256 = "165kspq10nvlihcb1460qmbw5r1mlzs5gliw01qa4mymvzmlggk7";
4+ version = "0.27.4";
5+ sha256 = "06951i332gr17nsbns8mh4kcjilqfw5w95shaznpaksx93f554g0";
6+ manifestsSha256 = "0fvzh7j3vi5hw8jbw2gisjnn53bffwnp7zm3dwcbv3svwpw7823d";
77
88 manifests = fetchzip {
99 url =
@@ -23,7 +23,7 @@ in buildGoModule rec {
2323 inherit sha256;
2424 };
2525
26− vendorSha256 = "sha256-ENSfec7iSKOkILgVCVnORpAia4D+vBjQAUXDA7EIvVQ=";
26+ vendorSha256 = "sha256-7sHLXjyYMWSFckDPeVGJYK+nwhbRpD76tV334PCVYwA=";
2727
2828 postUnpack = ''
2929 cp -r ${manifests} source/cmd/flux/manifests
pkgs/applications/networking/cluster/hadoop/default.nix+39−26
@@ -15,6 +15,8 @@
1515, zlib
1616, zstd
1717, openssl
18+, glibc
19+, nixosTests
1820}:
1921
2022with lib;
@@ -22,7 +24,7 @@ with lib;
2224assert elem stdenv.system [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
2325
2426let
25− common = { pname, version, untarDir ? "${pname}-${version}", sha256, jdk, openssl ? null, nativeLibs ? [ ], libPatches ? "" }:
27+ common = { pname, version, untarDir ? "${pname}-${version}", sha256, jdk, openssl ? null, nativeLibs ? [ ], libPatches ? "", tests }:
2628 stdenv.mkDerivation rec {
2729 inherit pname version jdk libPatches untarDir openssl;
2830 src = fetchurl {
@@ -38,7 +40,10 @@ let
3840 installPhase = ''
3941 mkdir -p $out/{lib/${untarDir}/conf,bin,lib}
4042 mv * $out/lib/${untarDir}
41−
43+ '' + optionalString stdenv.isLinux ''
44+ # All versions need container-executor, but some versions can't use autoPatchelf because of broken SSL versions
45+ patchelf --set-interpreter ${glibc.out}/lib64/ld-linux-x86-64.so.2 $out/lib/${untarDir}/bin/container-executor
46+ '' + ''
4247 for n in $(find $out/lib/${untarDir}/bin -type f ! -name "*.*"); do
4348 makeWrapper "$n" "$out/bin/$(basename $n)"\
4449 --set-default JAVA_HOME ${jdk.home}\
@@ -49,6 +54,8 @@ let
4954 done
5055 '' + libPatches;
5156
57+ passthru = { inherit tests; };
58+
5259 meta = {
5360 homepage = "https://hadoop.apache.org/";
5461 description = "Framework for distributed processing of large data sets across clusters of computers";
@@ -73,30 +80,34 @@ in
7380{
7481 # Different version of hadoop support different java runtime versions
7582 # https://cwiki.apache.org/confluence/display/HADOOP/Hadoop+Java+Versions
76− hadoop_3_3 =
77− common
78− (rec {
79− pname = "hadoop";
80− version = "3.3.1";
81− untarDir = "${pname}-${version}";
82− sha256 = rec {
83− x86_64-linux = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd";
84− x86_64-darwin = x86_64-linux;
85− aarch64-linux = "00ln18vpi07jq2slk3kplyhcj8ad41n0yl880q5cihilk7daclxz";
86− aarch64-darwin = aarch64-linux;
87− };
88−
89− inherit openssl;
90− nativeLibs = [ stdenv.cc.cc.lib protobuf3_7 zlib snappy ];
91− libPatches = ''
92− ln -s ${getLib cyrus_sasl}/lib/libsasl2.so $out/lib/${untarDir}/lib/native/libsasl2.so.2
93− ln -s ${getLib openssl}/lib/libcrypto.so $out/lib/${untarDir}/lib/native/
94− ln -s ${getLib zlib}/lib/libz.so.1 $out/lib/${untarDir}/lib/native/
95− ln -s ${getLib zstd}/lib/libzstd.so.1 $out/lib/${untarDir}/lib/native/
96− ln -s ${getLib bzip2}/lib/libbz2.so.1 $out/lib/${untarDir}/lib/native/
97− '' + optionalString stdenv.isLinux "patchelf --add-rpath ${jdk.home}/lib/server $out/lib/${untarDir}/lib/native/libnativetask.so.1.0.0";
98− jdk = jdk11_headless;
99− });
83+ hadoop_3_3 = common rec {
84+ pname = "hadoop";
85+ version = "3.3.1";
86+ untarDir = "${pname}-${version}";
87+ sha256 = rec {
88+ x86_64-linux = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd";
89+ x86_64-darwin = x86_64-linux;
90+ aarch64-linux = "00ln18vpi07jq2slk3kplyhcj8ad41n0yl880q5cihilk7daclxz";
91+ aarch64-darwin = aarch64-linux;
92+ };
93+ jdk = jdk11_headless;
94+ inherit openssl;
95+ # TODO: Package and add Intel Storage Acceleration Library
96+ nativeLibs = [ stdenv.cc.cc.lib protobuf3_7 zlib snappy ];
97+ libPatches = ''
98+ ln -s ${getLib cyrus_sasl}/lib/libsasl2.so $out/lib/${untarDir}/lib/native/libsasl2.so.2
99+ ln -s ${getLib openssl}/lib/libcrypto.so $out/lib/${untarDir}/lib/native/
100+ ln -s ${getLib zlib}/lib/libz.so.1 $out/lib/${untarDir}/lib/native/
101+ ln -s ${getLib zstd}/lib/libzstd.so.1 $out/lib/${untarDir}/lib/native/
102+ ln -s ${getLib bzip2}/lib/libbz2.so.1 $out/lib/${untarDir}/lib/native/
103+ '' + optionalString stdenv.isLinux ''
104+ # libjvm.so for Java >=11
105+ patchelf --add-rpath ${jdk.home}/lib/server $out/lib/${untarDir}/lib/native/libnativetask.so.1.0.0
106+ # Java 8 has libjvm.so at a different path
107+ patchelf --add-rpath ${jdk.home}/jre/lib/amd64/server $out/lib/${untarDir}/lib/native/libnativetask.so.1.0.0
108+ '';
109+ tests = nixosTests.hadoop;
110+ };
100111 hadoop_3_2 = common rec {
101112 pname = "hadoop";
102113 version = "3.2.2";
@@ -104,11 +115,13 @@ in
104115 jdk = jdk8_headless;
105116 # not using native libs because of broken openssl_1_0_2 dependency
106117 # can be manually overriden
118+ tests = nixosTests.hadoop_3_2;
107119 };
108120 hadoop2 = common rec {
109121 pname = "hadoop";
110122 version = "2.10.1";
111123 sha256.x86_64-linux = "1w31x4bk9f2swnx8qxx0cgwfg8vbpm6cy5lvfnbbpl3rsjhmyg97";
112124 jdk = jdk8_headless;
125+ tests = nixosTests.hadoop2;
113126 };
114127}
pkgs/applications/science/computer-architecture/qtrvsim/default.nix+2−2
@@ -2,13 +2,13 @@
22
33stdenv.mkDerivation rec {
44 pname = "QtRVSim";
5− version = "0.9.1";
5+ version = "0.9.2";
66
77 src = fetchFromGitHub {
88 owner = "cvut";
99 repo = "qtrvsim";
1010 rev = "refs/tags/v${version}";
11− sha256 = "AOksVS0drIBnK4RCxZw40yVxf4E8GjG9kU0rIZsY9gA=";
11+ sha256 = "B1l+ysrodeDbxYfdLLMF8yk4/uPXTcDrTaMtYm89HuU=";
1212 };
1313
1414 nativeBuildInputs = [ cmake wrapQtAppsHook ];
pkgs/data/icons/kora-icon-theme/default.nix+2−2
@@ -2,13 +2,13 @@
22
33stdenv.mkDerivation rec {
44 pname = "kora-icon-theme";
5− version = "1.5.0";
5+ version = "1.5.1";
66
77 src = fetchFromGitHub {
88 owner = "bikass";
99 repo = "kora";
1010 rev = "v${version}";
11− sha256 = "sha256-kUgNj7KuxsQ/BvQ0ORl3xzEm9gv69+2PS0Bgv8i/S9U=";
11+ sha256 = "sha256-3TKjd2Lblb+/zFq7rkdgnD1dJU3kis7QZi7Ui74IWzA=";
1212 };
1313
1414 nativeBuildInputs = [
pkgs/development/compilers/open-watcom/v2.nix+3−3
@@ -12,14 +12,14 @@
1212
1313stdenv.mkDerivation rec {
1414 pname = "open-watcom-v2";
15− version = "unstable-2022-02-22";
15+ version = "unstable-2022-03-14";
1616 name = "${pname}-unwrapped-${version}";
1717
1818 src = fetchFromGitHub {
1919 owner = "open-watcom";
2020 repo = "open-watcom-v2";
21− rev = "9e25b3d6b8066f09b4f7131a31de1cf2af691e9a";
22− sha256 = "1w336070kmhc6cmn2aqr8vm0fmw3yza2n0w4asvs2kqxjgmbn6i2";
21+ rev = "22627ccc1bd3de70aff9ac056e0dc9ecf7f7b6ec";
22+ sha256 = "khy/fhmQjTGKfx6iOUBt+ySwpEx0df/7meyNvBnJAPY=";
2323 };
2424
2525 postPatch = ''
pkgs/development/libraries/libarchive-qt/default.nix+5−4
@@ -1,19 +1,20 @@
1−{ mkDerivation, lib, fetchFromGitLab, libarchive, xz, zlib, bzip2, cmake, ninja }:
1+{ mkDerivation, lib, fetchFromGitLab, libarchive, xz, zlib, bzip2, meson, pkg-config, ninja }:
22
33mkDerivation rec {
44 pname = "libarchive-qt";
5− version = "2.0.6";
5+ version = "2.0.7";
66
77 src = fetchFromGitLab {
88 owner = "marcusbritanicus";
99 repo = pname;
1010 rev = "v${version}";
11− sha256 = "sha256-Z+2zjQolV1Ncr6v9r7fGrc/fEMt0iMtGwv9eZ2Tu2cA=";
11+ sha256 = "sha256-KRywB+Op44N00q9tgO2WNCliRgUDRvrCms1O8JYt62o=";
1212 };
1313
1414 nativeBuildInputs = [
15− cmake
15+ meson
1616 ninja
17+ pkg-config
1718 ];
1819
1920 buildInputs = [
pkgs/development/node-packages/default.nix+1−1
@@ -359,7 +359,7 @@ let
359359
360360 src = fetchurl {
361361 url = "https://registry.npmjs.org/prisma/-/prisma-${version}.tgz";
362− sha512 = "sha512-dAld12vtwdz9Rz01nOjmnXe+vHana5PSog8t0XGgLemKsUVsaupYpr74AHaS3s78SaTS5s2HOghnJF+jn91ZrA==";
362+ sha512 = "sha512-8SdsLPhKR3mOfoo2o73h9mNn3v5kA/RqGA26Sv6qDS78Eh2uepPqt5e8/nwj5EOblYm5HEGuitaXQrOCLb6uTw==";
363363 };
364364 postInstall = with pkgs; ''
365365 wrapProgram "$out/bin/prisma" \
pkgs/development/python-modules/bumps/default.nix+23−10
@@ -1,24 +1,37 @@
1−{ lib, buildPythonPackage, fetchPypi, six}:
1+{ lib
2+, buildPythonPackage
3+, fetchPypi
4+, pythonOlder
5+, six
6+}:
27
38buildPythonPackage rec {
49 pname = "bumps";
5− version = "0.8.1";
10+ version = "0.9.0";
11+ format = "setuptools";
612
7− propagatedBuildInputs = [six];
8−
9− # Bumps does not provide its own tests.py, so the test
10− # always fails
11− doCheck = false;
13+ disabled = pythonOlder "3.7";
1214
1315 src = fetchPypi {
1416 inherit pname version;
15− sha256 = "f4f2ee712a1e468a2ce5c0a32f67739a83331f0cb7b9c50b9e7510daefc12169";
17+ hash = "sha256-BY9kg0ksKfrpQgsl1aDDJJ+zKJmURqwTtKxlITxse+o=";
1618 };
1719
20+ propagatedBuildInputs = [
21+ six
22+ ];
23+
24+ # Module has no tests
25+ doCheck = false;
26+
27+ pythonImportsCheck = [
28+ "bumps"
29+ ];
30+
1831 meta = with lib; {
19− homepage = "https://www.reflectometry.org/danse/software.html";
2032 description = "Data fitting with bayesian uncertainty analysis";
21− maintainers = with maintainers; [ rprospero ];
33+ homepage = "https://bumps.readthedocs.io/";
2234 license = licenses.publicDomain;
35+ maintainers = with maintainers; [ rprospero ];
2336 };
2437}
pkgs/development/python-modules/cloudscraper/default.nix+10−6
@@ -1,6 +1,6 @@
11{ lib
22, buildPythonPackage
3−, isPy3k
3+, pythonOlder
44, fetchPypi
55, requests
66, requests-toolbelt
@@ -9,12 +9,14 @@
99
1010buildPythonPackage rec {
1111 pname = "cloudscraper";
12− version = "1.2.58";
13− disabled = !isPy3k;
12+ version = "1.2.60";
13+ format = "setuptools";
14+
15+ disabled = pythonOlder "3.7";
1416
1517 src = fetchPypi {
1618 inherit pname version;
17− sha256 = "1wnzv2k8cm8q1x18r4zg8pcnpm4gsdp82hywwjimp2v2qll918nx";
19+ hash = "sha256-DTQTsv/59895UTsMmqxYtSfFosUWPRx8wMT4zKHQ9Oc=";
1820 };
1921
2022 propagatedBuildInputs = [
@@ -27,10 +29,12 @@ buildPythonPackage rec {
2729 # nixpkgs yet, and also aren't included in the PyPI bundle. TODO.
2830 doCheck = false;
2931
30− pythonImportsCheck = [ "cloudscraper" ];
32+ pythonImportsCheck = [
33+ "cloudscraper"
34+ ];
3135
3236 meta = with lib; {
33− description = "A Python module to bypass Cloudflare's anti-bot page";
37+ description = "Python module to bypass Cloudflare's anti-bot page";
3438 homepage = "https://github.com/venomous/cloudscraper";
3539 license = licenses.mit;
3640 maintainers = with maintainers; [ kini ];
pkgs/development/python-modules/google-cloud-storage/default.nix+6−2
@@ -9,15 +9,19 @@
99, google-cloud-testutils
1010, google-resumable-media
1111, mock
12+, pythonOlder
1213}:
1314
1415buildPythonPackage rec {
1516 pname = "google-cloud-storage";
16− version = "2.2.0";
17+ version = "2.2.1";
18+ format = "setuptools";
19+
20+ disabled = pythonOlder "3.7";
1721
1822 src = fetchPypi {
1923 inherit pname version;
20− sha256 = "sha256-01mWgBE11R20m7j3p+Kc7cwlqotDXu0MTA7y+e5W0dk=";
24+ hash = "sha256-AkT0YScQy17ERfxndDh1ZOI/mCM2P7QIsock4hAkAbc=";
2125 };
2226
2327 propagatedBuildInputs = [
pkgs/development/python-modules/qcengine/default.nix+2−2
@@ -11,7 +11,7 @@
1111
1212buildPythonPackage rec {
1313 pname = "qcengine";
14− version = "0.22.0";
14+ version = "0.23.0";
1515
1616 checkInputs = [ pytestCheckHook ];
1717
@@ -25,7 +25,7 @@ buildPythonPackage rec {
2525
2626 src = fetchPypi {
2727 inherit pname version;
28− sha256 = "685a08247b561ed1c7a7b42e68293f90b412e83556626304a3f826a15be51308";
28+ sha256 = "sha256-gDn0Nu6ALTr3KyZnYDSA6RE3S5JQj562FP2RI9U3Gxs=";
2929 };
3030
3131 doCheck = true;
pkgs/development/python-modules/samsungtvws/default.nix+2−2
@@ -5,12 +5,12 @@
55
66buildPythonPackage rec {
77 pname = "samsungtvws";
8− version = "2.3.0";
8+ version = "2.4.0";
99 disabled = isPy27;
1010
1111 src = fetchPypi {
1212 inherit pname version;
13− sha256 = "sha256-2ly9lbnIHGHB55ml10jKE7dC5LdN1ToGW4GqfxTC5kI=";
13+ sha256 = "sha256-LbNHaSbNCwoffox6B8kEUzxjkSJotB+P1bw3wbU7DZk=";
1414 };
1515
1616 propagatedBuildInputs = [
pkgs/development/tools/database/prisma-engines/default.nix+3−3
@@ -10,19 +10,19 @@
1010
1111rustPlatform.buildRustPackage rec {
1212 pname = "prisma-engines";
13− version = "3.10.0";
13+ version = "3.11.0";
1414
1515 src = fetchFromGitHub {
1616 owner = "prisma";
1717 repo = "prisma-engines";
1818 rev = version;
19− sha256 = "sha256-0m0RjIasEGB9QxZc7wKCMLnxHXkSlvCDA2QWa87mRRs=";
19+ sha256 = "sha256-z7ebwidY+p350XaGeyohoSHWc2DhfzpRxsRDLON1BuA=";
2020 };
2121
2222 # Use system openssl.
2323 OPENSSL_NO_VENDOR = 1;
2424
25− cargoSha256 = "sha256-KNQa+wLLl4abz48QKYkWu7A+FTGIyB+1EWAnLuWpJwc=";
25+ cargoSha256 = "sha256-PQdLoNJL9szPzPtFRznWS0lngTvtWK+Ko2rp4JWH9dQ=";
2626
2727 nativeBuildInputs = [ pkg-config ];
2828
pkgs/development/tools/jp/default.nix+8−8
@@ -1,18 +1,18 @@
1−{ lib, buildGoPackage, fetchFromGitHub }:
1+{ lib, buildGoModule, fetchFromGitHub }:
22
3−buildGoPackage rec {
3+buildGoModule rec {
44 pname = "jp";
5− version = "0.1.3";
6− rev = version;
7−
8− goPackagePath = "github.com/jmespath/jp";
5+ version = "0.2.1";
96
107 src = fetchFromGitHub {
11− inherit rev;
8+ rev = version;
129 owner = "jmespath";
1310 repo = "jp";
14− sha256 = "0fdbnihbd0kq56am3bmh2zrfk4fqjslcbm48malbgmpqw3a5nvpi";
11+ hash = "sha256-a3WvLAdUZk+Y+L+opPDMBvdN5x5B6nAi/lL8JHJG/gY=";
1512 };
13+
14+ vendorSha256 = "sha256-K6ZNtART7tcVBH5myV6vKrKWfnwK8yTa6/KK4QLyr00=";
15+
1616 meta = with lib; {
1717 description = "A command line interface to the JMESPath expression language for JSON";
1818 homepage = "https://github.com/jmespath/jp";
pkgs/development/tools/k6/default.nix+2−2
@@ -2,13 +2,13 @@
22
33buildGoModule rec {
44 pname = "k6";
5− version = "0.36.0";
5+ version = "0.37.0";
66
77 src = fetchFromGitHub {
88 owner = "grafana";
99 repo = pname;
1010 rev = "v${version}";
11− sha256 = "sha256-yWEh0sPMGe6mNcLKhbmJEUCHzZKFGMcTRNQrHgiQ+BQ=";
11+ sha256 = "sha256-5pxOg+pwa2VrEWinDadx2ZFYXiQgochbU4bCkJEezQw=";
1212 };
1313
1414 subPackages = [ "./" ];
pkgs/development/tools/stylua/default.nix+3−3
@@ -7,16 +7,16 @@
77
88rustPlatform.buildRustPackage rec {
99 pname = "stylua";
10− version = "0.12.4";
10+ version = "0.12.5";
1111
1212 src = fetchFromGitHub {
1313 owner = "johnnymorganz";
1414 repo = pname;
1515 rev = "v${version}";
16− sha256 = "sha256-BPLN7/LaVDtCOJBgIJVbnENUyFtacRsK3JxDupytzOA=";
16+ sha256 = "sha256-4tQQTTAdIAhlkBJevwwwGXOKd6bJJOyG4nlbCv7909Y=";
1717 };
1818
19− cargoSha256 = "sha256-MZsFbFQp5Rw20pXzvTFNhMiVx/TJZ63/2rU7vj7IcqQ=";
19+ cargoSha256 = "sha256-DGe2lB8xZgY9ikTsIHDOdHzTyHfDaSlmy8FU/S9FDCI=";
2020
2121 buildFeatures = lib.optional lua52Support "lua52"
2222 ++ lib.optional luauSupport "luau";
pkgs/servers/nextcloud/default.nix+6−11
@@ -33,23 +33,18 @@ let
3333 };
3434 };
3535in {
36− nextcloud20 = throw ''
37− Nextcloud v20 has been removed from `nixpkgs` as the support for it was dropped
38− by upstream in 2021-10. Please upgrade to at least Nextcloud v21 by declaring
36+ nextcloud21 = throw ''
37+ Nextcloud v21 has been removed from `nixpkgs` as the support for it was dropped
38+ by upstream in 2022-02. Please upgrade to at least Nextcloud v22 by declaring
3939
40− services.nextcloud.package = pkgs.nextcloud21;
40+ services.nextcloud.package = pkgs.nextcloud22;
4141
4242 in your NixOS config.
4343
44− WARNING: if you were on Nextcloud 19 on NixOS 21.05 you have to upgrade to Nextcloud 20
45− first on 21.05 because Nextcloud doesn't support upgrades accross multiple major versions!
44+ WARNING: if you were on Nextcloud 20 on NixOS 21.11 you have to upgrade to Nextcloud 21
45+ first on 21.11 because Nextcloud doesn't support upgrades accross multiple major versions!
4646 '';
4747
48− nextcloud21 = generic {
49− version = "21.0.9";
50− sha256 = "sha256-p6bvgTXmmjGN3TRQpG88f3YPksh0QzWG9j9KnEjcrqE=";
51− };
52−
5348 nextcloud22 = generic {
5449 version = "22.2.5";
5550 sha256 = "sha256-gb5N0u5tu4/nI2xIpjXwm2hiSDCrBhIDyN6gKGOsdS8=";
pkgs/servers/piping-server-rust/default.nix+3−3
@@ -2,16 +2,16 @@
22
33rustPlatform.buildRustPackage rec {
44 pname = "piping-server-rust";
5− version = "0.12.0";
5+ version = "0.12.1";
66
77 src = fetchFromGitHub {
88 owner = "nwtgck";
99 repo = pname;
1010 rev = "v${version}";
11− sha256 = "sha256-eDO2y/4660IAcD9vf1Vt6t3nv3Rc+zCRRFBbW/FeKIw=";
11+ sha256 = "sha256-L15ofIM5a/qoJHGXmkuTsmQLLmERG/PxAJ4+z1nn7w4=";
1212 };
1313
14− cargoSha256 = "sha256-U68R543l28osPe0DjuERqB/G6ur/BZDpWMZIO9RObaM=";
14+ cargoSha256 = "sha256-CcIM7T7P4LbPxPK1ZqoJRP0IsLMEwMZg9DcuRu0aJHM=";
1515
1616 buildInputs = lib.optionals stdenv.isDarwin [ CoreServices Security ];
1717
pkgs/tools/archivers/p7zip/default.nix+24−11
@@ -8,7 +8,18 @@ stdenv.mkDerivation rec {
88 owner = "jinfeihan57";
99 repo = pname;
1010 rev = "v${version}";
11− sha256 = "sha256-19F4hPV0nKVuFZNbOcXrcA1uW6Y3HQolaHVIYXGmh18=";
11+ sha256 = {
12+ free = "sha256-DrBuf2VPdcprHI6pMSmL7psm2ofOrUf0Oj0qwMjXzkk=";
13+ unfree = "sha256-19F4hPV0nKVuFZNbOcXrcA1uW6Y3HQolaHVIYXGmh18=";
14+ }.${if enableUnfree then "unfree" else "free"};
15+ # remove the unRAR related code from the src drv
16+ # > the license requires that you agree to these use restrictions,
17+ # > or you must remove the software (source and binary) from your hard disks
18+ # https://fedoraproject.org/wiki/Licensing:Unrar
19+ extraPostFetch = lib.optionalString (!enableUnfree) ''
20+ rm -r $out/CPP/7zip/Compress/Rar*
21+ find $out -name makefile'*' -exec sed -i '/Rar/d' {} +
22+ '';
1223 };
1324
1425 # Default makefile is full of impurities on Darwin. The patch doesn't hurt Linux so I'm leaving it unconditional
@@ -25,11 +36,6 @@ stdenv.mkDerivation rec {
2536 substituteInPlace makefile.machine \
2637 --replace 'CC=gcc' 'CC=${stdenv.cc.targetPrefix}gcc' \
2738 --replace 'CXX=g++' 'CXX=${stdenv.cc.targetPrefix}g++'
28− '' + lib.optionalString (!enableUnfree) ''
29− # Remove non-free RAR source code
30− # (see DOC/License.txt, https://fedoraproject.org/wiki/Licensing:Unrar)
31− rm -r CPP/7zip/Compress/Rar*
32− find . -name makefile'*' -exec sed -i '/Rar/d' {} +
3339 '';
3440
3541 makeFlags = [ "DEST_HOME=${placeholder "out"}" ];
@@ -46,13 +52,20 @@ stdenv.mkDerivation rec {
4652
4753 NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
4854
49− meta = {
55+ passthru.updateScript = ./update.sh;
56+
57+ meta = with lib; {
5058 homepage = "https://github.com/jinfeihan57/p7zip";
5159 description = "A new p7zip fork with additional codecs and improvements (forked from https://sourceforge.net/projects/p7zip/)";
52− platforms = lib.platforms.unix;
53− maintainers = [ lib.maintainers.raskin ];
60+ license = with licenses;
61+ # p7zip code is largely lgpl2Plus
62+ # CPP/7zip/Compress/LzfseDecoder.cpp is bsd3
63+ [ lgpl2Plus /* and */ bsd3 ] ++
64+ # and CPP/7zip/Compress/Rar* are unfree with the unRAR license restriction
65+ # the unRAR compression code is disabled by default
66+ lib.optionals enableUnfree [ unfree ];
67+ maintainers = with maintainers; [ raskin jk ];
68+ platforms = platforms.unix;
5469 mainProgram = "7z";
55− # RAR code is under non-free UnRAR license, but we remove it
56− license = if enableUnfree then lib.licenses.unfree else lib.licenses.lgpl2Plus;
5770 };
5871}
pkgs/tools/archivers/p7zip/update.shnew file+47
@@ -0,0 +1,47 @@
1+#! /usr/bin/env nix-shell
2+#! nix-shell -i bash -p coreutils gnused curl jq
3+set -euo pipefail
4+cd "$(dirname "${BASH_SOURCE[0]}")"
5+
6+DRV_DIR="$PWD"
7+
8+OLD_VERSION="$(sed -nE 's/\s*version = "(.*)".*/\1/p' ./default.nix)"
9+
10+NEW_VERSION="$(curl https://api.github.com/repos/jinfeihan57/p7zip/releases/latest | jq .tag_name -r | tr -d 'v')"
11+
12+echo "comparing versions $OLD_VERSION => $NEW_VERSION"
13+if [[ "$OLD_VERSION" == "$NEW_VERSION" ]]; then
14+ echo "Already up to date! Doing nothing"
15+ exit 0
16+fi
17+
18+NIXPKGS_ROOT="$(realpath "$DRV_DIR/../../../..")"
19+
20+echo "getting free source hash"
21+OLD_FREE_HASH="$(nix-instantiate --eval --strict -E "with import $NIXPKGS_ROOT {}; p7zip.src.drvAttrs.outputHash" | tr -d '"')"
22+echo "getting unfree source hash"
23+OLD_UNFREE_HASH="$(nix-instantiate --eval --strict -E "with import $NIXPKGS_ROOT {}; (p7zip.override { enableUnfree = true; }).src.drvAttrs.outputHash" | tr -d '"')"
24+
25+
26+NEW_FREE_HASH=$(nix-prefetch -f "$NIXPKGS_ROOT" -E "p7zip.src" --rev "v$NEW_VERSION")
27+
28+NEW_UNFREE_OUT=$(nix-prefetch -f "$NIXPKGS_ROOT" -E "(p7zip.override { enableUnfree = true; }).src" --rev "v$NEW_VERSION" --output raw --print-path)
29+# first line of raw output is the hash
30+NEW_UNFREE_HASH="$(echo "$NEW_UNFREE_OUT" | sed -n 1p)"
31+# second line of raw output is the src path
32+NEW_UNFREE_SRC="$(echo "$NEW_UNFREE_OUT" | sed -n 2p)"
33+# make sure to nuke the unfree src from the updater's machine
34+# > the license requires that you agree to these use restrictions, or you must remove the software (source and binary) from your hard disks
35+# https://fedoraproject.org/wiki/Licensing:Unrar
36+nix-store --delete "$NEW_UNFREE_SRC"
37+
38+
39+echo "updating version"
40+sed -i "s/version = \"$OLD_VERSION\";/version = \"$NEW_VERSION\";/" "$DRV_DIR/default.nix"
41+
42+echo "updating free hash"
43+sed -i "s@free = \"$OLD_FREE_HASH\";@free = \"$NEW_FREE_HASH\";@" "$DRV_DIR/default.nix"
44+echo "updating unfree hash"
45+sed -i "s@unfree = \"$OLD_UNFREE_HASH\";@unfree = \"$NEW_UNFREE_HASH\";@" "$DRV_DIR/default.nix"
46+
47+echo "done"
pkgs/tools/backup/btrbk/default.nix+2−2
@@ -18,11 +18,11 @@
1818
1919stdenv.mkDerivation rec {
2020 pname = "btrbk";
21− version = "0.32.0";
21+ version = "0.32.1";
2222
2323 src = fetchurl {
2424 url = "https://digint.ch/download/btrbk/releases/${pname}-${version}.tar.xz";
25− sha256 = "HmvNtIgFfeaiFuSRobWlcJqusPSYtqAqx+79+CeNVDQ=";
25+ sha256 = "flQf1KTybPImDoD+iNe+P+u1rOiYxXjQoltuGPWuX3g=";
2626 };
2727
2828 nativeBuildInputs = [ asciidoctor makeWrapper ];
pkgs/tools/misc/up/default.nix−2
@@ -13,8 +13,6 @@ buildGoModule rec {
1313
1414 vendorSha256 = "1q8wfsfl3rz698ck5q5s5z6iw9k134fxxvwipcp2b052n998rcrx";
1515
16− doCheck = false;
17−
1816 meta = with lib; {
1917 description = "Ultimate Plumber is a tool for writing Linux pipes with instant live preview";
2018 homepage = "https://github.com/akavel/up";
pkgs/tools/networking/frp/default.nix+3−3
@@ -2,16 +2,16 @@
22
33buildGoModule rec {
44 pname = "frp";
5− version = "0.39.1";
5+ version = "0.40.0";
66
77 src = fetchFromGitHub {
88 owner = "fatedier";
99 repo = pname;
1010 rev = "v${version}";
11− sha256 = "sha256-tqdrYrIWbmRn+5iAZKd9GlcmFNQnh3yNxZ95As7+v5Q=";
11+ sha256 = "sha256-W+88Fq9oYDBLCNp+6rc9jACJzky7FCZg/xLDowGGdm0=";
1212 };
1313
14− vendorSha256 = "sha256-NPnchl+N6DeqMhsOIw2MYD/i2IZzHS9ZqbUOeulgb90=";
14+ vendorSha256 = "sha256-iBjMFOERWQ1aPn+2gEoI9og2ov2LlBVV1sLAZlvqZPM=";
1515
1616 doCheck = false;
1717
pkgs/tools/system/syslog-ng/default.nix+2−2
@@ -7,11 +7,11 @@
77
88stdenv.mkDerivation rec {
99 pname = "syslog-ng";
10− version = "3.35.1";
10+ version = "3.36.1";
1111
1212 src = fetchurl {
1313 url = "https://github.com/${pname}/${pname}/releases/download/${pname}-${version}/${pname}-${version}.tar.gz";
14− sha256 = "sha256-HQI4sGs+WYfIWeW1Kezuc491us/wSxSTmLH+jLsSHlM=";
14+ sha256 = "sha256-kKJcl2f+dJ21DxGN38kuxxOZdj0uzVrU8R/17qBJ5gs=";
1515 };
1616
1717 nativeBuildInputs = [ pkg-config which ];
pkgs/top-level/all-packages.nix+1−1
@@ -8240,7 +8240,7 @@ with pkgs;
82408240 grocy = callPackage ../servers/grocy { };
82418241
82428242 inherit (callPackage ../servers/nextcloud {})
8243− nextcloud20 nextcloud21 nextcloud22 nextcloud23;
8243+ nextcloud21 nextcloud22 nextcloud23;
82448244
82458245 nextcloud-client = libsForQt5.callPackage ../applications/networking/nextcloud-client { };
82468246