Skip to content

Commit

Permalink
refactor(tools/ci) reduce example networks log verbosity (hyperledger…
Browse files Browse the repository at this point in the history
…-cacti#74)

* refactor(examples): quorum network log verbosity=2

Previous value was 5, very verbose.

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>

* refactor(quorum): tessera -Dverbosity=WARN

Reduces log level of Tessera to WARN from INFO

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>

* fix(quorum): etcd image version and log verbosity

Log verbosity doesn't yet actually get reduced, follow
this issue for further developments:
etcd-io/etcd#11407

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>

* refactor(examples): FABRIC_LOGGING_SPEC=INFO

Reduces the log level to INFO from DEBUG in Fabric peers

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>

* refactor(ci): add log dumping back in

Which is now much less verbose and easier to handle after
reducing the log levels.

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>

* refactor(examples): reduce log verbosity on fabric

This adds what the previous commit was missing: orderer and ca

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>

* fix(ci): set +u to avoid undefined var crash

[ "$CI_NO_DUMP_ALL_LOGS" ] || ./tools/dump-all-logs.sh $CI_ROOT_DIR
Was crashing the CI because +e only applies to return codes of
shell commands while the +u option is needed to avoid crashing
the script when there was an undefined variable referenced.

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz authored Dec 4, 2019
1 parent f20a5ad commit 5dc1de6
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
# bridge network as the peers
# https://docs.docker.com/compose/networking/
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=artifacts_default
- FABRIC_LOGGING_SPEC=DEBUG
- FABRIC_LOGGING_SPEC=INFO
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
# The following setting skips the gossip handshake since we are
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
ca.org1.example.com:
image: hyperledger/fabric-ca:1.4.0
environment:
- FABRIC_LOGGING_SPEC=INFO
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca-org1
- FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
Expand All @@ -27,6 +28,7 @@ services:
ca.org2.example.com:
image: hyperledger/fabric-ca:1.4.0
environment:
- FABRIC_LOGGING_SPEC=INFO
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca-org2
- FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem
Expand All @@ -45,7 +47,7 @@ services:
container_name: orderer.example.com
image: hyperledger/fabric-orderer:1.4.0
environment:
- FABRIC_LOGGING_SPEC=debug
- FABRIC_LOGGING_SPEC=INFO
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/genesis.block
Expand Down Expand Up @@ -74,7 +76,7 @@ services:
- CORE_PEER_ID=peer0.org1.example.com
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org1.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org1.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
ports:
- 7051:7051
Expand All @@ -93,7 +95,7 @@ services:
- CORE_PEER_ID=peer1.org1.example.com
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_ADDRESS=peer1.org1.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051
ports:
- 7056:7051
Expand All @@ -112,7 +114,7 @@ services:
- CORE_PEER_ID=peer0.org2.example.com
- CORE_PEER_LOCALMSPID=Org2MSP
- CORE_PEER_ADDRESS=peer0.org2.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org2.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org2.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051
ports:
- 8051:7051
Expand All @@ -131,7 +133,7 @@ services:
- CORE_PEER_ID=peer1.org2.example.com
- CORE_PEER_LOCALMSPID=Org2MSP
- CORE_PEER_ADDRESS=peer1.org2.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org2.example.com:7051
ports:
- 8056:7051
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ services:
- etcd3

etcd1:
image: bitnami/etcd:3
image: bitnami/etcd:3.4.3
environment:
- ALLOW_NONE_AUTHENTICATION=yes
- ETCD_NAME=etcd1
Expand All @@ -133,12 +133,14 @@ services:
- ETCD_INITIAL_CLUSTER_TOKEN=etcd-cluster
- ETCD_INITIAL_CLUSTER=etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380
- ETCD_INITIAL_CLUSTER_STATE=new
- ETCD_LOG_LEVEL=warn
- ETCD_LOG_PACKAGE_LEVELS=raft=warn
networks:
quorum-network:
ipv4_address: 192.20.0.50

etcd2:
image: bitnami/etcd:3
image: bitnami/etcd:3.4.3
environment:
- ALLOW_NONE_AUTHENTICATION=yes
- ETCD_NAME=etcd2
Expand All @@ -149,12 +151,14 @@ services:
- ETCD_INITIAL_CLUSTER_TOKEN=etcd-cluster
- ETCD_INITIAL_CLUSTER=etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380
- ETCD_INITIAL_CLUSTER_STATE=new
- ETCD_LOG_LEVEL=warn
- ETCD_LOG_PACKAGE_LEVELS=raft=warn
networks:
quorum-network:
ipv4_address: 192.20.0.51

etcd3:
image: bitnami/etcd:3
image: bitnami/etcd:3.4.3
environment:
- ALLOW_NONE_AUTHENTICATION=yes
- ETCD_NAME=etcd3
Expand All @@ -165,6 +169,8 @@ services:
- ETCD_INITIAL_CLUSTER_TOKEN=etcd-cluster
- ETCD_INITIAL_CLUSTER=etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380
- ETCD_INITIAL_CLUSTER_STATE=new
- ETCD_LOG_LEVEL=warn
- ETCD_LOG_PACKAGE_LEVELS=raft=warn
networks:
quorum-network:
ipv4_address: 192.20.0.52
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ x-quorum-def:
--datadir $${DDIR} \
--permissioned \
--nodiscover \
--verbosity 5 \
--verbosity 2 \
--networkid $${NETWORK_ID} \
--rpc \
--rpccorsdomain "*" \
Expand Down Expand Up @@ -175,7 +175,7 @@ x-tx-manager-def:
}
EOF
cat $${DDIR}/tessera-config$${TESSERA_CONFIG_TYPE}.json
java -Xms128M -Xmx128M -jar /tessera/tessera-app.jar -configfile $${DDIR}/tessera-config$${TESSERA_CONFIG_TYPE}.json
java -Xms128M -Xmx128M -Dverbosity=WARN -jar /tessera/tessera-app.jar -configfile $${DDIR}/tessera-config$${TESSERA_CONFIG_TYPE}.json
;;
constellation)
echo "socket=\"$${DDIR}/tm.ipc\"\npublickeys=[\"/examples/keys/tm$${NODE_ID}.pub\"]\n" > $${DDIR}/tm.conf
Expand Down
8 changes: 5 additions & 3 deletions packages/core/tools/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ function mainTask()
npm run scenario:FtQ
npm run test:bc

dumpAllLogs

npm run fed:quorum:down
npm run fed:fabric:down
npm run fabric:down
Expand All @@ -119,9 +121,9 @@ function mainTask()

function onTaskFailure()
{
set +e # do not crash process upon individual command failures
set +eu # do not crash process upon individual command failures

# dumpAllLogs
dumpAllLogs

ENDED_AT=`date +%s`
runtime=$((ENDED_AT-STARTED_AT))
Expand All @@ -131,7 +133,7 @@ function onTaskFailure()

function dumpAllLogs()
{
set +e # do not crash process upon individual command failures
set +eu # do not crash process upon individual command failures
cd "$PKG_ROOT_DIR" # switch back to the original root dir because we don't
# know where exactly the script crashed
[ "$CI_NO_DUMP_ALL_LOGS" ] || ./tools/dump-all-logs.sh $CI_ROOT_DIR
Expand Down

0 comments on commit 5dc1de6

Please sign in to comment.