Change name #1
Workflow file for this run
This file contains hidden or 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
| on: | ||
| workflow_call: | ||
| inputs: | ||
| setup: | ||
| required: true | ||
| type: string | ||
| aws-access-key-id: | ||
| required: true | ||
| type: string | ||
| aws-secret-access-key: | ||
| required: true | ||
| type: string | ||
| aws-region: | ||
| required: true | ||
| type: string | ||
| architecture: | ||
| required: true | ||
| type: string | ||
| instance-type: | ||
| required: true | ||
| type: string | ||
| ami-id: | ||
| required: true | ||
| type: string | ||
| subnet-id: | ||
| required: true | ||
| type: string | ||
| security-group-id: | ||
| required: true | ||
| type: string | ||
| github-runner-label: | ||
| required: true | ||
| type: string | ||
| github-token: | ||
| required: true | ||
| type: string | ||
| jobs: | ||
| start-runner: | ||
| name: Start self-hosted EC2 runner | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| runner_label: ${{ steps.start-ec2-runner.outputs.label }} | ||
| ec2_instance_id: ${{ steps.start-ec2-runner.outputs.ec2_instance_id }} | ||
| steps: | ||
| - name: Configure AWS credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-access-key-id: ${{ inputs.aws-access-key-id }} | ||
| aws-secret-access-key: ${{ inputs.aws-secret-access-key }} | ||
| aws-region: ${{ inputs.aws-region }} | ||
| - name: Start EC2 runner | ||
| id: start-ec2-runner | ||
| uses: machulav/ec2-github-runner@v2 | ||
| env: | ||
| SUBNET_ID: ${{ inputs.subnet-id }} | ||
| SECURITY_GROUP_ID: ${{ inputs.security-group-id }} | ||
| with: | ||
| mode: start | ||
| github-token: ${{ inputs.github-token }} | ||
| ec2-image-id: ${{ inputs.ami-id }} | ||
| ec2-instance-type: ${{ inputs.instance-type }} | ||
| subnet-id: ${{ inputs.subnet-id }} | ||
| security-group-id: ${{ inputs.security-group-id }} | ||
| label: ${{ inputs.github-runner-label }} | ||
| benchmark: | ||
| name: Run benchmarks on runner | ||
| needs: start-runner | ||
| runs-on: ${{ needs.start-runner.outputs.runner_label }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.number && format('refs/pull/{0}/merge', github.event.number) || github.head_ref }} | ||
| - name: Print runner info | ||
| run: | | ||
| printf "Runner lscpu:\n$(lscpu)\n" | ||
| printf "Runner lsmem:\n$(lsmem)\n" | ||
| printf "Runner nproc:\n$(nproc)\n" | ||
| printf "Runner uname:\n$(uname -a)\n" | ||
| printf "Runner arch:\n$(arch)\n" | ||
| - name: Install benchmark dependencies | ||
| run: | | ||
| sudo .install/install_script.sh | ||
| sudo apt install python3-pip -y | ||
| pip3 install --upgrade pip PyYAML setuptools redisbench-admin | ||
| pip3 install -r requirements.txt | ||
| - name: Download pre-generated indices | ||
| timeout-minutes: 20 | ||
| run: ./tests/benchmark/bm_files.sh ${{ inputs.setup }} | ||
| - name: Run Benchmark | ||
| env: | ||
| ARCH: ${{ inputs.architecture }} | ||
| timeout-minutes: 120 | ||
| run: | | ||
| if [[ $ARCH == "aarch64" ]]; then | ||
| source /usr/share/modules/init/bash | ||
| export MODULEPATH=$MODULEPATH:/opt/arm/modulefiles | ||
| module load armpl/24.10.0_gcc | ||
| fi | ||
| make benchmark BM_FILTER=${{ inputs.setup }} | ||
| - name: Collect results | ||
| run: | | ||
| ./tests/benchmark/benchmarks.sh ${{ inputs.setup }} | xargs -P 0 -I {} redisbench-admin export \ | ||
| --redistimeseries_host ${{ secrets.PERFORMANCE_RTS_HOST }} \ | ||
| --redistimeseries_port ${{ secrets.PERFORMANCE_RTS_PORT }} \ | ||
| --redistimeseries_user default \ | ||
| --redistimeseries_pass '${{ secrets.PERFORMANCE_RTS_AUTH }}' \ | ||
| --github_repo ${{ github.event.repository.name }} \ | ||
| --github_org ${{ github.repository_owner }} \ | ||
| --github_branch ${{ github.head_ref || github.ref_name }} \ | ||
| --github_actor ${{ github.triggering_actor }} \ | ||
| --results-format google.benchmark \ | ||
| --benchmark-result-file {}_results.json | ||
| stop-runner: | ||
| name: Stop self-hosted EC2 runner | ||
| needs: benchmark | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Configure AWS credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-access-key-id: ${{ inputs.aws-access-key-id }} | ||
| aws-secret-access-key: ${{ inputs.aws-secret-access-key }} | ||
| aws-region: ${{ inputs.aws-region }} | ||
| - name: Stop EC2 runner | ||
| uses: machulav/ec2-github-runner@v2 | ||
| with: | ||
| mode: stop | ||
| github-token: ${{ inputs.github-token }} | ||
| label: ${{ inputs.github-runner-label }} | ||
| ec2-instance-id: ${{ needs.start-runner.outputs.ec2_instance_id }} | ||