Skip to content

Commit

Permalink
Merge pull request #8 from BCWResearch/automated-test
Browse files Browse the repository at this point in the history
add folder paths to csv generation
  • Loading branch information
patrick-bcw authored Jul 2, 2024
2 parents f08d749 + 038327f commit 20e9913
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,6 @@ jobs:
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
GCP_WORKLOAD_IDENTITY_ID: ${{ secrets.GCP_WORKLOAD_IDENTITY_ID }}
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}
ENVIRONMENT: production
run: >
./tools/run-benchmark.sh ${{ inputs.machine_type }} ${{ inputs.num_workers }} ${{ inputs.cpu_request }} ${{ inputs.cpu_limit }} ${{ inputs.memory }} ${{ inputs.memory }} ${{ inputs.block_start }} ${{ inputs.block_end }} ${{ inputs.other_args }} ${{ inputs.rpc_endpoint }}
7 changes: 6 additions & 1 deletion tools/run-benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ NUM_WORKERS_LIMIT=200
IMX_RPC="http://35.208.84.178:8545"
INTERNAL_RPC="http://35.208.68.173:8545"
RPC_ADDRESS=""
SUBFOLDER_NAME=""
ENVIRONMENT="${ENVIRONMENT:-test}"

# parameters
machine_type=$1
Expand Down Expand Up @@ -60,8 +62,10 @@ fi

if [[ $RPC_ENDPOINT == "IMX_RPC" ]]; then
RPC_ADDRESS=$IMX_RPC
SUBFOLDER_NAME="external"
elif [[ $RPC_ENDPOINT == "INTERNAL_RPC" ]]; then
RPC_ADDRESS=$INTERNAL_RPC
SUBFOLDER_NAME="internal"
else
echo "error: Wrong RPC endpoint" >&2; exit 1
fi
Expand Down Expand Up @@ -183,8 +187,9 @@ done
######################

# Build out the request parameters
folder_name=$(printf "%s/%s" "$ENVIRONMENT" "$SUBFOLDER_NAME")
csv_file_name=$(printf "%s.%s.%s.%s.%s.%scpu.%sworkers.csv" "$other_args" "$block_start" "$block_end" "$machine_type" "$CPU_PLATFORM" "$cpu_request" "$num_workers")
post_body=$(printf '{"block_interval":"%s..=%s","block_source":{"ZeroBinRpc":{"rpc_url":"%s"}},"benchmark_output":{"GoogleCloudStorageCsv":{"file_name":"%s","bucket":"zkevm-csv"}}}' "$block_start" "$block_end" "$RPC_ADDRESS" "$csv_file_name")
post_body=$(printf '{"block_interval":"%s..=%s","block_source":{"ZeroBinRpc":{"rpc_url":"%s"}},"benchmark_output":{"GoogleCloudStorageCsv":{"file_name":"%s/%s","bucket":"zkevm-csv"}}}' "$block_start" "$block_end" "$RPC_ADDRESS" "$folder_name" "$csv_file_name")

# Run the benchmark test
echo "Triggering benchmark test..."
Expand Down

0 comments on commit 20e9913

Please sign in to comment.