Skip to content

Commit

Permalink
Merge #3402
Browse files Browse the repository at this point in the history
3402: bench:  update analysis run fixup to the new AWS log results layout r=deepfire a=deepfire

This updates the run fixup done by the workbench, to reflect the changes in the AWS results layout.

Co-authored-by: Kosyrev Serge <serge.kosyrev@iohk.io>
  • Loading branch information
iohk-bors[bot] and deepfire committed Jan 19, 2022
2 parents 63c136f + 70185e6 commit 42582c8
Show file tree
Hide file tree
Showing 66 changed files with 17,570 additions and 2,108 deletions.
66 changes: 27 additions & 39 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
PROJECT_NAME = cardano-node
NUM_PROC = $(nproc --all)

## One of: shey alra mary alzo
ERA ?= alzo

CLUSTER_PROFILE ?= default-${ERA}
ifneq "${CLUSTER_PROFILE}" "default-${ERA}"
$(warning DEPRECATED: CLUSTER_PROFILE is deprecated, please use PROFILE)
endif

PROFILE ?= ${CLUSTER_PROFILE}
ARGS ?=


help: ## Print documentation
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
Expand Down Expand Up @@ -30,55 +41,32 @@ test-ghcid: ## Run ghcid on test suites
test-ghcid-nix: ## Run ghcid on test suites with Nix
@ghcid --command="stack ghci --test --main-is $(PROJECT_NAME):test:$(PROJECT_NAME)-test --nix -j$(NUM_PROC)"

test-chairmans-cluster:
@scripts/chairmans-cluster/cluster-test.sh

profiles:
@./nix/workbench/wb dump-profiles

profile-names:
@./nix/workbench/wb profile-names
bench-chainsync: PROFILE=chainsync-${ERA}
bench-chainsync: cluster-shell-dev ## Enter Nix shell and start the chainsync benchmark

CLUSTER_PROFILE ?= default-alzo
CLUSTER_ARGS_EXTRA ?=
cluster-profiles: ## List available workbench profiles (for PROFILE=)
@./nix/workbench/wb profile list

cluster-shell:
nix-shell --max-jobs 8 --cores 0 --show-trace --argstr clusterProfile ${CLUSTER_PROFILE} --arg 'autoStartCluster' true
cluster-shell: ## Enter Nix shell and start the workbench cluster
nix-shell --max-jobs 8 --cores 0 --show-trace --argstr profileName ${PROFILE} --arg 'autoStartCluster' true

shell-dev: CLUSTER_ARGS_EXTRA += --arg 'workbenchDevMode' true
cluster-shell: CLUSTER_ARGS_EXTRA += --arg 'autoStartCluster' true --arg 'workbenchDevMode' true
cluster-shell-dev: CLUSTER_ARGS_EXTRA += --arg 'autoStartCluster' true --arg 'workbenchDevMode' true
cluster-shell-trace: CLUSTER_ARGS_EXTRA += --arg 'autoStartCluster' true --argstr 'autoStartClusterArgs' '--trace --trace-workbench'
cluster-shell-dev-trace: CLUSTER_ARGS_EXTRA += --arg 'autoStartCluster' true --arg 'workbenchDevMode' true --argstr 'autoStartClusterArgs' '--trace --trace-workbench'
shell-dev: ARGS += --arg 'workbenchDevMode' true ## Enter Nix shell, dev mode (workbench run from checkout)
cluster-shell: ARGS += --arg 'autoStartCluster' true --arg 'workbenchDevMode' true ## Enter Nix shell, and start workbench cluster
cluster-shell-dev: ARGS += --arg 'autoStartCluster' true --arg 'workbenchDevMode' true ## Enter Nix shell, dev mode, and start workbench cluster
cluster-shell-trace: ARGS += --arg 'autoStartCluster' true --argstr 'autoStartClusterArgs' '--trace --trace-workbench' ## Enter Nix shell, start workbench cluster, with shell tracing
cluster-shell-dev-trace: ARGS += --arg 'autoStartCluster' true --arg 'workbenchDevMode' true --argstr 'autoStartClusterArgs' '--trace --trace-workbench' ## Enter Nix shell, dev mode, start workbench cluster, with shell tracing
shell-dev cluster-shell-dev cluster-shell-trace cluster-shell-dev-trace: shell

