eth2_network_simulation: propagate LOG_LEVEL [skip ci]

also add a "--log-level" option to launch_local_testnet.sh
This commit is contained in:
Ștefan Talpalaru 2020-03-09 01:32:58 +01:00
parent 1f1f06e8d9
commit 929fcf0036
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9
4 changed files with 16 additions and 4 deletions

View File

@ -121,7 +121,7 @@ clean_eth2_network_simulation_files:
rm -rf tests/simulation/{data,validators}
eth2_network_simulation: | build deps p2pd clean_eth2_network_simulation_files process_dashboard
+ GIT_ROOT="$$PWD" NIMFLAGS="$(NIMFLAGS)" tests/simulation/start.sh
+ GIT_ROOT="$$PWD" NIMFLAGS="$(NIMFLAGS)" LOG_LEVEL="$(LOG_LEVEL)" tests/simulation/start.sh
clean-testnet0:
rm -rf build/data/testnet0

View File

@ -24,13 +24,14 @@ if [ ${PIPESTATUS[0]} != 4 ]; then
fi
OPTS="ht:n:d:"
LONGOPTS="help,testnet:,nodes:,data-dir:,disable-htop"
LONGOPTS="help,testnet:,nodes:,data-dir:,disable-htop,log-level:"
# default values
TESTNET="1"
NUM_NODES="10"
DATA_DIR="local_testnet_data"
USE_HTOP="1"
LOG_LEVEL="DEBUG"
print_help() {
cat <<EOF
@ -44,6 +45,7 @@ CI run: $(basename $0) --disable-htop -- --verify-finalization --stop-at-epoch=5
-d, --data-dir directory where all the node data and logs will end up
(default: "${DATA_DIR}")
--disable-htop don't use "htop" to see the beacon_node processes
--log-level set the log level (default: ${LOG_LEVEL})
EOF
}
@ -77,6 +79,10 @@ while true; do
USE_HTOP="0"
shift
;;
--log-level)
LOG_LEVEL="$2"
shift 2
;;
--)
shift
break
@ -113,7 +119,7 @@ else
fi
NETWORK_NIM_FLAGS=$(scripts/load-testnet-nim-flags.sh ${NETWORK})
$MAKE LOG_LEVEL=DEBUG NIMFLAGS="-d:insecure -d:testnet_servers_image ${NETWORK_NIM_FLAGS}" beacon_node
$MAKE LOG_LEVEL="${LOG_LEVEL}" NIMFLAGS="-d:insecure -d:testnet_servers_image ${NETWORK_NIM_FLAGS}" beacon_node
rm -rf "${DEPOSITS_DIR}"
./build/beacon_node makeDeposits \
@ -172,7 +178,7 @@ for NUM_NODE in $(seq 0 $(( ${NUM_NODES} - 1 ))); do
stdbuf -o0 build/beacon_node \
--nat=none \
--log-level=TRACE \
--log-level="${LOG_LEVEL}" \
--tcp-port=$(( ${BOOTSTRAP_PORT} + ${NUM_NODE} )) \
--udp-port=$(( ${BOOTSTRAP_PORT} + ${NUM_NODE} )) \
--data-dir="${NODE_DATA_DIR}" \

View File

@ -54,6 +54,7 @@ fi
# if you want tracing messages, add "--log-level=TRACE" below
cd "$DATA_DIR" && $NODE_BIN \
--log-level=${LOG_LEVEL:-DEBUG} \
--bootstrap-file=$BOOTSTRAP_ADDRESS_FILE \
--data-dir=$DATA_DIR \
--node-name=$NODE_ID \

View File

@ -120,6 +120,11 @@ fi
--in="${SIM_ROOT}/beacon-chain-sim-node0-Grafana-dashboard.json" \
--out="${SIM_ROOT}/beacon-chain-sim-all-nodes-Grafana-dashboard.json"
# propagate the log level
if [[ -n "${LOG_LEVEL}" ]]; then
export LOG_LEVEL="${LOG_LEVEL}"
fi
# Kill child processes on Ctrl-C by sending SIGTERM to the whole process group,
# passing the negative PID of this shell instance to the "kill" command.
# Trap and ignore SIGTERM, so we don't kill this process along with its children.