Skip to content

Commit

Permalink
WIP: profile workloads
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaste committed Dec 31, 2024
1 parent 68b944b commit 9873821
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 60 deletions.
2 changes: 2 additions & 0 deletions nix/workbench/profile/prof0-defaults.jq
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
94 changes: 52 additions & 42 deletions nix/workbench/profile/prof1-variants.jq
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -431,7 +431,6 @@ def all_profile_variants:
, generator:
{ inputs_per_tx: 1
, outputs_per_tx: 1
, drep_voting: true
}
}) as $voting_base
|
Expand Down Expand Up @@ -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
##
|
Expand Down Expand Up @@ -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
Expand Down
51 changes: 35 additions & 16 deletions nix/workbench/service/generator.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}
'';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ pkgs
, profile
, nodeSpecs
, workload
}:

let
Expand All @@ -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;

Expand Down

0 comments on commit 9873821

Please sign in to comment.