From 6868ebf364bf4903baa7a06547bd006a0dcf4d38 Mon Sep 17 00:00:00 2001 From: greg Date: Fri, 2 Feb 2024 16:31:50 +0000 Subject: [PATCH] add support for rpc client and tpu client on script/pod side --- .../src/scripts/client-startup-script.sh | 45 ++++++++----------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/k8s-cluster/src/scripts/client-startup-script.sh b/k8s-cluster/src/scripts/client-startup-script.sh index fc0a4795eb4687..5679350520d72f 100755 --- a/k8s-cluster/src/scripts/client-startup-script.sh +++ b/k8s-cluster/src/scripts/client-startup-script.sh @@ -12,31 +12,24 @@ if [[ "$benchTpsExtraArgs" == "thin-client" || "$benchTpsExtraArgs" == "tpu-clie else clientType="${3:-thin-client}" shift 3 + # Convert string to array + IFS=' ' read -r -a argsArray <<< "$benchTpsExtraArgs" + + # Initialize clientType with a default value + clientType="thin-client" + + # Loop through the array and check for the specific flag + for arg in "${argsArray[@]}"; do + if [ "$arg" == "--use-rpc-client" ]; then + clientType="rpc-client" + break + elif [ "$arg" == "--use-tpu-client" ]; then + clientType="tpu-client" + break + fi + done fi -runtime_args=() -while [[ -n $1 ]]; do - if [[ ${1:0:1} = - ]]; then - if [[ $1 = --target-node ]]; then - echo "WARNING: --target-node not supported yet...not included" - shift 2 - elif [[ $1 = --duration ]]; then - runtime_args+=("$1" "$2") - shift 2 - elif [[ $1 = --num-nodes ]]; then - runtime_args+=("$1" "$2") - shift 2 - else - echo "Unknown argument: $1" - solana-bench-tps --help - exit 1 - fi - else - echo "Unknown argument: $1" - solana-bench-tps --help - exit 1 - fi -done missing() { echo "Error: $1 not specified" @@ -76,11 +69,9 @@ bench-tps) args=() if ${TPU_CLIENT}; then - args+=(--use-tpu-client) - args+=(--url "$LOAD_BALANCER_RPC_ADDRESS") + args+=(--url "http://$LOAD_BALANCER_RPC_ADDRESS") elif ${RPC_CLIENT}; then - args+=(--use-rpc-client) - args+=(--url "$LOAD_BALANCER_RPC_ADDRESS") + args+=(--url "http://$LOAD_BALANCER_RPC_ADDRESS") else args+=(--entrypoint "$BOOTSTRAP_GOSSIP_ADDRESS") fi