diff --git a/.github/actions/rust-setup/action.yaml b/.github/actions/rust-setup/action.yaml index acc81bf4bf0be..7f1ef8416f9d7 100644 --- a/.github/actions/rust-setup/action.yaml +++ b/.github/actions/rust-setup/action.yaml @@ -26,7 +26,7 @@ runs: - name: install protoc and related tools shell: bash - run: scripts/dev_setup.sh -b -r -y -P -J -t + run: scripts/dev_setup.sh -b -r -y -P -J -t -k - run: echo "/home/runner/.cargo/bin" | tee -a $GITHUB_PATH shell: bash diff --git a/.github/runner-configs.json b/.github/runner-configs.json new file mode 100644 index 0000000000000..c20f860b72501 --- /dev/null +++ b/.github/runner-configs.json @@ -0,0 +1,75 @@ +{ + "benchmark-n4-32": { + "runner_name": "benchmark-n4-32", + "machine_type": "n4-standard-32", + "disk_size": 500, + "boot_disk_type": "hyperdisk-balanced" + }, + "benchmark-t2d-32": { + "runner_name": "benchmark-t2d-32", + "machine_type": "t2d-standard-32", + "disk_size": 500, + "boot_disk_type": "pd-ssd" + }, + "benchmark-t2d-60": { + "runner_name": "benchmark-t2d-60", + "machine_type": "t2d-standard-60", + "disk_size": 500, + "boot_disk_type": "pd-ssd" + }, + "benchmark-c3d-30": { + "runner_name": "benchmark-c3d-30", + "machine_type": "c3d-standard-30", + "disk_size": 500, + "boot_disk_type": "pd-ssd" + }, + "benchmark-c3d-60": { + "runner_name": "benchmark-c3d-60", + "machine_type": "c3d-standard-60", + "disk_size": 500, + "boot_disk_type": "pd-ssd" + }, + "benchmark-c3d-180": { + "runner_name": "benchmark-c3d-180", + "machine_type": "c3d-standard-180", + "disk_size": 500, + "boot_disk_type": "pd-ssd" + }, + "benchmark-c4-32": { + "runner_name": "benchmark-c4-32", + "machine_type": "c4-standard-32", + "disk_size": 500, + "boot_disk_type": "hyperdisk-balanced" + }, + "benchmark-c4-48": { + "runner_name": "benchmark-c4-48", + "machine_type": "c4-standard-48", + "disk_size": 500, + "boot_disk_type": "hyperdisk-balanced" + }, + "benchmark-c4-96": { + "runner_name": "benchmark-c4-96", + "machine_type": "c4-standard-96", + "disk_size": 500, + "boot_disk_type": "hyperdisk-balanced" + }, + "executor-benchmark-runner": { + "runner_name": "executor-benchmark-runner", + "machine_type": "t2d-standard-60", + "disk_size": 500, + "boot_disk_type": "pd-ssd" + }, + "executor-benchmark-ext4": { + "runner_name": "executor-benchmark-ext4", + "machine_type": "t2d-standard-60", + "disk_size": 500, + "boot_disk_type": "pd-ssd" + }, + "executor-benchmark-xfs": { + "runner_name": "executor-benchmark-xfs", + "machine_type": "t2d-standard-60", + "disk_size": 500, + "boot_disk_type": "pd-ssd" + } + } + \ No newline at end of file diff --git a/.github/workflows/execution-performance.yaml b/.github/workflows/execution-performance.yaml index 1597d9ecbc863..1f93a26c171ef 100644 --- a/.github/workflows/execution-performance.yaml +++ b/.github/workflows/execution-performance.yaml @@ -6,6 +6,9 @@ on: schedule: - cron: "0 */4 * * *" # This runs every four hours +permissions: + id-token: write + jobs: execution-performance: if: | # Only run on each PR once an appropriate event occurs @@ -22,7 +25,7 @@ jobs: with: GIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} RUNNER_NAME: executor-benchmark-runner - # Run all tests only on the scheduled cadence, or explicitly requested + # Run all tests only on the scheduled cadence, or explicitly requested FLOW: ${{ (github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'CICD:run-execution-performance-full-test')) && 'CONTINUOUS' || 'LAND_BLOCKING' }} # Ignore target determination if on the scheduled cadence, or explicitly requested IGNORE_TARGET_DETERMINATION: ${{ github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'CICD:run-execution-performance-test') || contains(github.event.pull_request.labels.*.name, 'CICD:run-execution-performance-full-test') }} diff --git a/.github/workflows/workflow-run-execution-performance.yaml b/.github/workflows/workflow-run-execution-performance.yaml index 349832f84ad75..98961f6440a6b 100644 --- a/.github/workflows/workflow-run-execution-performance.yaml +++ b/.github/workflows/workflow-run-execution-performance.yaml @@ -10,7 +10,7 @@ on: description: The git SHA1 to test. RUNNER_NAME: required: false - default: executor-benchmark-runner + default: executor-benchmark-runner type: string FLOW: required: false @@ -45,21 +45,21 @@ on: description: The git SHA1 to test. RUNNER_NAME: required: false - default: executor-benchmark-runner + default: executor-benchmark-runner type: choice options: - - executor-benchmark-runner - - executor-benchmark-ext4 - - executor-benchmark-xfs - - benchmark-t2d-32 - - benchmark-t2d-60 - - benchmark-c3d-30 - - benchmark-c3d-60 - - benchmark-c3d-180 - - benchmark-n4-32 - - benchmark-c4-32 - - benchmark-c4-48 - - benchmark-c4-96 + - executor-benchmark-runner + - executor-benchmark-ext4 + - executor-benchmark-xfs + - benchmark-t2d-32 + - benchmark-t2d-60 + - benchmark-c3d-30 + - benchmark-c3d-60 + - benchmark-c3d-180 + - benchmark-n4-32 + - benchmark-c4-32 + - benchmark-c4-48 + - benchmark-c4-96 description: The name of the runner to use for the test. (which decides machine specs) NUMBER_OF_EXECUTION_THREADS: required: false @@ -70,10 +70,10 @@ on: required: false default: LAND_BLOCKING options: - - LAND_BLOCKING - - CONTINUOUS - - MAINNET - - MAINNET_LARGE_DB + - LAND_BLOCKING + - CONTINUOUS + - MAINNET + - MAINNET_LARGE_DB type: choice description: Which set of tests to run. MAINNET/MAINNET_LARGE_DB are for performance validation of mainnet nodes. SKIP_MOVE_E2E: @@ -90,9 +90,13 @@ on: required: false default: ADHOC options: - - ADHOC + - ADHOC type: choice description: Test source (always adhoc from here) + +permissions: + id-token: write + jobs: # This job determines which tests to run test-target-determinator: @@ -105,26 +109,61 @@ jobs: id: determine_test_targets uses: ./.github/actions/test-target-determinator + create-runner: + if: ${{ inputs.IGNORE_TARGET_DETERMINATION || needs.test-target-determinator.outputs.run_execution_performance_test == 'true' }} + needs: test-target-determinator + runs-on: ubuntu-latest + outputs: + label: ${{ steps.create-runner.outputs.label }} + steps: + - uses: "actions/checkout@v4" + + - uses: "google-github-actions/auth@v2" + with: + workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} + service_account: github-actions-compute@aptos-ci.iam.gserviceaccount.com + project_id: ${{ secrets.GCP_PROJECT_ID }} + + - id: secrets + uses: "google-github-actions/get-secretmanager-secrets@v2" + with: + secrets: |- + token:aptos-ci/github-actions-repository-dispatch + + - name: Set Runner Configuration + id: set-config + run: | + config=$(jq -r --arg name "${{ inputs.runner_name }}" '.[$name]' .github/runner-configs.json) + echo "disk_size=$(echo $config | jq -r '.disk_size')" >> $GITHUB_ENV + echo "machine_type=$(echo $config | jq -r '.machine_type')" >> $GITHUB_ENV + echo "boot_disk_type=$(echo $config | jq -r '.boot_disk_type')" >> $GITHUB_ENV + + - id: create-runner + uses: aptos-labs/gce-github-runner@aluon/push-vkxzpxmtrunq + with: + token: ${{ steps.secrets.outputs.token }} + project_id: ${{ secrets.GCP_PROJECT_ID }} + disk_size: ${{ env.disk_size }} + machine_type: ${{ env.machine_type }} + boot_disk_type: ${{ env.boot_disk_type }} + # Run single node execution performance tests single-node-performance: - needs: test-target-determinator + needs: create-runner timeout-minutes: 120 - runs-on: ${{ inputs.RUNNER_NAME }} + runs-on: ${{ needs.create-runner.outputs.label }} steps: - uses: actions/checkout@v4 with: ref: ${{ inputs.GIT_SHA }} if: ${{ inputs.IGNORE_TARGET_DETERMINATION || needs.test-target-determinator.outputs.run_execution_performance_test == 'true' }} - - uses: aptos-labs/aptos-core/.github/actions/rust-setup@main + - uses: ./.github/actions/rust-setup with: GIT_CREDENTIALS: ${{ secrets.GIT_CREDENTIALS }} if: ${{ inputs.IGNORE_TARGET_DETERMINATION || needs.test-target-determinator.outputs.run_execution_performance_test == 'true' }} - name: Run single node execution benchmark in performance build mode shell: bash - run: TABULATE_INSTALL=lib-only pip install tabulate && FLOW="${{ inputs.FLOW }}" SOURCE="${{ inputs.SOURCE }}" RUNNER_NAME="${{ inputs.RUNNER_NAME }}" SKIP_MOVE_E2E="${{ inputs.SKIP_MOVE_E2E && '1' || '' }}" NUMBER_OF_EXECUTION_THREADS="${{ inputs.NUMBER_OF_EXECUTION_THREADS }}" testsuite/single_node_performance.py + run: TABULATE_INSTALL=lib-only pip install --break-system-packages tabulate && FLOW="${{ inputs.FLOW }}" SOURCE="${{ inputs.SOURCE }}" RUNNER_NAME="${{ inputs.RUNNER_NAME }}" SKIP_MOVE_E2E="${{ inputs.SKIP_MOVE_E2E && '1' || '' }}" NUMBER_OF_EXECUTION_THREADS="${{ inputs.NUMBER_OF_EXECUTION_THREADS }}" testsuite/single_node_performance.py if: ${{ (inputs.IGNORE_TARGET_DETERMINATION || needs.test-target-determinator.outputs.run_execution_performance_test == 'true') }} - - - run: echo "Skipping single node execution performance! Unrelated changes detected." - if: ${{ !inputs.IGNORE_TARGET_DETERMINATION && needs.test-target-determinator.outputs.run_execution_performance_test != 'true' }} diff --git a/scripts/dev_setup.sh b/scripts/dev_setup.sh index 84763fa616aed..663b93a58b506 100755 --- a/scripts/dev_setup.sh +++ b/scripts/dev_setup.sh @@ -657,7 +657,7 @@ function install_xsltproc { function install_nodejs { if [[ "$PACKAGE_MANAGER" == "apt-get" ]]; then curl -fsSL "https://deb.nodesource.com/setup_${NODE_MAJOR_VERSION}.x" -o nodesource_setup.sh - "${PRE_COMMAND[@]}" -E bash nodesource_setup.sh + "${PRE_COMMAND[@]}" bash nodesource_setup.sh fi install_pkg nodejs "$PACKAGE_MANAGER" install_pkg npm "$PACKAGE_MANAGER" diff --git a/testsuite/single_node_performance.py b/testsuite/single_node_performance.py index 1208b7629d85e..30b566cad69f9 100755 --- a/testsuite/single_node_performance.py +++ b/testsuite/single_node_performance.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright © Aptos Foundation # SPDX-License-Identifier: Apache-2.0