Skip to content

Commit

Permalink
Merge #4147
Browse files Browse the repository at this point in the history
4147: workbench:  fixes r=deepfire a=deepfire

- fix the genesis cache creation
- new profiles: a bunch of `forge-stress-pre` variants, with Oct2021 datasets and `oldtracing`
- add a legacy-tracing config file filter
- CODEOWNERS:  add `@fmaste` for `bench/` and `nix/workbench`

Co-authored-by: Kosyrev Serge <serge.kosyrev@iohk.io>
  • Loading branch information
iohk-bors[bot] and deepfire authored Jul 7, 2022
2 parents 0cd6878 + 4ddccfc commit e73bb43
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 28 deletions.
10 changes: 5 additions & 5 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ cabal.project @Jimbo4350 @newhog
doc @docs-access
README.* @docs-access

bench/tx-generator @Jimbo4350 @newhoggy @deepfire @MarcFontaine
bench @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @MarcFontaine @mgmeier @cleverca22
bench/tx-generator @Jimbo4350 @newhoggy @deepfire @mgmeier @MarcFontaine
bench @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @MarcFontaine @mgmeier @fmaste @cleverca22
cardano-tracer @Jimbo4350 @newhoggy @deepfire @denisshevchenko
nix/workbench @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @MarcFontaine @mgmeier
nix/workbench @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @MarcFontaine @mgmeier @fmaste
trace-dispatcher @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @mgmeier
trace-forward @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @mgmeier
trace-resources @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @mgmeier
Makefile @Jimbo4350 @newhoggy @deepfire @mgmeier
*.mk @Jimbo4350 @newhoggy @deepfire @mgmeier
Makefile @Jimbo4350 @newhoggy @deepfire @mgmeier @fmaste
*.mk @Jimbo4350 @newhoggy @deepfire @mgmeier @fmaste

.buildkite @Jimbo4350 @newhoggy @devops
.github @Jimbo4350 @newhoggy @devops
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ERA ?= bage

PROFILE ?= default-${ERA}
REV ?= master
ITER ?=
ARGS ?=
CMD ?=
RUN ?=
Expand Down Expand Up @@ -65,12 +66,13 @@ ps: ## Plain-text list of profiles
##
## Profile-based cluster shells (autogenerated targets)
##
PROFILES_BASE := default plutus
PROFILES_BASE := default plutus oldtracing
PROFILES_STARTSTOP := startstop startstop-p2p startstop-plutus startstop-notracer startstop-oldtracing
PROFILES_CI_TEST := ci-test ci-test-p2p ci-test-plutus ci-test-notracer
PROFILES_CI_BENCH := ci-bench ci-bench-p2p ci-bench-plutus ci-bench-notracer
PROFILES_10 := 10 10-p2p 10-plutus 10-notracer
PROFILES_FORGE_STRESS := forge-stress forge-stress-p2p forge-stress-plutus forge-stress-plutus-singleton forge-stress-notracer
PROFILES_FORGE_STRESS_PRE := forge-stress-pre forge-stress-pre-plutus forge-stress-pre-notracer
PROFILES_CHAINSYNC := chainsync-early-byron chainsync-early-byron-notracer chainsync-early-byron-oldtracing
PROFILES_CHAINSYNC += chainsync-early-alonzo chainsync-early-alonzo-notracer chainsync-early-alonzo-oldtracing chainsync-early-alonzo-p2p
PROFILES_VENDOR := dish dish-plutus dish-10M dish-10M-plutus
Expand All @@ -81,6 +83,7 @@ SHELL_PROFILES += $(PROFILES_CI_TEST)
SHELL_PROFILES += $(PROFILES_CI_BENCH)
SHELL_PROFILES += $(PROFILES_10)
SHELL_PROFILES += $(PROFILES_FORGE_STRESS)
SHELL_PROFILES += $(PROFILES_FORGE_STRESS_PRE)
SHELL_PROFILES += $(PROFILES_CHAINSYNC)
SHELL_PROFILES += $(PROFILES_VENDOR)

Expand Down
4 changes: 2 additions & 2 deletions lib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ ifeq ($(7),true)
$(1): ARGS += --arg 'profiled' true
endif
ifeq ($(5)$(6),truetrue)
$(1): CMD := start-cluster; return
$(1): CMD := start-cluster $(if ${ITER},--iterations ${ITER}); return
endif
ifeq ($(5)$(6),truefalse)
$(1): RUN := start-cluster
$(1): RUN := start-cluster $(if ${ITER},--iterations ${ITER})
endif
ifeq ($(3)$(4)$(5)$(6),falsetruefalsefalse)
define EXTRA_HELP +=
Expand Down
2 changes: 1 addition & 1 deletion nix.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ membench-5-at: ## Membench: 5 iterations, set commit by: make membench-5-at RE