shell:
nix-shell --max-jobs 8 --cores 0 --show-trace --argstr clusterProfile ${CLUSTER_PROFILE} ${CLUSTER_ARGS_EXTRA}
shell: ## Enter Nix shell, CI mode (workbench run from Nix store)
nix-shell --max-jobs 8 --cores 0 --show-trace --argstr profileName ${PROFILE} ${ARGS}

cli node:
cabal --ghc-options="+RTS -qn8 -A32M -RTS" build cardano-$@

BENCH_REPEATS ?= 3
BENCH_CONFIG ?= both
BENCH_TAG ?= HEAD
BENCH_XARGS ?=

profile-chainsync:
scripts/mainnet-via-fetcher.sh ${BENCH_XARGS} --node-config-${BENCH_CONFIG} --repeats ${BENCH_REPEATS} --nix --profile time --tag ${BENCH_TAG}

profile-chainsync-fast: BENCH_XARGS=--skip-prefetch
profile-chainsync-fast: profile-chainsync

clean-profile proclean:
rm -f *.html *.prof *.hp *.stats *.eventlog

clean: clean-profile
rm -rf logs/ socket/ cluster.*

full-clean: clean
rm -rf db dist-newstyle .stack-work $(shell find . -name '*~' -or -name '*.swp')
clean:
rm -rf dist-newstyle .stack-work $(shell find . -name '*~' -or -name '*.swp')

cls:
echo -en "\ec"

.PHONY: stylish-haskell cabal-hashes ghcid ghcid-test run-test test-ghci test-ghcid help clean clean-profile proclean cls setup restore
.PHONY: bench-chainsync cabal-hashes clean cli cls cluster-profiles cluster-shell cluster-shell-dev cluster-shell-dev-trace cluster-shell-trace ghci ghcid help node run-test shell shell-dev stylish-haskell test-ghci test-ghcid test-ghcid-nix
18 changes: 12 additions & 6 deletions bench/cardano-topology/cardano-topology.hs
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,18 @@ main = do
( long "loc"
<> help "Region (at least one)"
<> metavar "LOCNAME" ))
<*> pure defaultRoleSelector

defaultRoleSelector = \case
0 -> Nothing -- BFT node has no pools
1 -> Just 1 -- Regular pools have just 1 pool
_ -> Just 2 -- Dense pools have any amount >1 as marker
<*> (roleSelector <$>
flag False True
( long "with-bft-node-0"
<> help "Include a BFT node-0"))

roleSelector withBft = \case
-- TODO: prepare for deprecation of BFT nodes by switching 1 & 0
1 -> Just 1 -- Normal pools are just that -- a single pool
0 -> if withBft
then Nothing -- The BFT node has no pools
else Just 1 -- Dense pools are denoted by any amount >1
_ -> Just 2

