Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CAD-2420 supervisord: the wealth of profiles
- Loading branch information
Showing
11 changed files
with
464 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
## Profiles are named bundles of parameters, classified into sections: | ||
## | ||
## - genesis | ||
## - generator | ||
## - node | ||
## - tolerances (ranges of acceptable properties, given above parameters) | ||
## | ||
## When combined with cluster COMPOsition (an extract from topology) and | ||
## service parameters (non-crucial things like state directory, port ranges, etc), | ||
## profiles ought to completely specify cluster parameters, | ||
## allowing genesis and all necessary configuration files to be generated. | ||
## | ||
## Profiles themselves are layered as follows: | ||
## | ||
## - 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 | ||
## | ||
## - each then further overlayed with derived parameters, computed from the above: | ||
## - profiles/derived.jq | ||
## | ||
## Profiles variants are generated as a cartesian product of variations | ||
## of the three axes: genesis, generator and node. | ||
## These generated profiles are assigned computed names, as per the | ||
## profile_name() function in 'profiles/derived.jq'. | ||
## | ||
## Composition must have the following structure: | ||
## { n_hosts: INT | ||
## , n_bft_hosts: INT | ||
## , n_singular_hosts: INT | ||
## , n_dense_hosts: INT | ||
## } | ||
## ..where n_hosts must be equal to a sum of the rest. | ||
## | ||
## Testable by: | ||
## | ||
## jq -n 'include "profiles" { search: "nix/supervisord-cluster" }; profiles("shelley"; { n_bft_hosts: 1, n_dense_hosts: 1, n_singular_hosts: 1, n_hosts: 3 }; null)' | ||
## | ||
|
||
include "topology" { search: "profiles" }; | ||
include "defaults" { search: "profiles" }; | ||
include "aux" { search: "profiles" }; | ||
include "variants" { search: "profiles" }; | ||
include "derived" { search: "profiles" }; | ||
|
||
def profiles($era; $mcompo; $topo): | ||
($mcompo // topology_composition($topo // {}) // {}) as $compo | ||
|
||
## Profiles are variants + custom (or aux) profiles: | ||
| all_profile_variants + aux_profiles | ||
|
||
| map (## Each profile extends defaults: | ||
era_defaults($era) * . | ||
|
||
## Profiles can define their own cluster composition. | ||
| . * { composition: (.composition // $compo) } | ||
|
||
## Compute the derived params. | ||
| add_derived_params | ||
|
||
## Finally, assembly into a dictionary.. | ||
| { "\(.name)": | ||
## ..and cleanup: | ||
. | delpaths ([["generator", "epochs"]])} | ||
) | ||
| add; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,13 @@ | ||
{ ... | ||
{ runCommand | ||
, jq | ||
, ... | ||
}: | ||
|
||
rec { | ||
default = { | ||
composition = { | ||
numBft = 1; | ||
numPools = 2; | ||
}; | ||
monetary = { | ||
delegatePoolAmount = 1000000000000; | ||
initialFunds = import ./initial-funds.nix; | ||
}; | ||
genesis = { | ||
protocolParams = { | ||
poolDeposit = 500000000; | ||
keyDeposit = 400000; | ||
nOpt = 10; | ||
rho = 0.0022; | ||
tau = 0.05; | ||
a0 = 0.3; | ||
minFeeA = 44; | ||
minFeeB = 155381; | ||
decentralisationParam = 0.8; | ||
}; | ||
slotLength = 0.2; | ||
activeSlotsCoeff = 0.1; | ||
securityParam = 10; | ||
epochLength = 1000; | ||
maxLovelaceSupply = 45000000000000000; | ||
networkMagic = 42; | ||
}; | ||
}; | ||
} | ||
let | ||
profilesJSON = runCommand "profiles" { buildInputs = [ jq ]; } '' | ||
jq --null-input ' | ||
include "profiles" { search: "${./.}" }; | ||
profiles("shelley"; null; null) | ||
' > $out | ||
''; | ||
in | ||
__fromJSON (__readFile profilesJSON) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
def aux_profiles: | ||
[ { name: "short" | ||
, generator: { tx_count: 10000, inputs_per_tx: 1, outputs_per_tx: 1, tps: 100 } | ||
} | ||
, { name: "small" | ||
, generator: { tx_count: 1000, inputs_per_tx: 1, outputs_per_tx: 1, tps: 100 | ||
, init_cooldown: 25 } | ||
, tolerances: { finish_patience: 4 } | ||
} | ||
, { name: "smoke" | ||
, generator: { tx_count: 100, add_tx_size: 0, inputs_per_tx: 1, outputs_per_tx: 1, tps: 100 | ||
, init_cooldown: 25 } | ||
, tolerances: { finish_patience: 4 } | ||
} | ||
, { name: "default" | ||
, genesis: | ||
{ verbatim: | ||
{ initialFunds: | ||
# genesis-utxo (used for pool owner funds and paying fees for startup scripts) | ||
{ "608634fc2a05c3d7f8dca90321dae19a2172ab3ff146512660721fa15b": 1000000000000000 | ||
# flee three produce crush token where quantum vessel seek include dance reject urge awesome lonely | ||
, "00da45b43746dec67dfe3647f3dfee9fb8bf0723883e40ca14b51234c8e62cf6242003415534e919acb2c07132a588827fb8e6b968861b1e5d807b756fe72d6e28": 100000000000000 | ||
, "0036af4eaf83f34348829c0b88515238e3bbe7c7b69a5b3659bc3155521da98aa12003415534e919acb2c07132a588827fb8e6b968861b1e5d807b756fe72d6e28": 100000000000000 | ||
, "00bee681d5f0dbd1b047c0311ab1211640f5f862c614d5db9e21fc08ddb163aba02003415534e919acb2c07132a588827fb8e6b968861b1e5d807b756fe72d6e28": 100000000000000 | ||
, "00b84e9b8980d61ade5167f3e697641acae5e6eec546fcdbc5c03149a02595d4202003415534e919acb2c07132a588827fb8e6b968861b1e5d807b756fe72d6e28": 100000000000000 | ||
, "000b04a2d5dc696f845a7bbe7ead094ac12e8dbbf82eedeabe9cb2fe8c07f1624c2003415534e919acb2c07132a588827fb8e6b968861b1e5d807b756fe72d6e28": 100000000000000 | ||
} | ||
} | ||
} | ||
} | ||
]; |
Oops, something went wrong.