Skip to content

Commit 20c9155

Browse files
committed
WIP: profile workloads
1 parent 68b944b commit 20c9155

File tree

16 files changed

+580
-529
lines changed

16 files changed

+580
-529
lines changed

nix/workbench/backend/backend.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ case "${op}" in
5050
start-tracers ) backend_$WB_BACKEND "$@";;
5151
start-nodes ) backend_$WB_BACKEND "$@";;
5252
start-generator ) backend_$WB_BACKEND "$@";;
53+
start-workloads ) backend_$WB_BACKEND "$@";;
5354
start-healthchecks ) backend_$WB_BACKEND "$@";;
54-
start-latencies ) backend_$WB_BACKEND "$@";;
5555
# Fine grained
5656
start-node ) backend_$WB_BACKEND "$@";;
5757
stop-node ) backend_$WB_BACKEND "$@";;
5858
wait-node ) backend_$WB_BACKEND "$@";;
5959
wait-node-stopped ) backend_$WB_BACKEND "$@";;
6060
get-node-socket-path ) backend_$WB_BACKEND "$@";;
6161
wait-pools-stopped ) backend_$WB_BACKEND "$@";;
62-
wait-latencies-stopped ) backend_$WB_BACKEND "$@";;
62+
wait-workloads-stopped ) backend_$WB_BACKEND "$@";;
6363
# Stop functions
6464
stop-all ) backend_$WB_BACKEND "$@";;
6565
fetch-logs ) backend_$WB_BACKEND "$@";;

nix/workbench/backend/nomad-job.nix

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -902,28 +902,27 @@ let
902902
}
903903
])
904904
++
905-
# healthcheck
906-
[
907-
## healthcheck start.sh script.
905+
# workloads
906+
(builtins.map (workload:
907+
## workload start.sh script.
908908
{
909909
env = false;
910-
destination = "local/${stateDir}/healthcheck/start.sh";
911-
data = escapeTemplate
912-
profileData.healthcheck-service.start.value;
910+
destination = "local/${stateDir}/workloads/${workload.name}/start.sh";
911+
data = escapeTemplate workload.start.value;
913912
change_mode = "noop";
914913
error_on_missing_key = true;
915914
perms = "744"; # Only for every "start.sh" script. Default: "644"
916915
}
917-
]
916+
) profileData.workloads-service)
918917
++
919-
# latency
918+
# healthcheck
920919
[
921-
## Latency start.sh script.
920+
## healthcheck start.sh script.
922921
{
923922
env = false;
924-
destination = "local/${stateDir}/latency/start.sh";
923+
destination = "local/${stateDir}/healthcheck/start.sh";
925924
data = escapeTemplate
926-
profileData.latency-service.start.value;
925+
profileData.healthcheck-service.start.value;
927926
change_mode = "noop";
928927
error_on_missing_key = true;
929928
perms = "744"; # Only for every "start.sh" script. Default: "644"

nix/workbench/backend/nomad.sh

Lines changed: 267 additions & 238 deletions
Large diffs are not rendered by default.

nix/workbench/backend/nomad/cloud.sh

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ backend_nomadcloud() {
8181
backend_nomad wait-pools-stopped 60 "$@"
8282
;;
8383

84-
wait-latencies-stopped )
84+
wait-workloads-stopped )
8585
# It passes the sleep time (in seconds) required argument.
8686
# This time is different between local and cloud backends to avoid
8787
# unnecesary Nomad specific traffic (~99% happens waiting for node-0, the
8888
# first one it waits to stop inside a loop) and at the same time be less
8989
# sensitive to network failures.
90-
backend_nomad wait-latencies-stopped 60 "$@"
90+
backend_nomad wait-workloads-stopped 60 "$@"
9191
;;
9292

9393
fetch-logs )
@@ -146,12 +146,12 @@ backend_nomadcloud() {
146146
backend_nomad start-generator "$@"
147147
;;
148148

149-
start-healthchecks )
150-
backend_nomad start-healthchecks "$@"
149+
start-workloads )
150+
backend_nomad start-workloads "$@"
151151
;;
152152

153-
start-latencies )
154-
backend_nomad start-latencies "$@"
153+
start-healthchecks )
154+
backend_nomad start-healthchecks "$@"
155155
;;
156156