workbench-ci-test smoke: ## Workbench: test a-la Hydra, the ci-test profile, full Nix engaged
nix build --out-link result-ci-test '.#hydraJobsPr.linux.native.workbench-ci-test' --cores 0
mv result-ci-test run/`jq -r .meta.tag result-ci-test/meta.json`
ID=`jq -r .meta.tag result-ci-test/meta.json`; test -e "run/$$ID" || mv result-ci-test "run/$$ID"
50 changes: 49 additions & 1 deletion nix/workbench/analyse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,55 @@ analysis_config_extract_legacy_tracing() {
let f = __fromJSON (__readFile "'$file'");
in with f;
__toJSON
{ inherit rotation;
{ inherit
TraceAcceptPolicy
TraceBlockFetchClient
TraceBlockFetchDecisions
TraceBlockFetchProtocol
TraceBlockFetchProtocolSerialised
TraceBlockFetchServer
TraceChainDb
TraceChainSyncBlockServer
TraceChainSyncClient
TraceChainSyncHeaderServer
TraceChainSyncProtocol
TraceConnectionManager
TraceDNSResolver
TraceDNSSubscription
TraceDiffusionInitialization
TraceErrorPolicy
TraceForge
TraceHandshake
TraceInboundGovernor
TraceIpSubscription
TraceLedgerPeers
TraceLocalChainSyncProtocol
TraceLocalErrorPolicy
TraceLocalHandshake
TraceLocalRootPeers
TraceLocalTxSubmissionProtocol
TraceLocalTxSubmissionServer
TraceMempool
TraceMux
TracePeerSelection
TracePeerSelectionActions
TracePublicRootPeers
TraceServer
TraceTxInbound
TraceTxOutbound
TraceTxSubmissionProtocol
TracingVerbosity
TurnOnLogMetrics
TurnOnLogging
defaultBackends
defaultScribes
hasEKG
hasPrometheus
minSeverity
options
rotation
setupBackends
setupScribes;
}'
)
nix eval "${nix_eval_args[@]}" | jq --sort-keys
Expand Down
11 changes: 6 additions & 5 deletions nix/workbench/genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,14 @@ case "$op" in
msg "genesis: removing delegator keys.."
rm "$dir"/stake-delegator-keys -rf

cat <<<$cache_key_input > "$dir"/cache.key.input
cat <<<$cache_key > "$dir"/cache.key
cat <<<$global_genesis_format_version > "$dir"/layout.version

msg "genesis: moving keys"
## TODO: try to get rid of this step:
Massage_the_key_file_layout_to_match_AWS "$profile_json" "$node_specs" "$dir";;
Massage_the_key_file_layout_to_match_AWS "$profile_json" "$node_specs" "$dir"

msg "genesis: sealing"
cat <<<$cache_key_input > "$dir"/cache.key.input
cat <<<$cache_key > "$dir"/cache.key
cat <<<$global_genesis_format_version > "$dir"/layout.version;;

derive-from-cache )
local usage="USAGE: wb genesis $op PROFILE-OUT TIMING-JSON-EXPR CACHE-ENTRY-DIR OUTDIR"
Expand Down
1 change: 0 additions & 1 deletion nix/workbench/lib-cabal.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
echo 'lib-cabal args: '"$*"
progress "workbench" "cabal-inside-nix-shell mode enabled, calling cardano-* via '$(white cabal run)' (instead of using Nix store); $(red lib-cabal.sh) flags: $(yellow $*)"

