diff --git a/nix/workbench/profile/prof0-defaults.jq b/nix/workbench/profile/prof0-defaults.jq index 821ec6a57ca..b9e5e6e29fd 100644 --- a/nix/workbench/profile/prof0-defaults.jq +++ b/nix/workbench/profile/prof0-defaults.jq @@ -63,6 +63,8 @@ def era_defaults($era): } } + , workloads: [] + , node: { rts_flags_override: [] , heap_limit: null ## optional: heap limit in MB (translates to RTS flag -M) diff --git a/nix/workbench/profile/prof1-variants.jq b/nix/workbench/profile/prof1-variants.jq index 40940bdaaa8..dda1beb38bc 100644 --- a/nix/workbench/profile/prof1-variants.jq +++ b/nix/workbench/profile/prof1-variants.jq @@ -392,7 +392,7 @@ def all_profile_variants: | .node.shutdown_on_slot_synced = 1200 ) as $for_1200slot ## - ### Definition vocabulary: workload + ### Definition vocabulary: generator workload ## | ({}| .generator.tps = 15 @@ -431,7 +431,6 @@ def all_profile_variants: , generator: { inputs_per_tx: 1 , outputs_per_tx: 1 - , drep_voting: true } }) as $voting_base | @@ -545,6 +544,17 @@ def all_profile_variants: | .generator.tx_fee = 940000 ) as $plutus_loop_ripemd ## + ### Definition vocabulary: custom workloads + ## + | + ({ nix_module_name: "voting.nix" + , parameters: {} + , entrypoints: { + pre_generator: "workflow_generator" + , producers: "workflow_producer" + } + }) as $voting_workload + ## ### Definition vocabulary: genesis variants ## | @@ -1325,68 +1335,68 @@ def all_profile_variants: # Split creating 500k UTxO, create the transactions (build-raw) but no submit. , $valuevoting_nomadperf_template * $dreps_large * { name: "value-voting-utxo-volt-nomadperf" - , generator: {drep_voting: true} - , workload: [ - { outs_per_split_transaction: 193 - , submit_vote: false - } - ] + , workloads: + [ $voting_workload * {parameters: + { outs_per_split_transaction: 193 + , submit_vote: false + } + }] } # One vote per voting tx version. , $valuevoting_nomadperf_template * $dreps_large * { name: "value-voting-volt-nomadperf" - , generator: {drep_voting: true} - , workload: [ - { outs_per_split_transaction: 193 - , submit_vote: true - , votes_per_tx: 1 - } - ] + , workloads: + [ $voting_workload * {parameters: + { outs_per_split_transaction: 193 + , submit_vote: true + , votes_per_tx: 1 + } + }] } # Two votes per voting tx version. , $valuevoting_nomadperf_template * $dreps_large * { name: "value-voting-double-volt-nomadperf" - , generator: {drep_voting: true} - , workload: [ - { outs_per_split_transaction: 193 - , submit_vote: true - , votes_per_tx: 2 - } - ] + , workloads: + [ $voting_workload * {parameters: + { outs_per_split_transaction: 193 + , submit_vote: true + , votes_per_tx: 2 + } + }] } ## As "plutus" above with an extra voting workload # Split creating 500k UTxO, create the transactions (build-raw) but no submit. , $plutusvoting_nomadperf_template * $dreps_large * { name: "plutus-voting-utxo-volt-nomadperf" - , generator: {drep_voting: true} - , workload: [ - { outs_per_split_transaction: 193 - , submit_vote: false - } - ] + , workloads: + [ $voting_workload * {parameters: + { outs_per_split_transaction: 193 + , submit_vote: false + } + }] } # One vote per voting tx version. , $plutusvoting_nomadperf_template * $dreps_large * { name: "plutus-voting-volt-nomadperf" - , generator: {drep_voting: true} - , workload: [ - { outs_per_split_transaction: 193 - , submit_vote: true - , votes_per_tx: 1 - } - ] + , workloads: + [ $voting_workload * {parameters: + { outs_per_split_transaction: 193 + , submit_vote: true + , votes_per_tx: 1 + } + }] } # Two votes per voting tx version. , $plutusvoting_nomadperf_template * $dreps_large * { name: "plutus-voting-double-volt-nomadperf" - , generator: {drep_voting: true} - , workload: [ - { outs_per_split_transaction: 193 - , submit_vote: true - , votes_per_tx: 2 - } - ] + , workloads: + [ $voting_workload * {parameters: + { outs_per_split_transaction: 193 + , submit_vote: true + , votes_per_tx: 2 + } + }] } ## P&T Nomad cluster: 52 nodes, PlutusV3 BLST and Plutus SECP workloads diff --git a/nix/workbench/service/generator.nix b/nix/workbench/service/generator.nix index 70bd6700b18..b0038c67a1d 100644 --- a/nix/workbench/service/generator.nix +++ b/nix/workbench/service/generator.nix @@ -129,23 +129,42 @@ let value = '' #!${pkgs.stdenv.shell} - ############################### VOTING ############################### - ############################### VOTING ############################### - ############################### VOTING ############################### - ${if profile.generator.drep_voting or false - then - '' - ${import ./voting.nix {inherit pkgs profile nodeSpecs;}} - workflow_generator \ - ${if profile.composition.with_explorer then "explorer" else "node-0"} - '' - else - '' - '' + ############################################# + # Extra workloads start ##################### + ############################################# + ${builtins.concatStringsSep "" (builtins.map (workload: + let nix_module_name = workload.nix_module_name; + entrypoint = workload.entrypoints.pre_generator or ""; + node_name = if profile.composition.with_explorer + then "explorer" + else "node-0" + ; + in + '' + ############################################# + ########## workload start: ${nix_module_name} + ############################################# + ${if entrypoint != "" + then + '' + ${import ../workload/${nix_module_name} + {inherit pkgs profile nodeSpecs workload;} + } + ${entrypoint} ${node_name} + '' + else + '' + '' + } + ############################################# + ########## workload end: ${nix_module_name} + ############################################# + '' + ) (profile.workloads or [])) } - ############################### VOTING ############################### - ############################### VOTING ############################### - ############################### VOTING ############################### + ############################################# + # Extra workloads end ####################### + ############################################# ${service.script} ''; diff --git a/nix/workbench/service/voting.nix b/nix/workbench/workload/voting.nix similarity index 99% rename from nix/workbench/service/voting.nix rename to nix/workbench/workload/voting.nix index 7e36eaadd6a..02cfe802b39 100644 --- a/nix/workbench/service/voting.nix +++ b/nix/workbench/workload/voting.nix @@ -1,6 +1,7 @@ { pkgs , profile , nodeSpecs +, workload }: let @@ -21,8 +22,6 @@ let # Where to obtain the genesis funds from. genesis_funds_vkey = "../genesis/cache-entry/utxo-keys/utxo2.vkey"; genesis_funds_skey = "../genesis/cache-entry/utxo-keys/utxo2.skey"; - # Workload - workload = builtins.elemAt profile.workload 0; # Only workload 0 exists now! # Initial donation from genesis funds to make "valid" withdrawal proposals. treasury_donation = 500000;