157157
start-node )
@@ -998,18 +998,6 @@ fetch-logs-ssh-node() {
998998
local ssh_config_path ssh_command
999999
ssh_config_path="$(wb nomad ssh config)"
10001000
ssh_command="ssh -F ${ssh_config_path} -p 32000 -l nobody"
1001-
# Download latency(ies) logs. ################################################
1002-
##############################################################################
1003-
msg "$(blue "Fetching") $(yellow "program \"latency\"") run files from $(yellow "\"${node}\" (\"${public_ipv4}\")") ..."
1004-
if ! rsync -e "${ssh_command}" -au \
1005-
-f'- start.sh' \
1006-
"${public_ipv4}":/local/run/current/latency/ \
1007-
"${dir}"/latency/"${node}"/
1008-
then
1009-
node_ok="false"
1010-
touch "${dir}"/nomad/"${node}"/download_failed
1011-
msg "$(red Error fetching) $(yellow "program \"latency\"") $(red "run files from") $(yellow "\"${node}\" (\"${public_ipv4}\")") ..."
1012-
fi
10131001
# Download healthcheck(s) logs. ##############################################
10141002
##############################################################################
10151003
msg "$(blue "Fetching") $(yellow "program \"healthcheck\"") run files from $(yellow "\"${node}\" (\"${public_ipv4}\")") ..."
@@ -1022,6 +1010,22 @@ fetch-logs-ssh-node() {
10221010
touch "${dir}"/nomad/"${node}"/download_failed
10231011
msg "$(red Error fetching) $(yellow "program \"healthcheck\"") $(red "run files from") $(yellow "\"${node}\" (\"${public_ipv4}\")") ..."
10241012
fi
1013+
# Download workload(s) logs. #################################################
1014+
##############################################################################
1015+
# For every workload
1016+
for workload in $(jq_tolist '.workloads | map(.name)' "$dir"/profile.json)
1017+
do
1018+
msg "$(blue "Fetching") $(yellow "program \"${workload}\" workload") run files from $(yellow "\"${node}\" (\"${public_ipv4}\")") ..."
1019+
if ! rsync -e "${ssh_command}" -au \
1020+
-f'- start.sh' \
1021+
"${public_ipv4}":/local/run/current/workloads/"${workload}"/ \
1022+
"${dir}"/workloads/"${workload}"/"${node}"/
1023+
then
1024+
node_ok="false"
1025+
touch "${dir}"/nomad/"${node}"/download_failed
1026+
msg "$(red Error fetching) $(yellow "program \"${workload}\" workload") $(red "run files from") $(yellow "\"${node}\" (\"${public_ipv4}\")") ..."
1027+
fi
1028+
done
10251029
# Download generator logs. ###################################################
10261030
##############################################################################
10271031
if test "${node}" = "explorer"

nix/workbench/backend/nomad/exec.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ backend_nomadexec() {
6161
backend_nomad wait-pools-stopped 1 "$@"
6262
;;
6363

64-
wait-latencies-stopped )
64+
wait-workloads-stopped )
6565
# It passes the sleep time (in seconds) required argument.
6666
# This time is different between local and cloud backends to avoid
6767
# unnecesary Nomad specific traffic (~99% happens waiting for node-0, the
6868
# first one it waits to stop inside a loop) and at the same time be less
6969
# sensitive to network failures.
70-
backend_nomad wait-latencies-stopped 1 "$@"
70+
backend_nomad wait-workloads-stopped 1 "$@"
7171
;;
7272

7373
# All or clean up everything!
@@ -107,12 +107,12 @@ backend_nomadexec() {
107107
backend_nomad start-generator "$@"
108108
;;
109109

110-
start-healthchecks )
111-
backend_nomad start-healthchecks "$@"
110+
start-workloads )
111+
backend_nomad start-workloads "$@"
112112
;;
113113

114-
start-latencies )
115-
backend_nomad start-latencies "$@"
114+
start-healthchecks )
115+
backend_nomad start-healthchecks "$@"
116116
;;
117117

118118
start-node )

