Skip to content

Commit

Permalink
Pull up attrset
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaste committed Aug 8, 2022
1 parent c7b2e08 commit 20a5312
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
7 changes: 4 additions & 3 deletions nix/workbench/profiles/default.nix
Expand Up @@ -33,19 +33,20 @@ let

inherit (pkgs.callPackage
./node-services.nix
{ inherit runJq backend profile;
{ inherit runJq profile;
inherit (backend) services-config;
baseNodeConfig = cardanoLib.environments.testnet.nodeConfig;
})
node-services;

inherit (pkgs.callPackage
./generator-service.nix
{ inherit runJq backend profile; })
{ inherit runJq profile; inherit (backend) services-config;})
generator-service;

inherit (pkgs.callPackage
./tracer-service.nix
{ inherit runJq backend profile; })
{ inherit runJq profile; inherit (backend) services-config;})
tracer-service;
};

Expand Down
10 changes: 5 additions & 5 deletions nix/workbench/profiles/generator-service.nix
@@ -1,8 +1,8 @@
{ pkgs
, runJq

## The backend is an attrset of AWS/supervisord-specific methods and parameters.
, backend
## An attrset of specific methods and parameters.
, services-config

, profile
}:
Expand All @@ -26,14 +26,14 @@ let
ShelleyGenesisFile ByronGenesisFile;
};
in
backend.services-config.finaliseGeneratorService
services-config.finaliseGeneratorService
{
inherit (profile.value) era;

targetNodes = __mapAttrs
(name: { name, port, ...}@nodeSpec:
{ inherit port;
ip = let ip = backend.services-config.nodePublicIP nodeSpec; # getPublicIp resources nodes name
ip = let ip = 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.services-config.finaliseGeneratorConfig generatorNodeConfigDefault;
nodeConfig = services-config.finaliseGeneratorConfig generatorNodeConfigDefault;

dsmPassthrough = {
# rtsOpts = ["-xc"];
Expand Down
12 changes: 6 additions & 6 deletions nix/workbench/profiles/node-services.nix
@@ -1,8 +1,8 @@
{ pkgs
, runJq

## The backend is an attrset of AWS/supervisord-specific methods and parameters.
, backend
## An attrset of specific methods and parameters.
, services-config

## The cardano-node config used as baseline:
, baseNodeConfig
Expand Down Expand Up @@ -133,7 +133,7 @@ let
}.${profile.value.era};
};
in
backend.services-config.finaliseNodeService profile.value nodeSpec
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.services-config.finaliseNodeConfig nodeSpec
(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.services-config.finaliseNodeArgs profile nodeSpec
in services-config.finaliseNodeArgs profile nodeSpec
(if shutBlockArgs != []
then shutBlockArgs
else shutSlotArgs);
Expand Down Expand Up @@ -242,7 +242,7 @@ let
};

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

Expand Down
8 changes: 4 additions & 4 deletions nix/workbench/profiles/tracer-service.nix
@@ -1,8 +1,8 @@
{ pkgs
, runJq

## The backend is an attrset of AWS/supervisord-specific methods and parameters.
, backend
## An attrset of specific methods and parameters.
, services-config

, profile
}:
Expand All @@ -20,14 +20,14 @@ let
nodeSpecs:
let
in
backend.services-config.finaliseTracerService
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.services-config.finaliseTracerService
## logRoot = ## ..really depends on context -- available in services-config.finaliseTracerService

dsmPassthrough = {
# rtsOpts = ["-xc"];
Expand Down

0 comments on commit 20a5312

Please sign in to comment.