From 82988dde54a567da79ef5d93fa192d26fc676864 Mon Sep 17 00:00:00 2001 From: ackintosh Date: Sat, 7 Jun 2025 21:30:37 +0900 Subject: [PATCH 1/2] Store logs to Kurtosis Files Artifacts --- scripts/local_testnet/stop_local_testnet.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/local_testnet/stop_local_testnet.sh b/scripts/local_testnet/stop_local_testnet.sh index 6af1989e9ff..08b3ef1402d 100755 --- a/scripts/local_testnet/stop_local_testnet.sh +++ b/scripts/local_testnet/stop_local_testnet.sh @@ -6,10 +6,21 @@ ENCLAVE_NAME=${1:-local-testnet} LOGS_PATH=$SCRIPT_DIR/logs LOGS_SUBDIR=$LOGS_PATH/$ENCLAVE_NAME +# Extract the service names of Lighthouse beacon nodes that start with "cl-". +services=$(kurtosis enclave inspect "$ENCLAVE_NAME" | awk '/^=+ User Services =+$/ { in_section=1; next } + /^=+/ { in_section=0 } + in_section && /^[0-9a-f]{12}/ { print $2 }' | grep '^cl-') + +# Store logs (including dependency logs) to Kurtosis Files Artifacts. These are downloaded locally by `kurtosis enclave dump`. +for service in $services; do + kurtosis files storeservice --name "$service-logs" local-testnet "$service" /data/lighthouse/beacon-data/beacon/logs/ +done + # Delete existing logs directory and make sure parent directory exists. rm -rf $LOGS_SUBDIR && mkdir -p $LOGS_PATH kurtosis enclave dump $ENCLAVE_NAME $LOGS_SUBDIR echo "Local testnet logs stored to $LOGS_SUBDIR." +echo "The lighthouse beacon nodes' logs (including dependency logs) can be found in $LOGS_SUBDIR/files/cl-*-lighthouse-geth-logs." kurtosis enclave rm -f $ENCLAVE_NAME kurtosis engine stop From cb9ee1af7d4572e8a74a58edeb271075a1174c30 Mon Sep 17 00:00:00 2001 From: ackintosh Date: Sun, 8 Jun 2025 06:26:07 +0900 Subject: [PATCH 2/2] Fix enclave name --- scripts/local_testnet/stop_local_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/local_testnet/stop_local_testnet.sh b/scripts/local_testnet/stop_local_testnet.sh index 08b3ef1402d..b90a8911548 100755 --- a/scripts/local_testnet/stop_local_testnet.sh +++ b/scripts/local_testnet/stop_local_testnet.sh @@ -13,7 +13,7 @@ services=$(kurtosis enclave inspect "$ENCLAVE_NAME" | awk '/^=+ User Services =+ # Store logs (including dependency logs) to Kurtosis Files Artifacts. These are downloaded locally by `kurtosis enclave dump`. for service in $services; do - kurtosis files storeservice --name "$service-logs" local-testnet "$service" /data/lighthouse/beacon-data/beacon/logs/ + kurtosis files storeservice --name "$service-logs" "$ENCLAVE_NAME" "$service" /data/lighthouse/beacon-data/beacon/logs/ done # Delete existing logs directory and make sure parent directory exists.