From f9a870c05203fa534ae23ab012bb9168baae4242 Mon Sep 17 00:00:00 2001 From: Jeffrey Tang Date: Fri, 10 Jan 2025 13:53:30 -0600 Subject: [PATCH 1/7] add nohup Signed-off-by: Jeffrey Tang --- .github/workflows/script/solo_smoke_test.sh | 5 ----- Taskfile.helper.yml | 8 ++++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/script/solo_smoke_test.sh b/.github/workflows/script/solo_smoke_test.sh index 199d714a4..557ef372a 100755 --- a/.github/workflows/script/solo_smoke_test.sh +++ b/.github/workflows/script/solo_smoke_test.sh @@ -83,11 +83,6 @@ function start_sdk_test () return $result } -echo "Restart port-forward" -task clean:port-forward -enable_port_forward - - echo "Change to parent directory" cd ../ create_test_account diff --git a/Taskfile.helper.yml b/Taskfile.helper.yml index b358f6f84..aea54846a 100644 --- a/Taskfile.helper.yml +++ b/Taskfile.helper.yml @@ -201,7 +201,7 @@ tasks: - | if [[ "{{ .use_port_forwards }}" == "true" ]];then echo "Enable port forwarding for Hedera Node" - kubectl port-forward -n "${SOLO_NAMESPACE}" svc/haproxy-node1-svc 50211:50211 & + nohup kubectl port-forward -v=9 -n "${SOLO_NAMESPACE}" svc/haproxy-node1-svc 50211:50211 > test1.log 2>&1 & sleep 4 fi @@ -221,7 +221,7 @@ tasks: - | if [[ "{{ .use_port_forwards }}" == "true" ]];then echo "Enable port forwarding for Hedera JSON RPC Relay" - kubectl port-forward -n "${SOLO_NAMESPACE}" svc/relay-node1-hedera-json-rpc-relay 7546:7546 & + nohup kubectl port-forward -v=9 -n "${SOLO_NAMESPACE}" svc/relay-node1-hedera-json-rpc-relay 7546:7546 > test2.log 2>&1 & sleep 4 fi @@ -391,8 +391,8 @@ tasks: - | if [[ "{{ .use_port_forwards }}" == "true" ]];then echo "Enable port forwarding for Hedera Explorer & Mirror Node Network" - kubectl port-forward -n "${SOLO_NAMESPACE}" svc/hedera-explorer 8080:80 & - kubectl port-forward svc/mirror-grpc -n "${SOLO_NAMESPACE}" 5600:5600 & + nohup kubectl port-forward -v=9 -n "${SOLO_NAMESPACE}" svc/hedera-explorer 8080:80 > test3.log 2>&1 & + nohup kubectl port-forward -v=9 svc/mirror-grpc -n "${SOLO_NAMESPACE}" 5600:5600 > test4.log 2>&1 & sleep 4 fi From e9a2326b7223c5d193c06f501c484f896cce9b85 Mon Sep 17 00:00:00 2001 From: Jeffrey Tang Date: Fri, 10 Jan 2025 14:36:15 -0600 Subject: [PATCH 2/7] check port-foward Signed-off-by: Jeffrey Tang --- .github/workflows/script/solo_smoke_test.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/script/solo_smoke_test.sh b/.github/workflows/script/solo_smoke_test.sh index 557ef372a..d81b06f4d 100755 --- a/.github/workflows/script/solo_smoke_test.sh +++ b/.github/workflows/script/solo_smoke_test.sh @@ -50,6 +50,17 @@ function setup_smart_contract_test () cd - } +function check_port_forward () +{ + # run background task for few minutes + for i in {1..20} + do + echo "Check port forward" + ps -ef |grep port-forward + sleep 5 + done & +} + function start_background_transactions () { echo "Start background transaction" @@ -89,6 +100,7 @@ create_test_account clone_smart_contract_repo setup_smart_contract_test start_background_transactions +check_port_forward start_contract_test start_sdk_test echo "Sleep a while to wait background transactions to finish" From 135a4f03115e247e2dbb918e3a5726a65596ad2d Mon Sep 17 00:00:00 2001 From: Jeffrey Tang Date: Fri, 10 Jan 2025 16:22:31 -0600 Subject: [PATCH 3/7] save Signed-off-by: Jeffrey Tang --- Taskfile.helper.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Taskfile.helper.yml b/Taskfile.helper.yml index aea54846a..3ac5aa100 100644 --- a/Taskfile.helper.yml +++ b/Taskfile.helper.yml @@ -192,6 +192,7 @@ tasks: internal: true deps: - task: "init" + async: true cmds: - | if [[ "${DEBUG_NODE_ALIAS}" != "" ]]; then @@ -216,6 +217,7 @@ tasks: solo:relay: deps: - task: "init" + async: true cmds: - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- relay deploy -n "${SOLO_NAMESPACE}" -i node1 -q - | @@ -232,7 +234,7 @@ tasks: deps: - task: "init" cmds: - - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- relay destroy -n "${SOLO_NAMESPACE}" -i node1 -q + - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- relay destroy -n "${SOLO_NAMESPACE}" -i node1 solo:cache:remove: silent: true @@ -386,6 +388,7 @@ tasks: desc: solo mirror-node deploy with port forward on explorer deps: - task: "init" + async: true cmds: - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- mirror-node deploy --namespace "${SOLO_NAMESPACE}" -q - | @@ -404,7 +407,7 @@ tasks: deps: - task: "init" cmds: - - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- mirror-node destroy --namespace "${SOLO_NAMESPACE}" --force -q || true + - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- mirror-node destroy --namespace "${SOLO_NAMESPACE}" --force || true clean: desc: destroy, then remove cache directory, logs directory, config, and port forwards From f263913bad837f32dc0d04ece366e5a462927c56 Mon Sep 17 00:00:00 2001 From: Jeffrey Tang Date: Mon, 13 Jan 2025 11:55:27 -0600 Subject: [PATCH 4/7] save Signed-off-by: Jeffrey Tang --- Taskfile.helper.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Taskfile.helper.yml b/Taskfile.helper.yml index 3ac5aa100..25b2d9716 100644 --- a/Taskfile.helper.yml +++ b/Taskfile.helper.yml @@ -202,7 +202,7 @@ tasks: - | if [[ "{{ .use_port_forwards }}" == "true" ]];then echo "Enable port forwarding for Hedera Node" - nohup kubectl port-forward -v=9 -n "${SOLO_NAMESPACE}" svc/haproxy-node1-svc 50211:50211 > test1.log 2>&1 & + /bin/bash -c "nohup kubectl port-forward -v=9 -n \"${SOLO_NAMESPACE}\" svc/haproxy-node1-svc 50211:50211 > /dev/null 2>&1 &" sleep 4 fi @@ -223,7 +223,7 @@ tasks: - | if [[ "{{ .use_port_forwards }}" == "true" ]];then echo "Enable port forwarding for Hedera JSON RPC Relay" - nohup kubectl port-forward -v=9 -n "${SOLO_NAMESPACE}" svc/relay-node1-hedera-json-rpc-relay 7546:7546 > test2.log 2>&1 & + /bin/bash -c "nohup kubectl port-forward -v=9 -n \"${SOLO_NAMESPACE}\" svc/relay-node1-hedera-json-rpc-relay 7546:7546 > /dev/null 2>&1 &" sleep 4 fi @@ -394,8 +394,8 @@ tasks: - | if [[ "{{ .use_port_forwards }}" == "true" ]];then echo "Enable port forwarding for Hedera Explorer & Mirror Node Network" - nohup kubectl port-forward -v=9 -n "${SOLO_NAMESPACE}" svc/hedera-explorer 8080:80 > test3.log 2>&1 & - nohup kubectl port-forward -v=9 svc/mirror-grpc -n "${SOLO_NAMESPACE}" 5600:5600 > test4.log 2>&1 & + /bin/bash -c "nohup kubectl port-forward -v=9 -n \"${SOLO_NAMESPACE}\" svc/hedera-explorer 8080:80 > /dev/null 2>&1 &" + /bin/bash -c "nohup kubectl port-forward -v=9 -n \"${SOLO_NAMESPACE}\" svc/mirror-grpc 5600:5600 > /dev/null 2>&1 &" sleep 4 fi From 3c087e244cffc04f9ee74a2007a90a6c0d9f3caa Mon Sep 17 00:00:00 2001 From: Jeffrey Tang Date: Mon, 13 Jan 2025 13:31:56 -0600 Subject: [PATCH 5/7] remove async Signed-off-by: Jeffrey Tang --- Taskfile.helper.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Taskfile.helper.yml b/Taskfile.helper.yml index 2bed12bdd..04d99450c 100644 --- a/Taskfile.helper.yml +++ b/Taskfile.helper.yml @@ -213,7 +213,6 @@ tasks: internal: true deps: - task: "init" - async: true cmds: - | if [[ "${DEBUG_NODE_ALIAS}" != "" ]]; then @@ -240,7 +239,6 @@ tasks: silent: true deps: - task: "init" - async: true cmds: - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- relay deploy -n "${SOLO_NAMESPACE}" -i node1 ${RELAY_NODE_DEPLOY_EXTRA_FLAGS} -q --dev - | @@ -258,7 +256,7 @@ tasks: deps: - task: "init" cmds: - - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- relay destroy -n "${SOLO_NAMESPACE}" -i node1 + - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- relay destroy -n "${SOLO_NAMESPACE}" -i node1 --dev solo:cache:remove: silent: true @@ -421,7 +419,6 @@ tasks: desc: solo mirror-node deploy with port forward on explorer deps: - task: "init" - async: true cmds: - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- mirror-node deploy --namespace "${SOLO_NAMESPACE}" -s ${SOLO_CLUSTER_SETUP_NAMESPACE} ${SOLO_CHARTS_DIR_FLAG} ${ENABLE_EXPLORER_TLS_FLAG} ${TLS_CLUSTER_ISSUER_TYPE_FLAG} ${MIRROR_NODE_DEPLOY_EXTRA_FLAGS} --pinger -q --dev - | @@ -444,7 +441,7 @@ tasks: deps: - task: "init" cmds: - - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- mirror-node destroy --namespace "${SOLO_NAMESPACE}" --force || true + - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- mirror-node destroy --namespace "${SOLO_NAMESPACE}" --force --dev || true clean: desc: destroy, then remove cache directory, logs directory, config, and port forwards From 2b082944159820e3bd3183729d06d9c51f6b96f5 Mon Sep 17 00:00:00 2001 From: Jeffrey Tang Date: Mon, 13 Jan 2025 13:55:01 -0600 Subject: [PATCH 6/7] remove unused Signed-off-by: Jeffrey Tang --- .github/workflows/script/solo_smoke_test.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/script/solo_smoke_test.sh b/.github/workflows/script/solo_smoke_test.sh index d81b06f4d..401e39e60 100755 --- a/.github/workflows/script/solo_smoke_test.sh +++ b/.github/workflows/script/solo_smoke_test.sh @@ -11,14 +11,6 @@ set -eo pipefail source .github/workflows/script/helper.sh -function enable_port_forward () -{ - kubectl port-forward -n solo-e2e svc/haproxy-node1-svc 50211:50211 > /dev/null 2>&1 & - kubectl port-forward -n solo-e2e svc/hedera-explorer 8080:80 > /dev/null 2>&1 & - kubectl port-forward -n solo-e2e svc/relay-node1-hedera-json-rpc-relay 7546:7546 > /dev/null 2>&1 & - kubectl port-forward -n solo-e2e svc/mirror-grpc 5600:5600 > /dev/null 2>&1 & -} - function clone_smart_contract_repo () { echo "Clone hedera-smart-contracts" From 6054f1536dda10a3679c4f73ffa1091275365a18 Mon Sep 17 00:00:00 2001 From: Jeffrey Tang Date: Tue, 14 Jan 2025 11:40:05 -0600 Subject: [PATCH 7/7] add quiet flag Signed-off-by: Jeffrey Tang --- Taskfile.helper.yml | 4 ++-- src/commands/mirror_node.ts | 2 +- src/commands/relay.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Taskfile.helper.yml b/Taskfile.helper.yml index 04d99450c..8b7dcdccd 100644 --- a/Taskfile.helper.yml +++ b/Taskfile.helper.yml @@ -256,7 +256,7 @@ tasks: deps: - task: "init" cmds: - - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- relay destroy -n "${SOLO_NAMESPACE}" -i node1 --dev + - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- relay destroy -n "${SOLO_NAMESPACE}" -i node1 -q --dev solo:cache:remove: silent: true @@ -441,7 +441,7 @@ tasks: deps: - task: "init" cmds: - - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- mirror-node destroy --namespace "${SOLO_NAMESPACE}" --force --dev || true + - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- mirror-node destroy --namespace "${SOLO_NAMESPACE}" --force -q --dev || true clean: desc: destroy, then remove cache directory, logs directory, config, and port forwards diff --git a/src/commands/mirror_node.ts b/src/commands/mirror_node.ts index c27789c8a..51dbf9a87 100644 --- a/src/commands/mirror_node.ts +++ b/src/commands/mirror_node.ts @@ -675,7 +675,7 @@ export class MirrorNodeCommand extends BaseCommand { .command({ command: 'destroy', desc: 'Destroy mirror-node components and database', - builder: y => flags.setCommandFlags(y, flags.chartDirectory, flags.force, flags.namespace), + builder: y => flags.setCommandFlags(y, flags.chartDirectory, flags.force, flags.quiet, flags.namespace), handler: argv => { self.logger.info("==== Running 'mirror-node destroy' ==="); self.logger.info(argv); diff --git a/src/commands/relay.ts b/src/commands/relay.ts index ede47a104..5754984f4 100644 --- a/src/commands/relay.ts +++ b/src/commands/relay.ts @@ -418,7 +418,7 @@ export class RelayCommand extends BaseCommand { command: 'destroy', desc: 'Destroy JSON RPC relay', builder: (y: any) => - flags.setCommandFlags(y, flags.chartDirectory, flags.namespace, flags.nodeAliasesUnparsed), + flags.setCommandFlags(y, flags.chartDirectory, flags.namespace, flags.quiet, flags.nodeAliasesUnparsed), handler: (argv: any) => { self.logger.info("==== Running 'relay destroy' ===", {argv}); self.logger.debug(argv);