nix/workbench/backend/supervisor-conf.nix

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,18 @@ let
184184
startsecs = 5;
185185
};
186186
}
187+
188+
189+
187190
//
188-
{
189-
"program:latency" = {
191+
(builtins.listToAttrs (builtins.map (workload: {
192+
name = "program:${workload.name}";
193+
value = {
190194
# "command" below assumes "directory" is set accordingly.
191-
directory = "${stateDir}/latency";
195+
directory = "${stateDir}/workloads/${workload.name}";
192196
command = "${command}";
193-
stdout_logfile = "${stateDir}/latency/stdout";
194-
stderr_logfile = "${stateDir}/latency/stderr";
197+
stdout_logfile = "${stateDir}/workloads/${workload.name}/stdout";
198+
stderr_logfile = "${stateDir}/workloads/${workload.name}/stderr";
195199
# Set these values to 0 to indicate an unlimited log size / no rotation.
196200
stdout_logfile_maxbytes = 0;
197201
stderr_logfile_maxbytes = 0;
@@ -204,7 +208,10 @@ let
204208
# Seconds it needs to stay running to consider the start successful
205209
startsecs = 5;
206210
};
207-
}
211+
}) profileData.workloads))
212+
213+
214+
208215
//
209216
lib.attrsets.optionalAttrs withSsh
210217
{

nix/workbench/backend/supervisor.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ case "$op" in
8585
mkdir -p "$hche_dir"
8686
cp $(jq '."start"' -r $hche) "$hche_dir"/start.sh
8787

88-
mkdir -p "$dir"/latency
88+
mkdir -p "$dir"/workloads
89+
for workload in $(jq_tolist '.workloads | map(.name)' "$dir"/profile.json)
90+
do
91+
mkdir -p "$dir"/workloads/"${workload}"
92+
done
8993
;;
9094

9195
deploy-genesis )

nix/workbench/profile/prof0-defaults.jq

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ def era_defaults($era):
6363
}
6464
}
6565

