Run benchmark test #127
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run benchmark test | |
on: | |
workflow_dispatch: | |
inputs: | |
machine_type: | |
description: 'The GCE machine type. (See docs for complete list of machine types https://cloud.google.com/compute/docs/general-purpose-machines)' | |
default: 't2d-standard-60' | |
type: string | |
num_workers: | |
description: 'Number of zero-bin workers' | |
default: '100' | |
required: true | |
type: string | |
cpu_request: | |
description: 'The CPU request set for the workers' | |
default: '11' | |
required: true | |
type: string | |
cpu_limit: | |
description: 'The CPU limit set for the workers' | |
default: '11' | |
required: true | |
type: string | |
memory: | |
description: 'The memory set for the workers' | |
default: '60Gi' | |
required: false | |
type: string | |
block_range: | |
description: 'A comma separated values for the block range start and end to prove, in the following format "block_start,block_end". (Set to the same values to only prove 1 block)' | |
required: true | |
default: '100,101' | |
type: string | |
prover_configs: | |
description: 'A comma separated values for additional configs for the proving, in the following format "batch_size,cpu_cycles".' | |
default: '10,19' | |
type: string | |
other_args: | |
description: 'Other text to append into the generated CSV file' | |
required: true | |
type: string | |
rpc_endpoint: | |
description: 'The RPC endpoint zero-bin will use' | |
required: false | |
default: 'IMX_RPC' | |
type: choice | |
options: | |
- IMX_RPC | |
- INTERNAL_RPC | |
jobs: | |
test: | |
name: Run benchmarks tests | |
runs-on: ubuntu-latest | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Authenticate to Google Cloud | |
id: auth | |
uses: google-github-actions/auth@v2 | |
with: | |
project_id: ${{ secrets.GCP_PROJECT_ID }} | |
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_ID }} | |
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} | |
- name: Set up Google Cloud SDK | |
uses: google-github-actions/setup-gcloud@v1 | |
- name: Get GKE credentials | |
id: 'get-credentials' | |
uses: 'google-github-actions/get-gke-credentials@v2' | |
with: | |
cluster_name: 'immutable-prod' | |
location: 'us-central1' | |
- name: Run benchmark script | |
env: | |
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: |- | |
IFS=',' read -r block_start block_end <<< ${{ inputs.block_range }} | |
IFS=',' read -r batch_size cpu_cycles <<< ${{ inputs.prover_configs }} | |
echo "block_start: $block_start" | |
echo "block_end: $block_end" | |
echo "batch_size: $batch_size" | |
echo "cpu_cycles: $cpu_cycles" | |
./tools/run-benchmark.sh ${{ inputs.machine_type }} ${{ inputs.num_workers }} ${{ inputs.cpu_request }} ${{ inputs.cpu_limit }} ${{ inputs.memory }} ${{ inputs.memory }} $block_start $block_end ${{ inputs.other_args }} ${{ inputs.rpc_endpoint }} $batch_size $cpu_cycles |