Skip to content

Commit

Permalink
CAD-2426 supervisord: ahaha, aux is on a No Fly list in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
deepfire committed Jan 18, 2021
1 parent 486bd9b commit 0ad3566
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
4 changes: 4 additions & 0 deletions Makefile
Expand Up @@ -33,6 +33,10 @@ test-ghcid-nix: ## Run ghcid on test suites with Nix
test-chairmans-cluster:
@scripts/chairmans-cluster/cluster-test.sh

bench-profiles:
@jq --null-input 'include "nix/supervisord-cluster/profiles" { search: "${./.}" }; profiles("shelley"; null; null; [])'


BENCH_REPEATS ?= 3
BENCH_CONFIG ?= both
BENCH_TAG ?= HEAD
Expand Down
10 changes: 5 additions & 5 deletions nix/supervisord-cluster/profiles.jq
Expand Up @@ -15,8 +15,8 @@
## - era-dependent defaults for the aforementioned sections:
## - profiles/defaults.jq
##
## - overlayed with generated profile variants + aux (ad-hoc) profiles:
## - profiles/variants.jq and profiles/aux.jq
## - overlayed with generated profile variants + ad-hoc profiles:
## - profiles/variants.jq and profiles/adhoc.jq
##
## - each then further overlayed with derived parameters, computed from the above:
## - profiles/derived.jq
Expand All @@ -41,15 +41,15 @@

include "topology" { search: "profiles" };
include "defaults" { search: "profiles" };
include "aux" { search: "profiles" };
include "adhoc" { search: "profiles" };
include "variants" { search: "profiles" };
include "derived" { search: "profiles" };

def profiles($era; $mcompo; $topo):
def profiles($era; $mcompo; $topo; $extra_profiles):
($mcompo // topology_composition($topo // {}) // {}) as $compo

## Profiles are variants + custom (or aux) profiles:
| all_profile_variants + aux_profiles
| all_profile_variants + adhoc_profiles + $extra_profiles

| map (## Each profile extends defaults:
era_defaults($era) * .
Expand Down
2 changes: 1 addition & 1 deletion nix/supervisord-cluster/profiles.nix
Expand Up @@ -6,7 +6,7 @@ let
profilesJSON = runCommand "profiles" { buildInputs = [ jq ]; } ''
jq --null-input '
include "profiles" { search: "${./.}" };
profiles("shelley"; null; null)
profiles("shelley"; null; null; [])
' > $out
'';
in
Expand Down
@@ -1,4 +1,4 @@
def aux_profiles:
def adhoc_profiles:
[ { name: "short"
, generator: { tx_count: 10000, inputs_per_tx: 1, outputs_per_tx: 1, tps: 100 }
}
Expand Down
18 changes: 10 additions & 8 deletions nix/supervisord-cluster/profiles/derived.jq
Expand Up @@ -12,9 +12,11 @@ def profile_name($p):
| era_defaults($p.era).generator as $generator_defaults
| era_defaults($p.era).composition as $composition_defaults
## Genesis
| [ "k\($p.genesis.n_pools)" ]
+ may_attr("dense_pool_density";
$p.composition; $composition_defaults; 1; "ppn")
| [ "k\($p.composition.n_pools)" ]
+ if $p.composition.n_dense_hosts > 0
then may_attr("dense_pool_density";
$p.composition; $composition_defaults; 1; "ppn")
else [] end
+ [ ($p.generator.epochs | tostring) + "ep"
, ($p.genesis.utxo | . / 1000 | tostring) + "kU"
, ($p.genesis.delegators | . / 1000 | tostring) + "kD"
Expand All @@ -32,10 +34,10 @@ def profile_name($p):
| join("-");

def add_derived_params:
(.future_offset //
if .composition.n_hosts > 50 then 32
else if .composition.n_hosts == 3 then 3
else 10 end end) as $future_offset
(.genesis.genesis_future_offset //
if .composition.n_hosts > 50 then "32 minutes"
else if .composition.n_hosts == 3 then "3 minutes"
else "10 minutes" end end) as $future_offset
| .composition as $compo
| .genesis as $gsis
| .generator as $gtor
Expand All @@ -60,7 +62,7 @@ def add_derived_params:
, n_dense_pools: $n_dense_pools
}
, genesis:
{ genesis_future_offset: "\($future_offset) minutes"
{ genesis_future_offset: $future_offset
, delegators: ($gsis.delegators // $n_pools)
, pool_coin: ($gsis.pools_balance / $n_pools | floor)
, verbatim:
Expand Down

0 comments on commit 0ad3566

Please sign in to comment.