Skip to content

Commit

Permalink
wb | simplify, pass only the workbench derivation to runner
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaste committed Sep 20, 2024
1 parent 510327a commit 6594c2d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
15 changes: 8 additions & 7 deletions nix/workbench/backend/runner.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
, batchName
##
, cardano-node-rev
, workbenchNix
, workbench
, cardanoNodePackages
, workbenchDevMode
, workbenchStartArgs
##
Expand All @@ -27,11 +28,11 @@ in

path = pkgs.lib.makeBinPath path';
path' =
[ workbenchNix.cardanoNodePackages.bech32 pkgs.jq pkgs.gnused pkgs.coreutils pkgs.bash pkgs.moreutils
[ cardanoNodePackages.bech32 pkgs.jq pkgs.gnused pkgs.coreutils pkgs.bash pkgs.moreutils
]
## In dev mode, call the script directly:
++ pkgs.lib.optionals (!workbenchDevMode)
[ workbenchNix.workbench ];
[ workbench ];

workbench-interactive-start = pkgs.writeScriptBin "start-cluster" ''
set -euo pipefail
Expand Down Expand Up @@ -70,7 +71,7 @@ in
pkgs.runCommand "workbench-profile-genesis-cache-${profileName}"
{ requiredSystemFeatures = [ "benchmark" ];
nativeBuildInputs = with pkgs.haskellPackages; with pkgs;
[ bash cardano-cli coreutils gnused jq moreutils workbench.workbench ];
[ bash cardano-cli coreutils gnused jq moreutils workbench ];
}
''
mkdir $out
Expand Down Expand Up @@ -109,7 +110,7 @@ in
"report ${name}-log $out ${name}/stdout";
run = pkgs.runCommand "workbench-run-${backendName}-${profileName}"
{ requiredSystemFeatures = [ "benchmark" ];
nativeBuildInputs = with workbenchNix.cardanoNodePackages; with pkgs; [
nativeBuildInputs = with cardanoNodePackages; with pkgs; [
bash
bech32
coreutils
Expand All @@ -118,7 +119,7 @@ in
moreutils
nix
pstree
workbenchNix.workbench
workbench
zstd
]
++
Expand Down Expand Up @@ -184,7 +185,7 @@ in
analysis = pkgs.runCommand "workbench-run-analysis-${profileName}"
{ requiredSystemFeatures = [ "benchmark" ];
nativeBuildInputs = with pkgs;
[ bash coreutils gnused jq moreutils nix workbenchNix.workbench ];
[ bash coreutils gnused jq moreutils nix workbench ];
}
''
echo "analysing run: ${run}"
Expand Down
4 changes: 2 additions & 2 deletions nix/workbench/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ in pkgs.lib.fix (self: {
}:
(import ./profile/profile.nix
{ inherit pkgs lib;
inherit (cardanoNodePackages) cardanoLib;
workbenchNix = self;
inherit profileName profiling;
}
Expand Down Expand Up @@ -156,7 +155,8 @@ in pkgs.lib.fix (self: {
inherit profile backend;
inherit batchName;
inherit cardano-node-rev;
workbenchNix = self;
inherit workbench; # The derivation.
inherit cardanoNodePackages;
inherit workbenchDevMode workbenchStartArgs;
};
})
4 changes: 2 additions & 2 deletions nix/workbench/profile/profile.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, lib, cardanoLib
{ pkgs, lib
, workbenchNix
, profileName
, profiling
Expand Down Expand Up @@ -41,7 +41,7 @@ let
inherit topologyFiles profiling;
inherit workbenchNix;
inherit jsonFilePretty;
baseNodeConfig = cardanoLib.environments.testnet.nodeConfig;
baseNodeConfig = workbenchNix.cardanoNodePackages.cardanoLib.environments.testnet.nodeConfig;
})
node-services;

Expand Down

0 comments on commit 6594c2d

Please sign in to comment.