if test ! -v WB_PROFILED; then export WB_PROFILED= ; fi
Expand Down
21 changes: 21 additions & 0 deletions nix/workbench/profiles/prof1-variants.jq
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,13 @@ def all_profile_variants:
($scenario_fixed_loaded * $doublet * $dataset_miniature * $for_15blk *
{ desc: "Miniature dataset, CI-friendly duration, bench scale"
}) as $cibench_base
|
($scenario_fixed_loaded * $doublet * $dataset_oct2021 *
{ node:
{ shutdown_on_slot_synced: 2400
}
, desc: "Oct 2021 dataset size, honest four epochs."
}) as $forge_stress_pre_base
|
($scenario_fixed_loaded * $doublet * $dataset_status_quo *
{ node:
Expand Down Expand Up @@ -351,6 +358,10 @@ def all_profile_variants:
{ name: "plutus"
, desc: "Default with Plutus workload"
}
, $old_tracing *
{ name: "oldtracing"
, desc: "Default in legacy tracing mode"
}

## Fastest -- start-stop
, $startstop_base *
Expand Down Expand Up @@ -448,6 +459,16 @@ def all_profile_variants:
{ name: "forge-stress-notracer"
}

, $forge_stress_pre_base *
{ name: "forge-stress-pre"
}
, $forge_stress_pre_base * $plutus *
{ name: "forge-stress-pre-plutus"
}
, $forge_stress_pre_base * $without_tracer *
{ name: "forge-stress-pre-notracer"
}

, $scenario_chainsync * $chaindb_early_byron *
{ name: "chainsync-early-byron"
}
Expand Down
13 changes: 6 additions & 7 deletions nix/workbench/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ case "$op" in
--* ) msg "FATAL: unknown flag '$1'"; usage_run;;
* ) break;; esac; shift; done

local node_specs="$profile"/node-specs.json

if profile has-preset "$profile"/profile.json
then preset=$(profile json "$profile"/profile.json | jq '.preset' -r)
progress "run" "allocating from preset '$preset'"
Expand All @@ -330,7 +332,6 @@ case "$op" in
local hash=$(jq '."cardano-node" | .[:5]' -r <<<$manifest)

## 1. compute cluster composition
local node_specs=$(profile node-specs "$profile"/profile.json)

## 2. genesis cache entry population
progress "run | genesis" "cache entry: $(if test -n "$genesis_cache_entry"; then echo pre-supplied; else echo preparing a new one..; fi)"
Expand Down Expand Up @@ -378,14 +379,12 @@ case "$op" in
then
test "$(jq -r .name $profile/profile.json)" = "$profile_name" ||
fatal "profile | allocate incoherence: --profile $profile/profile.json mismatches '$profile_name'"
ln -s "$profile" "$dir"/profile
cp "$profile"/profile.json "$dir"/profile.json
ln -s "$profile" "$dir"/profile
cp "$profile"/profile.json "$dir"/profile.json
cp "$profile"/node-specs.json "$dir"/node-specs.json
else
profile has-profile "$profile_name" ||
fatal "no such profile: $profile_name"
profile json "$profile_name" > "$dir"/profile.json
fail "Mode no longer supported: operation without profile/ directory."
fi
jq '.' <<<$node_specs > "$dir"/node-specs.json

local args=(
--arg tag "$tag"
Expand Down
2 changes: 1 addition & 1 deletion nix/workbench/topology.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ case "${op}" in
local usage="USAGE: wb topology density-map NODE-SPECS-JSON"
local node_specs_json=${1:?$usage}

args=(--slurpfile node_specs "$node_specs"
args=(--slurpfile node_specs "$node_specs_json"
--null-input --compact-output
)
jq ' $node_specs[0]
Expand Down
10 changes: 6 additions & 4 deletions nix/workbench/wb
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ start()
profile_name=${profile_name:-$(jq '.name' -r $profile/profile.json)}
analysis_type=$(jq '.analysis.type' -r $profile/profile.json)

progress "top-level" "iterations of profile $(with_color 'yellow' $profile_name): $(with_color 'white' $iterations)"
for ((i=0; i<$iterations; i++))
do local args=(
local top_i
for ((top_i=0; top_i<$iterations; top_i++))
do progress "top-level" "profile $(with_color 'yellow' $profile_name), iteration $(with_color 'white' $((top_i+1))) of $(with_color 'yellow' $iterations)"
local args=(
${run_allocate_args[@]}
--manifest "$(manifest collect-from-checkout "$node_source" $node_rev)"
)
Expand All @@ -172,7 +173,8 @@ start()
if test -n "$no_analysis" -o $analysis_type = null; then continue; fi

progress "top-level | analysis" "analysis type $(with_color yellow $analysis_type) on $(with_color white $tag)"
analyse ${analyse_args[@]} $analysis_type $tag ||
analyse ${analyse_args[@]} $analysis_type $tag &&
progress "run | analysis" "done" ||
if test -n "$analysis_can_fail" -a -z "$no_retry_failed_runs"
then progress "run | analysis" "log processing failed, but --analysis-can-fail prevents failure: $(with_color red $tag)"
iterations=$((iterations + 1))
Expand Down

0 comments on commit e73bb43

Please sign in to comment.