Skip to content

Commit

Permalink
Extract attribute set
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaste committed Aug 8, 2022
1 parent 79180bb commit cb96ff5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion nix/workbench/docker.nix
Expand Up @@ -20,7 +20,7 @@ let
rec
{ name = "docker";

inherit (import ./profiles/services-config.nix {inherit lib workbench basePort stateDir useCabalRun enableEKG;}) topologyForNodeSpec nodePublicIP finaliseNodeService finaliseNodeConfig finaliseNodeArgs finaliseGeneratorService finaliseGeneratorConfig finaliseTracerService;
services-config = import ./profiles/services-config.nix {inherit lib workbench basePort stateDir useCabalRun enableEKG;};

materialise-profile =
{ profileNix }:
Expand Down
6 changes: 3 additions & 3 deletions nix/workbench/profiles/generator-service.nix
Expand Up @@ -26,14 +26,14 @@ let
ShelleyGenesisFile ByronGenesisFile;
};
in
backend.finaliseGeneratorService
backend.services-config.finaliseGeneratorService
{
inherit (profile.value) era;

targetNodes = __mapAttrs
(name: { name, port, ...}@nodeSpec:
{ inherit port;
ip = let ip = backend.nodePublicIP nodeSpec; # getPublicIp resources nodes name
ip = let ip = backend.services-config.nodePublicIP nodeSpec; # getPublicIp resources nodes name
in __trace "generator target: ${name}/${ip}:${toString port}" ip;
})
nodeSpecs;
Expand All @@ -45,7 +45,7 @@ let
localNodeConf = removeAttrs exemplarNode.serviceConfig.value ["executable"];

## The nodeConfig of the Tx generator itself.
nodeConfig = backend.finaliseGeneratorConfig generatorNodeConfigDefault;
nodeConfig = backend.services-config.finaliseGeneratorConfig generatorNodeConfigDefault;

dsmPassthrough = {
# rtsOpts = ["-xc"];
Expand Down
8 changes: 4 additions & 4 deletions nix/workbench/profiles/node-services.nix
Expand Up @@ -133,7 +133,7 @@ let
}.${profile.value.era};
};
in
backend.finaliseNodeService profile.value nodeSpec
backend.services-config.finaliseNodeService profile.value nodeSpec
{
inherit port;

Expand All @@ -145,7 +145,7 @@ let
nodeConfig =
nodeConfigBits.tracing-transform.${profile.value.node.tracing_backend}
(recursiveUpdate
(backend.finaliseNodeConfig nodeSpec
(backend.services-config.finaliseNodeConfig nodeSpec
(recursiveUpdate
(recursiveUpdate
nodeConfigBits.base
Expand All @@ -169,7 +169,7 @@ let
else [];
shutBlockArgs = mayKindArgs shutdownBlock nodeSpec.kind "--shutdown-on-block-synced";
shutSlotArgs = mayKindArgs shutdownSlot nodeSpec.kind "--shutdown-on-slot-synced";
in backend.finaliseNodeArgs profile nodeSpec
in backend.services-config.finaliseNodeArgs profile nodeSpec
(if shutBlockArgs != []
then shutBlockArgs
else shutSlotArgs);
Expand Down Expand Up @@ -242,7 +242,7 @@ let
};

topology = rec {
JSON = backend.topologyForNodeSpec { inherit profile nodeSpec; };
JSON = backend.services-config.topologyForNodeSpec { inherit profile nodeSpec; };
value = __fromJSON (__readFile JSON);
};

Expand Down
4 changes: 2 additions & 2 deletions nix/workbench/profiles/tracer-service.nix
Expand Up @@ -20,14 +20,14 @@ let
nodeSpecs:
let
in
backend.finaliseTracerService
backend.services-config.finaliseTracerService
{
## In both the local and remote scenarios, it's most frequently convenient to act as an acceptor.
acceptingSocket = "tracer.socket";

networkMagic = profile.value.genesis.network_magic;

## logRoot = ## ..really depends on context -- available in backend.finaliseTracerService
## logRoot = ## ..really depends on context -- available in backend.services-config.finaliseTracerService

dsmPassthrough = {
# rtsOpts = ["-xc"];
Expand Down
2 changes: 1 addition & 1 deletion nix/workbench/supervisor.nix
Expand Up @@ -20,7 +20,7 @@ let
rec
{ name = "supervisor";

inherit (import ./profiles/services-config.nix {inherit lib workbench basePort stateDir useCabalRun enableEKG;}) topologyForNodeSpec nodePublicIP finaliseNodeService finaliseNodeConfig finaliseNodeArgs finaliseGeneratorService finaliseGeneratorConfig finaliseTracerService;
services-config = import ./profiles/services-config.nix {inherit lib workbench basePort stateDir useCabalRun enableEKG;};

materialise-profile =
{ profileNix }:
Expand Down

0 comments on commit cb96ff5

Please sign in to comment.