Skip to content

Commit

Permalink
adapted CI job
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Diemand <codieplusplus@apax.net>
  • Loading branch information
CodiePP committed Jan 17, 2020
1 parent 715697d commit 979310f
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 9 deletions.
11 changes: 7 additions & 4 deletions benchmarking/chain-sync/analyse-logs.sh
Expand Up @@ -2,13 +2,16 @@

# get first block copy time
LOGFILE=`ls -1 state-node-mainnet/node-0-*.log | head -3`
FIRSTSLOT=`grep -e '.*:cardano.node.ChainDB:.*TraceCopyToImmDBEvent.CopiedBlockToImmDB.*"tip":"[a-z0-9]*@' $LOGFILE | sed -ne 's/^.* \[\([0-9-]\+\) \([0-9:.]\+\) UTC\] .*"tip":"[a-z0-9]*@\([0-9]\+\)".*/\1 \2\t\3/p; q;'`
FIRSTSLOT=`grep -e '.*:cardano.node.ChainDB:.*TraceCopyToImmDBEvent.CopiedBlockToImmDB.*"tip":"[a-z0-9]*@' $LOGFILE | sed -ne 's/^.* \[\([0-9-]\+\) \([0-9:.]\+\) UTC\] .*"tip":"[a-z0-9]*@\([0-9]\+\)".*/"\1 \2";\3/p; q;'`

LOGFILE=`ls -1r state-node-mainnet/node-0-*.log | head -1`
LASTSLOT=`grep -e '.*:cardano.node.ChainDB:.*TraceCopyToImmDBEvent.CopiedBlockToImmDB.*"tip":"[a-z0-9]*@' $LOGFILE | sed -ne 's/^.* \[\([0-9-]\+\) \([0-9:.]\+\) UTC\] .*"tip":"[a-z0-9]*@\([0-9]\+\)".*/\1 \2\t\3/p;' | tail -n 1`
LASTSLOT=`grep -e '.*:cardano.node.ChainDB:.*TraceCopyToImmDBEvent.CopiedBlockToImmDB.*"tip":"[a-z0-9]*@' $LOGFILE | sed -ne 's/^.* \[\([0-9-]\+\) \([0-9:.]\+\) UTC\] .*"tip":"[a-z0-9]*@\([0-9]\+\)".*/"\1 \2";\3/p;' | tail -n 1`
LASTRSS=`grep -e '.*cardano.node-metrics:.*Mem.resident =' $LOGFILE | sed -ne 's/^.* \[\([0-9-]\+\) \([0-9:.]\+\) UTC\] .*Mem.resident = \([0-9]\+\).*/\1 \2\t\3/p;' | { read a b c; while [ -n "$a" ]; do echo "\"$a $b\";$((c*4096))"; read a b c; done; } | tail -n 1`

# output git revision
echo -n "commit;"
git log | head -1 | cut -d ' ' -f 2
echo $FIRSTSLOT
echo $LASTSLOT
echo -n "slotfirst;"; echo $FIRSTSLOT
echo -n "slotlast;"; echo $LASTSLOT
echo -n "memorylast;"; echo $LASTRSS

8 changes: 3 additions & 5 deletions benchmarking/chain-sync/ci.sh
Expand Up @@ -6,20 +6,18 @@ set -euo pipefail
BASEDIR="$(dirname $0)"

# >> cpu time limit in seconds
CPU_TIME_LIMIT=$((1*60*60))
TIME_LIMIT=$((60*60))

CLUSTER="$1"

LOG_CONFIG="$(yj < $BASEDIR/configuration/log-configuration.yaml)"
LOG_CONFIG="$(yj < $BASEDIR/configuration/log-config-ci.yaml)"

CUSTOM_CONFIG="{nodeConfig = builtins.fromJSON ''$LOG_CONFIG'';}"

nix build --out-link ./launch_node -f $BASEDIR/../.. scripts.$CLUSTER.node --arg customConfig "$CUSTOM_CONFIG"

rm -rf "./state-node-$CLUSTER"

ulimit -t $CPU_TIME_LIMIT

./launch_node || true
timeout ${TIME_LIMIT} ./launch_node || true

$BASEDIR/analyse-logs.sh | tee benchmark-results.log
96 changes: 96 additions & 0 deletions benchmarking/chain-sync/configuration/log-config-ci.yaml
@@ -0,0 +1,96 @@
# global filter; messages must have at least this severity to pass:
minSeverity: Notice

# global file rotation settings:
rotation:
rpLogLimitBytes: 50000000
rpKeepFilesNum: 100
rpMaxAgeHours: 24

# these backends are initialized:
setupBackends:
- KatipBK

# if not indicated otherwise, then messages are passed to these backends:
defaultBackends:
- KatipBK

# here we set up outputs of logging in 'katip':
setupScribes:
- scKind: FileSK
scName: "node-0.log"
scFormat: ScText

# if not indicated otherwise, then log output is directed to this:
defaultScribes:
- - FileSK
- "node-0.log"

# more options which can be passed as key-value pairs:
options:
cfokey:
value: "Release-1.0.0"
mapSubtrace:
benchmark:
contents:
- GhcRtsStats
- MonotonicClock
subtrace: ObservableTrace
'#ekgview':
contents:
- - tag: Contains
contents: 'cardano.epoch-validation.benchmark'
- - tag: Contains
contents: .monoclock.basic.
- - tag: Contains
contents: 'cardano.epoch-validation.benchmark'
- - tag: Contains
contents: diff.RTS.cpuNs.timed.
- - tag: StartsWith
contents: '#ekgview.#aggregation.cardano.epoch-validation.benchmark'
- - tag: Contains
contents: diff.RTS.gcNum.timed.
subtrace: FilterTrace
'cardano.epoch-validation.utxo-stats':
# Change the `subtrace` value to `Neutral` in order to log
# `UTxO`-related messages during epoch validation.
subtrace: NoTrace
cardano.node-metrics:
subtrace: Neutral
mapBackends:
cardano.epoch-validation.benchmark:
- AggregationBK
'cardano.node.peers.BlockFetchDecision':
- EKGViewBK
- kind: UserDefinedBK
name: LiveViewBackend
'cardano.node.ChainDB':
- KatipBK
- kind: UserDefinedBK
name: LiveViewBackend
cardano.node.metrics:
- EKGViewBK
- kind: UserDefinedBK
name: LiveViewBackend
##########################################################
############### Cardano Node Configuration ###############
##########################################################


NodeId: 0
Protocol: RealPBFT
NumCoreNodes: 1
RequiresNetworkMagic: RequiresNoMagic
PBftSignatureThreshold: 0.5
TurnOnLogging: True
ViewMode: SimpleView
TurnOnLogMetrics: True


##### Update Parameters #####

ApplicationName: cardano-sl
ApplicationVersion: 1
LastKnownBlockVersion-Major: 0
LastKnownBlockVersion-Minor: 2
LastKnownBlockVersion-Alt: 0

0 comments on commit 979310f

Please sign in to comment.