66+
, workloads: []
67+
6668
, node:
6769
{ rts_flags_override: []
6870
, heap_limit: null ## optional: heap limit in MB (translates to RTS flag -M)

nix/workbench/profile/prof1-variants.jq

Lines changed: 62 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def all_profile_variants:
392392
| .node.shutdown_on_slot_synced = 1200
393393
) as $for_1200slot
394394
##
395-
### Definition vocabulary: workload
395+
### Definition vocabulary: generator workload
396396
##
397397
| ({}|
398398
.generator.tps = 15
@@ -431,7 +431,6 @@ def all_profile_variants:
431431
, generator:
432432
{ inputs_per_tx: 1
433433
, outputs_per_tx: 1
434-
, drep_voting: true
435434
}
436435
}) as $voting_base
437436
|
@@ -545,6 +544,25 @@ def all_profile_variants:
545544
| .generator.tx_fee = 940000
546545
) as $plutus_loop_ripemd
547546
##
547+
### Definition vocabulary: custom workloads
548+
##
549+
|
550+
({ name: "latency"
551+
, parameters: {}
552+
, entrypoints: {
553+
pre_generator: null
554+
, producers: "workflow_producer"
555+
}
556+
}) as $latency_workload
557+
|
558+
({ name: "voting"
559+
, parameters: {}
560+
, entrypoints: {
561+
pre_generator: "workflow_generator"
562+
, producers: "workflow_producer"
563+
}
564+
}) as $voting_workload
565+
##
548566
### Definition vocabulary: genesis variants
549567
##
550568
|
@@ -716,9 +734,6 @@ def all_profile_variants:
716734
|
717735
({ scenario: "tracer-only"
718736
}) as $scenario_tracer_only
719-
|
720-
({ scenario: "latency"
721-
}) as $scenario_latency
722737
|
723738
##
724739
### Definition vocabulary: base variant
@@ -830,11 +845,11 @@ def all_profile_variants:
830845
}
831846
}) as $nomad_perf_plutussecp_base
832847
|
833-
($scenario_latency * $compose_fiftytwo * $dataset_empty * $no_filtering *
848+
($latency_workload * $compose_fiftytwo * $dataset_empty * $no_filtering *
834849
{ desc: "AWS perf class cluster, stop when all latency services stop"
835850
}) as $nomad_perf_latency_base
836851
|
837-
($scenario_latency * $compose_fiftytwo * $dataset_empty * $no_filtering *
852+
($latency_workload * $compose_fiftytwo * $dataset_empty * $no_filtering *
838853
{ desc: "AWS perf-ssd class cluster, stop when all latency services stop"
839854
}) as $nomad_perfssd_latency_base
840855
|
@@ -1325,68 +1340,68 @@ def all_profile_variants:
13251340
# Split creating 500k UTxO, create the transactions (build-raw) but no submit.
13261341
, $valuevoting_nomadperf_template * $dreps_large *
13271342
{ name: "value-voting-utxo-volt-nomadperf"
1328-
, generator: {drep_voting: true}
1329-
, workload: [
1330-
{ outs_per_split_transaction: 193
1331-
, submit_vote: false
1332-
}
1333-
]
1343+
, workloads:
1344+
[ $voting_workload * {parameters:
1345+
{ outs_per_split_transaction: 193
1346+
, submit_vote: false
1347+
}
1348+
}]
13341349
}
13351350
# One vote per voting tx version.
13361351
, $valuevoting_nomadperf_template * $dreps_large *
13371352
{ name: "value-voting-volt-nomadperf"
1338-
, generator: {drep_voting: true}
1339-
, workload: [
1340-
{ outs_per_split_transaction: 193
1341-
, submit_vote: true
1342-
, votes_per_tx: 1
1343-
}
1344-
]
1353+
, workloads:
1354+
[ $voting_workload * {parameters:
1355+
{ outs_per_split_transaction: 193
1356+
, submit_vote: true
1357+
, votes_per_tx: 1
1358+
}
1359+
}]
13451360
}
13461361
# Two votes per voting tx version.
13471362
, $valuevoting_nomadperf_template * $dreps_large *
13481363
{ name: "value-voting-double-volt-nomadperf"
1349-
, generator: {drep_voting: true}
1350-
, workload: [
1351-
{ outs_per_split_transaction: 193
1352-
, submit_vote: true
1353-
, votes_per_tx: 2
1354-
}
1355-
]
1364+
, workloads:
1365+
[ $voting_workload * {parameters:
1366+
{ outs_per_split_transaction: 193
1367+
, submit_vote: true
1368+
, votes_per_tx: 2
1369+
}
1370+
}]
13561371
}
13571372

13581373
## As "plutus" above with an extra voting workload
13591374
# Split creating 500k UTxO, create the transactions (build-raw) but no submit.
13601375
, $plutusvoting_nomadperf_template * $dreps_large *
13611376
{ name: "plutus-voting-utxo-volt-nomadperf"
1362-
, generator: {drep_voting: true}
1363-
, workload: [
1364-
{ outs_per_split_transaction: 193
1365-
, submit_vote: false
1366-
}
1367-
]
1377+
, workloads:
1378+
[ $voting_workload * {parameters:
1379+
{ outs_per_split_transaction: 193
1380+
, submit_vote: false
1381+
}
1382+
}]
13681383
}
13691384
# One vote per voting tx version.
13701385
, $plutusvoting_nomadperf_template * $dreps_large *
13711386
{ name: "plutus-voting-volt-nomadperf"
1372-
, generator: {drep_voting: true}
1373-
, workload: [
1374-
{ outs_per_split_transaction: 193
1375-
, submit_vote: true
1376-
, votes_per_tx: 1
1377-
}
1378-
]
1387+
, workloads:
1388+
[ $voting_workload * {parameters:
1389+
{ outs_per_split_transaction: 193
1390+
, submit_vote: true
1391+
, votes_per_tx: 1
1392+
}
1393+
}]
13791394
}
13801395
# Two votes per voting tx version.
13811396
, $plutusvoting_nomadperf_template * $dreps_large *
13821397
{ name: "plutus-voting-double-volt-nomadperf"
1383-
, generator: {drep_voting: true}
1384-
, workload: [
1385-
{ outs_per_split_transaction: 193
1386-
, submit_vote: true
1387-
, votes_per_tx: 2
1388-
}
1389-
]
1398+
, workloads:
1399+
[ $voting_workload * {parameters:
1400+
{ outs_per_split_transaction: 193
1401+
, submit_vote: true
1402+
, votes_per_tx: 2
1403+
}
1404+
}]
13901405
}
13911406

13921407
## P&T Nomad cluster: 52 nodes, PlutusV3 BLST and Plutus SECP workloads

0 commit comments

Comments
 (0)