opts = info (cliParser <**> helper)
( fullDesc
Expand Down
19 changes: 19 additions & 0 deletions bench/chain-filters/base-k10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[ { "tag": "CSlot"
, "contents":
{ "tag": "EpochGEq"
, "contents": 2
}
}
, { "tag": "CSlot"
, "contents":
{ "tag": "SlotLEq"
, "contents": 37000
}
}
, { "tag": "CBlock"
, "contents":
{ "tag": "BUnitaryChainDelta"
, "contents": true
}
}
]
19 changes: 19 additions & 0 deletions bench/chain-filters/base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[ { "tag": "CSlot"
, "contents":
{ "tag": "EpochGEq"
, "contents": 2
}
}
, { "tag": "CSlot"
, "contents":
{ "tag": "SlotLEq"
, "contents": 56000
}
}
, { "tag": "CBlock"
, "contents":
{ "tag": "BUnitaryChainDelta"
, "contents": true
}
}
]
7 changes: 7 additions & 0 deletions bench/chain-filters/no-ebnd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ { "tag": "CSlot"
, "contents":
{ "tag": "EpSlotGEq"
, "contents": 200
}
}
]
13 changes: 13 additions & 0 deletions bench/chain-filters/no-rewards.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[ { "tag": "CSlot"
, "contents":
{ "tag": "EpochSafeIntLEq"
, "contents": 3
}
}
, { "tag": "CSlot"
, "contents":
{ "tag": "EpochSafeIntGEq"
, "contents": 8
}
}
]
13 changes: 13 additions & 0 deletions bench/chain-filters/rewards.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[ { "tag": "CSlot"
, "contents":
{ "tag": "EpochSafeIntGEq"
, "contents": 4
}
}
, { "tag": "CSlot"
, "contents":
{ "tag": "EpochSafeIntLEq"
, "contents": 7
}
}
]
7 changes: 7 additions & 0 deletions bench/chain-filters/size-full.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ { "tag": "CBlock"
, "contents":
{ "tag": "BFullnessGEq"
, "contents": 0.9
}
}
]
13 changes: 13 additions & 0 deletions bench/chain-filters/size-mid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[ { "tag": "CBlock"
, "contents":
{ "tag": "BFullnessGEq"
, "contents": 0.1
}
}
, { "tag": "CBlock"
, "contents":
{ "tag": "BFullnessLEq"
, "contents": 0.9
}
}
]
13 changes: 13 additions & 0 deletions bench/chain-filters/size-small.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[ { "tag": "CBlock"
, "contents":
{ "tag": "BFullnessGEq"
, "contents": 0.03
}
}
, { "tag": "CBlock"
, "contents":
{ "tag": "BFullnessLEq"
, "contents": 0.1
}
}
]
30 changes: 25 additions & 5 deletions bench/locli/locli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,23 @@ library
exposed-modules: Data.Accum
Data.Distribution

Cardano.Analysis.Profile
Cardano.Analysis.TopHandler
Cardano.Analysis.Run

Cardano.Analysis.API
Cardano.Analysis.BlockProp
Cardano.Analysis.Chain
Cardano.Analysis.ChainFilter
Cardano.Analysis.Driver
Cardano.Analysis.MachTimeline
Cardano.Analysis.Version

Cardano.Unlog.Commands
Cardano.Unlog.LogObject
Cardano.Unlog.Parsers
Cardano.Unlog.Render
Cardano.Unlog.Resources
Cardano.Unlog.Run
Cardano.Unlog.SlotStats

other-modules: Paths_locli

Expand All @@ -44,14 +46,15 @@ library
, bytestring
, cardano-config
, cardano-prelude
, iohk-monitoring
, cardano-slotting
, containers
, deepseq
, directory
, filepath
, file-embed
, gnuplot
, Histogram
, iohk-monitoring
, optparse-applicative-fork
, optparse-generic
, ouroboros-network
Expand All @@ -64,16 +67,33 @@ library
, text
, text-short
, time
, trace-resources
, transformers
, transformers-except
, unordered-containers
, utf8-string
, vector

default-language: Haskell2010
default-extensions: NoImplicitPrelude
default-extensions: BangPatterns
BlockArguments
DerivingStrategies
DerivingVia
FlexibleContexts
FlexibleInstances
GADTs
ImportQualifiedPost
LambdaCase
NamedFieldPuns
NoImplicitPrelude
OverloadedStrings
PartialTypeSignatures
RankNTypes
RecordWildCards
ScopedTypeVariables
StandaloneDeriving
TupleSections
TypeApplications

ghc-options: -Wall
-Wincomplete-record-updates
Expand All @@ -90,7 +110,7 @@ executable locli
ghc-options: -threaded
-Wall
-rtsopts
"-with-rtsopts=-T -N4 -A8m"
"-with-rtsopts=-T -N7 -A2m -qb -H64m"
build-depends: base
, cardano-prelude
, locli
Expand Down

0 comments on commit 42582c8

Please sign in to comment.